Skip to content

Instantly share code, notes, and snippets.

@c3ry5 c3ry5/json.fix.js
Created Aug 5, 2015

Embed
What would you like to do?
A fix for malformed json
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
You can’t perform that action at this time.