Created
July 13, 2025 17:34
-
-
Save arleighdickerson/23645ee12596a19536f22e80a27b512e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// noinspection RegExpSingleCharAlternation,RegExpUnnecessaryNonCapturingGroup | |
const isoEightSixZeroOne = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*))(?:Z|(\+|-)([\d|:]*))?$/; | |
export namespace jsonUtil { | |
export function isJsonPatch(obj: any): obj is unknown { | |
return false; | |
} | |
export function jsonReviver(key: string, value: any) { | |
return typeof value === 'string' && isoEightSixZeroOne.exec(value) ? new Date(value) : value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment