7 lines
199 B
TypeScript
7 lines
199 B
TypeScript
export function dateReviver(name, value) {
|
|
if (typeof value === "string" && /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\d\d\dZ$/.test(value)) {
|
|
return new Date(value);
|
|
}
|
|
return value;
|
|
}
|