@budibase/string-templates 2.18.0 → 2.18.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.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@budibase/string-templates",
3
- "version": "2.18.0",
3
+ "version": "2.18.2",
4
4
  "description": "Handlebars wrapper for Budibase templating.",
5
- "main": "src/index.cjs",
5
+ "main": "src/index.js",
6
6
  "module": "dist/bundle.mjs",
7
7
  "license": "MPL-2.0",
8
8
  "types": "dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "require": "./src/index.cjs",
11
+ "require": "./src/index.js",
12
12
  "import": "./dist/bundle.mjs"
13
13
  },
14
14
  "./package.json": "./package.json",
@@ -29,8 +29,7 @@
29
29
  "@budibase/handlebars-helpers": "^0.13.1",
30
30
  "dayjs": "^1.10.8",
31
31
  "handlebars": "^4.7.6",
32
- "lodash.clonedeep": "^4.5.0",
33
- "vm2": "^3.9.19"
32
+ "lodash.clonedeep": "^4.5.0"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@rollup/plugin-commonjs": "^17.1.0",
@@ -47,5 +46,5 @@
47
46
  "rollup-plugin-terser": "^7.0.2",
48
47
  "typescript": "5.2.2"
49
48
  },
50
- "gitHead": "0ec725ca4b2e8121fc1eb94b3325ba49fc7c4ecc"
49
+ "gitHead": "f1ef059bfb3d19dead719f2289b8fff429fda2a9"
51
50
  }
@@ -4,7 +4,7 @@ const { LITERAL_MARKER } = require("../helpers/constants")
4
4
  const { getJsHelperList } = require("./list")
5
5
 
6
6
  // The method of executing JS scripts depends on the bundle being built.
7
- // This setter is used in the entrypoint (either index.cjs or index.mjs).
7
+ // This setter is used in the entrypoint (either index.js or index.mjs).
8
8
  let runJS
9
9
  module.exports.setJSRunner = runner => (runJS = runner)
10
10
 
package/dist/index.d.cts DELETED
@@ -1 +0,0 @@
1
- export { isValid, makePropSafe, getManifest, isJSBinding, encodeJSBinding, decodeJSBinding, processStringSync, processObjectSync, processString, processObject, doesContainStrings, doesContainString, disableEscaping, findHBSBlocks, convertToJS, setJSRunner, FIND_ANY_HBS_REGEX, helpersToRemoveForJs };
package/src/index.cjs DELETED
@@ -1,43 +0,0 @@
1
- const templates = require("./index.js")
2
-
3
- /**
4
- * CJS entrypoint for rollup
5
- */
6
- module.exports.isValid = templates.isValid
7
- module.exports.makePropSafe = templates.makePropSafe
8
- module.exports.getManifest = templates.getManifest
9
- module.exports.isJSBinding = templates.isJSBinding
10
- module.exports.encodeJSBinding = templates.encodeJSBinding
11
- module.exports.decodeJSBinding = templates.decodeJSBinding
12
- module.exports.processStringSync = templates.processStringSync
13
- module.exports.processObjectSync = templates.processObjectSync
14
- module.exports.processString = templates.processString
15
- module.exports.processObject = templates.processObject
16
- module.exports.doesContainStrings = templates.doesContainStrings
17
- module.exports.doesContainString = templates.doesContainString
18
- module.exports.disableEscaping = templates.disableEscaping
19
- module.exports.findHBSBlocks = templates.findHBSBlocks
20
- module.exports.convertToJS = templates.convertToJS
21
- module.exports.setJSRunner = templates.setJSRunner
22
- module.exports.FIND_ANY_HBS_REGEX = templates.FIND_ANY_HBS_REGEX
23
- module.exports.helpersToRemoveForJs = templates.helpersToRemoveForJs
24
-
25
- if (!process.env.NO_JS) {
26
- const { VM } = require("vm2")
27
- const { setJSRunner } = require("./helpers/javascript")
28
- /**
29
- * Use vm2 to run JS scripts in a node env
30
- */
31
- setJSRunner((js, context) => {
32
- const vm = new VM({
33
- sandbox: context,
34
- timeout: 1000,
35
- })
36
- return vm.run(js)
37
- })
38
- }
39
-
40
- const errors = require("./errors")
41
- for (const error in errors) {
42
- module.exports[error] = errors[error]
43
- }