Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Last active February 10, 2020 12:52
Show Gist options
  • Save luislobo14rap/105bc4dcbeb0b1386b55f9c24830d47a to your computer and use it in GitHub Desktop.
Save luislobo14rap/105bc4dcbeb0b1386b55f9c24830d47a to your computer and use it in GitHub Desktop.
// json-clone.js v1.0.1
function jsonClone(json) {
return JSON.parse(JSON.stringify(json));
};
if (typeof JSON.clone == 'undefined') {
JSON.clone = function(json) {
return jsonClone(json);
};
};
// json-clone.min.js v1.0.1
function jsonClone(a){return JSON.parse(JSON.stringify(a))}'undefined'==typeof JSON.clone&&(JSON.clone=function(a){return jsonClone(a)});
@luislobo14rap
Copy link
Author

performance tests
raml-org/raml-js-parser-2#814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment