Socket
Socket
Sign inDemoInstall

jsonc-parser

Package Overview
Dependencies
0
Maintainers
11
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.0 to 2.3.1

.mocharc.json

10

.eslintrc.json

@@ -13,3 +13,11 @@

"rules": {
"@typescript-eslint/class-name-casing": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "typeLike",
"format": [
"PascalCase"
]
}
],
"@typescript-eslint/semi": "warn",

@@ -16,0 +24,0 @@ "curly": "warn",

2

CHANGELOG.md
2.3.0 2020-07-03
==================
* new API `ModificationOptions.isArrayInsertion`: If `JSONPath` refers to an index of an array and `isArrayInsertion` is `true`, then `modify` will insert a new item at that location instead of overwriting its contents.
* `ModificationOptions.formattingOptions` is now optional. If not set, newly inserted content will be not be formatted.
* `ModificationOptions.formattingOptions` is now optional. If not set, newly inserted content will not be formatted.

@@ -6,0 +6,0 @@

@@ -445,12 +445,7 @@ /*---------------------------------------------------------------------------------------------

case 11 /* NumericLiteral */:
var value = 0;
try {
value = JSON.parse(_scanner.getTokenValue());
if (typeof value !== 'number') {
handleError(2 /* InvalidNumberFormat */);
value = 0;
}
}
catch (e) {
var tokenValue = _scanner.getTokenValue();
var value = Number(tokenValue);
if (isNaN(value)) {
handleError(2 /* InvalidNumberFormat */);
value = 0;
}

@@ -457,0 +452,0 @@ onLiteralValue(value);

@@ -464,12 +464,7 @@ (function (factory) {

case 11 /* NumericLiteral */:
var value = 0;
try {
value = JSON.parse(_scanner.getTokenValue());
if (typeof value !== 'number') {
handleError(2 /* InvalidNumberFormat */);
value = 0;
}
}
catch (e) {
var tokenValue = _scanner.getTokenValue();
var value = Number(tokenValue);
if (isNaN(value)) {
handleError(2 /* InvalidNumberFormat */);
value = 0;
}

@@ -476,0 +471,0 @@ onLiteralValue(value);

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

@@ -18,9 +18,9 @@ "main": "./lib/umd/main.js",

"devDependencies": {
"mocha": "^7.1.2",
"typescript": "^3.6.4",
"mocha": "^8.1.3",
"typescript": "^4.0.2",
"@types/node": "^10.12.12",
"@types/mocha": "^5.2.7",
"@typescript-eslint/eslint-plugin": "^2.30.0",
"@typescript-eslint/parser": "^2.30.0",
"eslint": "^7.3.1",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"eslint": "^7.9.0",
"rimraf": "^3.0.2"

@@ -36,3 +36,3 @@ },

"watch": "tsc -w -p ./src",
"test": "npm run compile && mocha",
"test": "npm run compile && mocha ./lib/umd/test",
"lint": "eslint src/**/*.ts",

@@ -39,0 +39,0 @@ "preversion": "npm test",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc