@znemz/cfn-include 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -2
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -236,7 +236,10 @@ async function recurse({ base, scope, cft, ...opts }) {
236
236
  }
237
237
  );
238
238
  }
239
- if (cft['Fn::Eval'] && opts.doEval) {
239
+ if (cft['Fn::Eval']) {
240
+ if (!opts.doEval) {
241
+ return Promise.reject(new Error('Fn::Eval is not allowed doEval is falsy'));
242
+ }
240
243
  return recurse({ base, scope, cft: cft['Fn::Eval'], ...opts }).then(function (json) {
241
244
  // **WARNING** you have now enabled god mode
242
245
  // eslint-disable-next-line no-unused-vars, prefer-const
@@ -391,7 +394,10 @@ async function recurse({ base, scope, cft, ...opts }) {
391
394
  return isString ? seq.map((i) => String.fromCharCode(i)) : seq;
392
395
  }
393
396
 
394
- if (cft['Fn::IfEval'] && opts.doEval) {
397
+ if (cft['Fn::IfEval']) {
398
+ if (!opts.doEval) {
399
+ return Promise.reject(new Error('Fn::IfEval is not allowed doEval is falsy'));
400
+ }
395
401
  return recurse({ base, scope, cft: cft['Fn::IfEval'], ...opts }).then(function (json) {
396
402
  // eslint-disable-next-line prefer-const
397
403
  let { truthy, falsy, evalCond, inject, doLog } = json;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@znemz/cfn-include",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Preprocessor for CloudFormation templates with support for loops and flexible include statements",
5
5
  "keywords": [
6
6
  "aws",
@@ -37,8 +37,8 @@
37
37
  "prepare": "sort-package-json",
38
38
  "serve": "serve ./t/fixtures -l 9999",
39
39
  "test": "npm run test:this",
40
- "test:this": "run-p -r serve test:run",
41
- "test:run": "sleep 1 && mocha --timeout 20000 --bail t/include.js t/cli.js t/replaceEnv.js"
40
+ "test:run": "sleep 1 && mocha --timeout 20000 --bail t/include.js t/cli.js t/replaceEnv.js",
41
+ "test:this": "run-p -r serve test:run"
42
42
  },
43
43
  "dependencies": {
44
44
  "@aws-sdk/client-cloudformation": "^3.637.0",
@@ -64,7 +64,7 @@
64
64
  "commit-and-tag-version": "12",
65
65
  "commitlint": "19",
66
66
  "eslint": "8",
67
- "eslint-config-prettier": "9",
67
+ "eslint-config-prettier": "10",
68
68
  "eslint-config-standard": "17",
69
69
  "eslint-plugin-mocha": "10",
70
70
  "eslint-plugin-prettier": "5",
@@ -72,7 +72,7 @@
72
72
  "npm-run-all": "4.1.5",
73
73
  "prettier": "3",
74
74
  "serve": "14.2.4",
75
- "sort-package-json": "2.10.1"
75
+ "sort-package-json": "3.2.1"
76
76
  },
77
77
  "originalAuthor": {
78
78
  "name": "Moritz Onken",