Comparing version 4.4.3 to 4.5.0
{ | ||
"name": "json-e", | ||
"version": "4.4.3", | ||
"version": "4.5.0", | ||
"description": "json parameterization module inspired from json-parameterization", | ||
"main": "./src/index.js", | ||
"browser": "./dist/index.js", | ||
"types": "./src/index.d.ts", | ||
@@ -10,7 +11,8 @@ "scripts": { | ||
"test": "yarn lint && mocha test/*_test.js", | ||
"build-demo": "cd demo && yarn && yarn build", | ||
"start-demo": "cd demo && yarn && yarn start" | ||
"rollup": "rollup -c rollup.config.js", | ||
"prepack": "npm run rollup" | ||
}, | ||
"files": [ | ||
"src" | ||
"src", | ||
"dist/index.js" | ||
], | ||
@@ -27,6 +29,9 @@ "repository": { | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"assume": "^2.0.0", | ||
"browserify": "^14.5.0", | ||
"eslint": "^5.12.1", | ||
"mocha": "^8.4.0", | ||
"mocha": "^9.2.0", | ||
"rollup": "^2.66.0", | ||
"source-map-support": "^0.5.0", | ||
@@ -36,3 +41,3 @@ "timekeeper": "^2.0.0" | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
@@ -39,0 +44,0 @@ "renovate": { |
@@ -242,3 +242,3 @@ /* eslint-disable */ | ||
operators.$switch = (template, context) => { | ||
checkUndefinedProperties(template, ['\\$switch']); | ||
checkUndefinedProperties(template, [ '\\$switch' ]); | ||
@@ -252,3 +252,3 @@ if (!isObject(template['$switch'])) { | ||
for (let condition of Object.keys(conditions)) { | ||
for (let condition of Object.keys(conditions).filter(k => k !== '$default').sort()) { | ||
if (isTruthy(parse(condition, context))) { | ||
@@ -263,2 +263,6 @@ result.push(render(conditions[condition], context)); | ||
if (result.length === 0 && conditions[ '$default' ]) { | ||
result.push(render(conditions[ '$default' ], context)); | ||
} | ||
return result.length > 0 ? result[0] : deleteMarker; | ||
@@ -265,0 +269,0 @@ }; |
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
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
100773
13
2763
9