Socket
Socket
Sign inDemoInstall

json-e

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-e - npm Package Compare versions

Comparing version 4.3.0 to 4.4.0

2

package.json
{
"name": "json-e",
"version": "4.3.0",
"version": "4.4.0",
"description": "json parameterization module inspired from json-parameterization",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -5,3 +5,3 @@ var {BuiltinError} = require('./error');

isString, isNumber, isBool,
isArray, isObject, isJSON,
isArray, isObject,
isNull, isFunction,

@@ -16,3 +16,2 @@ } = require('./type-utils');

object: isObject,
json: isJSON,
null: isNull,

@@ -19,0 +18,0 @@ function: isFunction,

@@ -14,6 +14,6 @@ /* eslint-disable */

var addBuiltins = require('./builtins');
var {JSONTemplateError, TemplateError} = require('./error');
var {JSONTemplateError, TemplateError, SyntaxError} = require('./error');
let syntaxRuleError = (token) => {
return new SyntaxError(`Found ${token.value}, expected !=, &&, (, *, **, +, -, ., /, <, <=, ==, >, >=, [, in, ||`);
return new SyntaxError(`Found: ${token.value} token, expected one of: !=, &&, (, *, **, +, -, ., /, <, <=, ==, >, >=, [, in, ||`);
};

@@ -20,0 +20,0 @@

@@ -6,3 +6,3 @@ const {UnaryOp, BinOp, Primitive, ContextValue, FunctionCall, ValueAccess, List, Object} = require("../src/AST");

expects.sort();
return new SyntaxError(`Found ${token.value}, expected ${expects.join(', ')}`, token);
return new SyntaxError(`Found: ${token.value} token, expected one of: ${expects.join(', ')}`, token);
};

@@ -9,0 +9,0 @@

@@ -10,25 +10,2 @@ let utils = {

isFunction: expr => expr instanceof Function,
isJSON: expr => {
if (utils.isString(expr) || utils.isNumber(expr) || utils.isBool(expr) || expr === null) {
return true;
}
if (utils.isArray(expr)) {
return expr.every(v => utils.isJSON(v));
}
let result = true;
if (utils.isobject(expr)) {
for (let key of Object.keys(expr)) {
if (expr.hasOwnProperty(key)) {
result = result && utils.isJSON(expr[key]);
if (!result) {
break;
}
}
}
return result;
}
return false;
},
isTruthy: expr => {

@@ -35,0 +12,0 @@ return expr!== null && (

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