Skip to content

Instantly share code, notes, and snippets.

@tcoupin
Created December 18, 2015 20:06
Show Gist options
  • Select an option

  • Save tcoupin/2bb6b7e6f213efcd3866 to your computer and use it in GitHub Desktop.

Select an option

Save tcoupin/2bb6b7e6f213efcd3866 to your computer and use it in GitHub Desktop.
JSON.parse allow comments
/*
* Auteur : Thibault Coupin
* Description : Surcharge de JSON.parse pour nettoyer les commentaires.
*/
var stripJsonComments = require('strip-json-comments');
(function(){
var proxied = JSON.parse;
JSON.parse = function(str){
return proxied(stripJsonComments(str));
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment