Comparing version 4.3.0 to 4.4.0
{ | ||
"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 && ( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
2
45400
11
1316
1
0