Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsonc-parser

Package Overview
Dependencies
Maintainers
11
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonc-parser - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

1

lib/main.d.ts

@@ -8,2 +8,3 @@ export declare enum ScanError {

InvalidEscapeCharacter = 5,
InvalidCharacter = 6,
}

@@ -10,0 +11,0 @@ export declare enum SyntaxKind {

19

lib/main.js

@@ -25,2 +25,3 @@ (function (factory) {

ScanError[ScanError["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
ScanError[ScanError["InvalidCharacter"] = 6] = "InvalidCharacter";
})(ScanError = exports.ScanError || (exports.ScanError = {}));

@@ -191,6 +192,11 @@ var SyntaxKind;

}
if (isLineBreak(ch)) {
result += text.substring(start, pos);
scanError = ScanError.UnexpectedEndOfString;
break;
if (ch >= 0 && ch <= 0x1f) {
if (isLineBreak(ch)) {
result += text.substring(start, pos);
scanError = ScanError.UnexpectedEndOfString;
break;
}
else {
scanError = ScanError.InvalidCharacter;
}
}

@@ -479,3 +485,3 @@ pos++;

isAtPropertyKey = position > offset;
segments.push(''); // push a placeholder (will be replaced or removed)
segments.push(''); // push a placeholder (will be replaced)
},

@@ -550,5 +556,2 @@ onObjectProperty: function (name, offset, length) {

}
if (segments[segments.length - 1] === '') {
segments.pop();
}
return {

@@ -555,0 +558,0 @@ path: segments,

{
"name": "jsonc-parser",
"version": "0.3.1",
"version": "0.4.0",
"description": "Scanner and parser for JSON with comments.",

@@ -16,17 +16,17 @@ "main": "./lib/main.js",

},
"devDependencies": {
"mocha": "^2.4.5",
"typescript": "^2.1.5",
"devDependencies": {
"mocha": "^2.4.5",
"typescript": "^2.1.5",
"@types/node": "^6.0.46",
"@types/mocha": "^2.2.32"
},
"dependencies": {
"vscode-nls": "^2.0.2"
},
"scripts": {
"prepublish": "tsc -p ./src",
"compile": "tsc -p ./src",
"watch": "tsc -w -p ./src",
},
"dependencies": {
"vscode-nls": "^2.0.2"
},
"scripts": {
"prepublish": "tsc -p ./src",
"compile": "tsc -p ./src",
"watch": "tsc -w -p ./src",
"test": "tsc -p ./src && mocha"
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc