json-parser
Advanced tools
+1
-1
| { | ||
| "name": "json-parser", | ||
| "version": "2.0.3", | ||
| "version": "2.1.0", | ||
| "description": "JSON parser to parse JSON object and MAINTAIN comments.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
+14
-1
@@ -21,2 +21,3 @@ // JSON formatting | ||
| let tokens = null | ||
| let last = null | ||
| let current = null | ||
@@ -30,2 +31,3 @@ let index | ||
| last = null | ||
| last_prop = UNDEFINED | ||
@@ -41,2 +43,3 @@ } | ||
| tokens = | ||
| last = | ||
| current = | ||
@@ -72,3 +75,12 @@ reviver = null | ||
| const unexpected_end = () => { | ||
| throw new SyntaxError('Unexpected end of JSON input') | ||
| const error = new SyntaxError('Unexpected end of JSON input') | ||
| Object.assign(error, last | ||
| ? last.loc.end | ||
| // Empty string | ||
| : { | ||
| line: 1, | ||
| column: 0 | ||
| }) | ||
| throw error | ||
| } | ||
@@ -83,2 +95,3 @@ | ||
| last = current | ||
| current = new_token | ||
@@ -85,0 +98,0 @@ } |
13007
1.5%276
4.55%