Created
August 5, 2015 12:12
-
-
Save c3ry5/537b62dc13138c6ff94e to your computer and use it in GitHub Desktop.
A fix for malformed json
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
JSON.fix = function(obj) { | |
return obj.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g, '"$2": '); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment