Created
April 3, 2015 21:44
-
-
Save JonnyBurger/e1bcf91781e06225d111 to your computer and use it in GitHub Desktop.
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
(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