Skip to content

Instantly share code, notes, and snippets.

@JonnyBurger
Created April 3, 2015 21:44
Show Gist options
  • Save JonnyBurger/e1bcf91781e06225d111 to your computer and use it in GitHub Desktop.
Save JonnyBurger/e1bcf91781e06225d111 to your computer and use it in GitHub Desktop.
(function(){
var parse = JSON.parse;
JSON = {
stringify: JSON.stringify,
validate: function(str){
try{
parse(str);
return true;
}catch(err){
return err;
}
},
parse: function(str){
try{
return parse(str);
}catch(err){
return undefined;
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment