6 lines
219 B
TypeScript
6 lines
219 B
TypeScript
export function toIsoString(input: Date | string | null | undefined): string | null {
|
|
if (input === null || input === undefined) return null;
|
|
if (input instanceof Date) return input.toISOString();
|
|
return input;
|
|
}
|