2022-03-26 00:40:43 +00:00
|
|
|
export const stringifyISODate = (date: Date|undefined): string => {
|
|
|
|
return `${date?.toISOString()}`
|
2022-03-26 04:28:53 +00:00
|
|
|
}
|
2022-03-26 23:58:22 +00:00
|
|
|
// FIXME: debug this, supposed to take an array/object and auto strinfy date-like values
|
2022-03-26 04:28:53 +00:00
|
|
|
export const autoStringifyDateValues = ([key, value]: [string, unknown]): [string, unknown] => {
|
|
|
|
return [key, typeof value === "object" && value instanceof Date ? stringifyISODate(value) : value]
|
2022-03-26 00:40:43 +00:00
|
|
|
}
|