Skip to content

Commit

Permalink
strip comments from the JSON config file (jsdoc#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Jun 10, 2014
1 parent fd5ca94 commit d4219ba
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = (function() {
'use strict';

var logger = require('jsdoc/util/logger');
var stripJsonComments = require('strip-json-comments');

var hasOwnProp = Object.prototype.hasOwnProperty;

Expand Down Expand Up @@ -86,7 +87,7 @@ cli.loadConfig = function() {
}

try {
env.conf = new Config( fs.readFileSync(confPath, 'utf8') )
env.conf = new Config( stripJsonComments(fs.readFileSync(confPath, 'utf8')) )
.get();
}
catch (e) {
Expand Down
61 changes: 61 additions & 0 deletions node_modules/strip-json-comments/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions node_modules/strip-json-comments/strip-json-comments.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"js2xmlparser": "~0.1.0",
"marked": "~0.3.1",
"requizzle": "~0.1.0",
"strip-json-comments": "~0.1.3",
"taffydb": "https://github.com/hegemonic/taffydb/tarball/master",
"underscore": "~1.6.0",
"wrench": "~1.3.9"
Expand Down

0 comments on commit d4219ba

Please sign in to comment.