json-comment-parser
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.1.2"></a> | ||
## [1.1.2](https://github.com/forsigner/json-comment-parser/compare/v1.1.1...v1.1.2) (2018-01-02) | ||
### Bug Fixes | ||
* fix parse comment bug ([fd59ec9](https://github.com/forsigner/json-comment-parser/commit/fd59ec9)) | ||
<a name="1.1.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.1.1](https://github.com/forsigner/json-comment-parser/compare/v1.1.0...v1.1.1) (2018-01-02) |
@@ -12,2 +12,3 @@ 'use strict'; | ||
var comments = getComments(source); | ||
console.log('comments.............'); | ||
console.log(comments); | ||
@@ -24,23 +25,21 @@ /* eslint-disable no-new-func */ | ||
var temp = obj.constructor(); | ||
var temp = {}; | ||
var _loop = function _loop(key) { | ||
if (typeof obj[key] !== 'string') { | ||
if (_typeof(obj[key]) === 'object') { | ||
temp[key] = handleOrigin(obj[key]); | ||
return 'continue'; | ||
} else { | ||
console.log('----------------'); | ||
var find = comments.find(function (item) { | ||
return item.key === '// ' + key; | ||
}); | ||
if (find) { | ||
temp['// ' + key] = find.value; | ||
} | ||
temp[key] = obj[key]; | ||
} | ||
var find = comments.find(function (item) { | ||
return item.key === '// ' + key; | ||
}); | ||
if (find) { | ||
temp['// ' + key] = find.value; | ||
} | ||
temp[key] = obj[key]; | ||
}; | ||
for (var key in obj) { | ||
var _ret = _loop(key); | ||
if (_ret === 'continue') continue; | ||
_loop(key); | ||
} | ||
@@ -47,0 +46,0 @@ |
{ | ||
"name": "json-comment-parser", | ||
"description": "", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "author": { |
6648
131