Created
March 12, 2018 14:54
-
-
Save zGrav/79449d714b9cab7907281df58d38ba01 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
const objectParse = JSON.parse(stringify, (k, v) => { | |
if ( | |
v !== null && | |
typeof v === 'object' && | |
'type' in v && | |
v.type === 'Buffer' && | |
'data' in v && | |
Array.isArray(v.data)) { | |
return new Buffer(v.data); | |
} | |
return v; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment