Created
May 24, 2019 16:28
-
-
Save yifeiyin/b89dbe52ff67e36f33aa1106a88b2279 to your computer and use it in GitHub Desktop.
A json parse reviver
This file contains 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
reviver = (k, v) => { | |
console.log(`-- (${k}, ${v})`); | |
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/.test(v) ? new Date(v) : v; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment