cyberchef 9.32.3 → 9.33.0

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 (48) hide show
  1. package/.eslintrc.json +1 -1
  2. package/.nvmrc +1 -1
  3. package/CHANGELOG.md +12 -1
  4. package/Gruntfile.js +9 -17
  5. package/babel.config.js +1 -0
  6. package/package.json +24 -21
  7. package/src/core/ChefWorker.js +1 -1
  8. package/src/core/Recipe.mjs +1 -1
  9. package/src/core/config/modules/Bletchley.mjs +1 -1
  10. package/src/core/config/modules/Charts.mjs +1 -1
  11. package/src/core/config/modules/Ciphers.mjs +1 -1
  12. package/src/core/config/modules/Code.mjs +1 -1
  13. package/src/core/config/modules/Compression.mjs +1 -1
  14. package/src/core/config/modules/Crypto.mjs +1 -1
  15. package/src/core/config/modules/Default.mjs +1 -1
  16. package/src/core/config/modules/Diff.mjs +1 -1
  17. package/src/core/config/modules/Encodings.mjs +1 -1
  18. package/src/core/config/modules/Hashing.mjs +1 -1
  19. package/src/core/config/modules/Image.mjs +1 -1
  20. package/src/core/config/modules/OCR.mjs +1 -1
  21. package/src/core/config/modules/OpModules.mjs +1 -1
  22. package/src/core/config/modules/PGP.mjs +1 -1
  23. package/src/core/config/modules/Protobuf.mjs +1 -1
  24. package/src/core/config/modules/PublicKey.mjs +1 -1
  25. package/src/core/config/modules/Regex.mjs +1 -1
  26. package/src/core/config/modules/Serialise.mjs +1 -1
  27. package/src/core/config/modules/Shellcode.mjs +1 -1
  28. package/src/core/config/modules/URL.mjs +1 -1
  29. package/src/core/config/modules/UserAgent.mjs +1 -1
  30. package/src/core/config/modules/Yara.mjs +1 -1
  31. package/src/core/errors/index.mjs +1 -1
  32. package/src/core/lib/Magic.mjs +1 -1
  33. package/src/core/operations/index.mjs +1 -1
  34. package/src/node/api.mjs +1 -1
  35. package/src/node/config/scripts/generateNodeIndex.mjs +2 -2
  36. package/src/node/index.mjs +2 -2
  37. package/src/node/{repl.js → repl.mjs} +2 -2
  38. package/src/node/wrapper.js +11 -0
  39. package/src/web/index.js +2 -2
  40. package/src/web/static/sitemap.mjs +1 -1
  41. package/tests/node/consumers/cjs-consumer.js +20 -17
  42. package/tests/node/consumers/esm-consumer.mjs +22 -2
  43. package/tests/node/tests/Categories.mjs +2 -2
  44. package/tests/node/tests/operations.mjs +1 -1
  45. package/tests/operations/tests/AvroToJSON.mjs +1 -1
  46. package/tests/operations/tests/BaconCipher.mjs +2 -2
  47. package/src/node/cjs.js +0 -13
  48. package/tests/node/consumers/esm-deep-import-consumer.mjs +0 -28
package/.eslintrc.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "parser": "babel-eslint",
2
+ "parser": "@babel/eslint-parser",
3
3
  "parserOptions": {
4
4
  "ecmaVersion": 9,
5
5
  "ecmaFeatures": {
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- lts/dubnium
1
+ 17
package/CHANGELOG.md CHANGED
@@ -13,6 +13,10 @@ All major and minor version changes will be documented in this file. Details of
13
13
 
14
14
  ## Details
15
15
 
16
+ ### [9.33.0] - 2022-03-25
17
+ - Updated to support Node 17 [@n1474335] [@john19696] [@t-8ch] | [[#1326] [#1313] [#1244]
18
+ - Improved CJS and ESM module support [@d98762625] | [#1037]
19
+
16
20
  ### [9.32.0] - 2021-08-18
17
21
  - 'Protobuf Encode' operation added and decode operation modified to allow decoding with full and partial schemas [@n1474335] | [dd18e52]
18
22
 
@@ -271,6 +275,7 @@ All major and minor version changes will be documented in this file. Details of
271
275
 
272
276
 
273
277
 
278
+ [9.33.0]: https://github.com/gchq/CyberChef/releases/tag/v9.33.0
274
279
  [9.32.0]: https://github.com/gchq/CyberChef/releases/tag/v9.32.0
275
280
  [9.31.0]: https://github.com/gchq/CyberChef/releases/tag/v9.31.0
276
281
  [9.30.0]: https://github.com/gchq/CyberChef/releases/tag/v9.30.0
@@ -384,6 +389,8 @@ All major and minor version changes will be documented in this file. Details of
384
389
  [@dmfj]: https://github.com/dmfj
385
390
  [@mattnotmitt]: https://github.com/mattnotmitt
386
391
  [@Danh4]: https://github.com/Danh4
392
+ [@john19696]: https://github.com/john19696
393
+ [@t-8ch]: https://github.com/t-8ch
387
394
 
388
395
  [8ad18b]: https://github.com/gchq/CyberChef/commit/8ad18bc7db6d9ff184ba3518686293a7685bf7b7
389
396
  [9a33498]: https://github.com/gchq/CyberChef/commit/9a33498fed26a8df9c9f35f39a78a174bf50a513
@@ -466,6 +473,10 @@ All major and minor version changes will be documented in this file. Details of
466
473
  [#999]: https://github.com/gchq/CyberChef/pull/999
467
474
  [#1006]: https://github.com/gchq/CyberChef/pull/1006
468
475
  [#1022]: https://github.com/gchq/CyberChef/pull/1022
476
+ [#1037]: https://github.com/gchq/CyberChef/pull/1037
469
477
  [#1045]: https://github.com/gchq/CyberChef/pull/1045
470
478
  [#1049]: https://github.com/gchq/CyberChef/pull/1049
471
- [#1083]: https://github.com/gchq/CyberChef/pull/1083
479
+ [#1083]: https://github.com/gchq/CyberChef/pull/1083
480
+ [#1244]: https://github.com/gchq/CyberChef/pull/1244
481
+ [#1313]: https://github.com/gchq/CyberChef/pull/1313
482
+ [#1326]: https://github.com/gchq/CyberChef/pull/1326
package/Gruntfile.js CHANGED
@@ -6,6 +6,8 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPl
6
6
  const glob = require("glob");
7
7
  const path = require("path");
8
8
 
9
+ const nodeFlags = "--experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings --no-deprecation";
10
+
9
11
  /**
10
12
  * Grunt configuration for building the app in various formats.
11
13
  *
@@ -48,7 +50,7 @@ module.exports = function (grunt) {
48
50
 
49
51
  grunt.registerTask("testnodeconsumer",
50
52
  "A task which checks whether consuming CJS and ESM apps work with the CyberChef build",
51
- ["exec:setupNodeConsumers", "exec:testCJSNodeConsumer", "exec:testESMNodeConsumer", "exec:testESMDeepImportNodeConsumer", "exec:teardownNodeConsumers"]);
53
+ ["exec:setupNodeConsumers", "exec:testCJSNodeConsumer", "exec:testESMNodeConsumer", "exec:teardownNodeConsumers"]);
52
54
 
53
55
  grunt.registerTask("default",
54
56
  "Lints the code base",
@@ -187,9 +189,6 @@ module.exports = function (grunt) {
187
189
  standalone: ["build/prod/CyberChef*.html"]
188
190
  },
189
191
  eslint: {
190
- options: {
191
- configFile: "./.eslintrc.json"
192
- },
193
192
  configs: ["*.{js,mjs}"],
194
193
  core: ["src/core/**/*.{js,mjs}", "!src/core/vendor/**/*", "!src/core/operations/legacy/**/*"],
195
194
  web: ["src/web/**/*.{js,mjs}", "!src/web/static/**/*"],
@@ -349,15 +348,15 @@ module.exports = function (grunt) {
349
348
  command: "git gc --prune=now --aggressive"
350
349
  },
351
350
  sitemap: {
352
- command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml",
351
+ command: `node ${nodeFlags} src/web/static/sitemap.mjs > build/prod/sitemap.xml`,
353
352
  sync: true
354
353
  },
355
354
  generateConfig: {
356
355
  command: chainCommands([
357
356
  "echo '\n--- Regenerating config files. ---'",
358
357
  "echo [] > src/core/config/OperationConfig.json",
359
- "node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs",
360
- "node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs",
358
+ `node ${nodeFlags} src/core/config/scripts/generateOpsIndex.mjs`,
359
+ `node ${nodeFlags} src/core/config/scripts/generateConfig.mjs`,
361
360
  "echo '--- Config scripts finished. ---\n'"
362
361
  ]),
363
362
  sync: true
@@ -365,7 +364,7 @@ module.exports = function (grunt) {
365
364
  generateNodeIndex: {
366
365
  command: chainCommands([
367
366
  "echo '\n--- Regenerating node index ---'",
368
- "node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs",
367
+ `node ${nodeFlags} src/node/config/scripts/generateNodeIndex.mjs`,
369
368
  "echo '--- Node index generated. ---\n'"
370
369
  ]),
371
370
  sync: true
@@ -393,21 +392,14 @@ module.exports = function (grunt) {
393
392
  testCJSNodeConsumer: {
394
393
  command: chainCommands([
395
394
  `cd ${nodeConsumerTestPath}`,
396
- "node --no-warnings cjs-consumer.js",
395
+ `node ${nodeFlags} cjs-consumer.js`,
397
396
  ]),
398
397
  stdout: false,
399
398
  },
400
399
  testESMNodeConsumer: {
401
400
  command: chainCommands([
402
401
  `cd ${nodeConsumerTestPath}`,
403
- "node --no-warnings --experimental-modules esm-consumer.mjs",
404
- ]),
405
- stdout: false,
406
- },
407
- testESMDeepImportNodeConsumer: {
408
- command: chainCommands([
409
- `cd ${nodeConsumerTestPath}`,
410
- "node --no-warnings --experimental-modules esm-deep-import-consumer.mjs",
402
+ `node ${nodeFlags} esm-consumer.mjs`,
411
403
  ]),
412
404
  stdout: false,
413
405
  },
package/babel.config.js CHANGED
@@ -11,6 +11,7 @@ module.exports = function(api) {
11
11
  ],
12
12
  "plugins": [
13
13
  "dynamic-import-node",
14
+ "@babel/plugin-syntax-import-assertions",
14
15
  [
15
16
  "babel-plugin-transform-builtin-extend", {
16
17
  "globals": ["Error"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.32.3",
3
+ "version": "9.33.0",
4
4
  "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
5
5
  "author": "n1474335 <n1474335@gmail.com>",
6
6
  "homepage": "https://gchq.github.io/CyberChef",
@@ -27,28 +27,34 @@
27
27
  "type": "git",
28
28
  "url": "https://github.com/gchq/CyberChef/"
29
29
  },
30
- "main": "src/node/cjs.js",
31
- "module": "src/node/index.mjs",
30
+ "main": "src/node/wrapper.js",
31
+ "exports": {
32
+ "import": "./src/node/index.mjs",
33
+ "require": "./src/node/wrapper.js"
34
+ },
32
35
  "bugs": "https://github.com/gchq/CyberChef/issues",
33
36
  "browserslist": [
34
37
  "Chrome >= 50",
35
38
  "Firefox >= 38",
36
- "node >= 10"
39
+ "node >= 16"
37
40
  ],
38
41
  "devDependencies": {
39
- "@babel/core": "^7.15.0",
40
- "@babel/plugin-transform-runtime": "^7.15.0",
41
- "@babel/preset-env": "^7.15.0",
42
+ "@babel/core": "^7.17.8",
43
+ "@babel/eslint-parser": "^7.17.0",
44
+ "@babel/plugin-syntax-import-assertions": "^7.16.7",
45
+ "@babel/plugin-transform-runtime": "^7.17.0",
46
+ "@babel/preset-env": "^7.16.11",
47
+ "@babel/runtime": "^7.17.8",
42
48
  "autoprefixer": "^10.3.1",
43
- "babel-eslint": "^10.1.0",
44
- "babel-loader": "^8.2.2",
49
+ "babel-loader": "^8.2.4",
45
50
  "babel-plugin-dynamic-import-node": "^2.3.3",
46
- "chromedriver": "^92.0.1",
51
+ "chromedriver": "^99.0.0",
47
52
  "cli-progress": "^3.9.0",
48
53
  "colors": "^1.4.0",
49
54
  "copy-webpack-plugin": "^9.0.1",
55
+ "core-js": "^3.21.1",
50
56
  "css-loader": "5.2.7",
51
- "eslint": "^7.32.0",
57
+ "eslint": "^8.11.0",
52
58
  "exports-loader": "^3.0.0",
53
59
  "file-loader": "^6.2.0",
54
60
  "grunt": "^1.4.1",
@@ -58,7 +64,7 @@
58
64
  "grunt-contrib-connect": "^3.0.0",
59
65
  "grunt-contrib-copy": "~1.0.0",
60
66
  "grunt-contrib-watch": "^1.1.0",
61
- "grunt-eslint": "^23.0.0",
67
+ "grunt-eslint": "^24.0.0",
62
68
  "grunt-exec": "~3.0.0",
63
69
  "grunt-webpack": "^4.0.3",
64
70
  "grunt-zip": "^0.18.2",
@@ -66,7 +72,6 @@
66
72
  "imports-loader": "^3.0.0",
67
73
  "mini-css-extract-plugin": "1.3.7",
68
74
  "nightwatch": "^1.7.8",
69
- "node-sass": "^5.0.0",
70
75
  "postcss": "^8.3.6",
71
76
  "postcss-css-variables": "^0.18.0",
72
77
  "postcss-import": "^14.0.2",
@@ -77,7 +82,7 @@
77
82
  "style-loader": "^3.2.1",
78
83
  "svg-url-loader": "^7.1.1",
79
84
  "url-loader": "^4.1.1",
80
- "webpack": "^5.51.0",
85
+ "webpack": "^5.70.0",
81
86
  "webpack-bundle-analyzer": "^4.4.2",
82
87
  "webpack-dev-server": "3.11.2",
83
88
  "webpack-node-externals": "^3.0.0",
@@ -85,7 +90,6 @@
85
90
  },
86
91
  "dependencies": {
87
92
  "@babel/polyfill": "^7.12.1",
88
- "@babel/runtime": "^7.15.3",
89
93
  "arrive": "^2.4.1",
90
94
  "avsc": "^5.7.3",
91
95
  "babel-plugin-transform-builtin-extend": "1.1.2",
@@ -101,7 +105,6 @@
101
105
  "cbor": "5.0.1",
102
106
  "chi-squared": "^1.1.0",
103
107
  "codepage": "^1.15.0",
104
- "core-js": "^3.16.2",
105
108
  "crypto-api": "^0.8.5",
106
109
  "crypto-browserify": "^3.12.0",
107
110
  "crypto-js": "^4.1.1",
@@ -111,7 +114,6 @@
111
114
  "diff": "^5.0.0",
112
115
  "es6-promisify": "^7.0.0",
113
116
  "escodegen": "^2.0.0",
114
- "esm": "^3.2.25",
115
117
  "esprima": "^4.0.1",
116
118
  "exif-parser": "^0.1.12",
117
119
  "file-saver": "^2.0.5",
@@ -133,12 +135,13 @@
133
135
  "lodash": "^4.17.21",
134
136
  "loglevel": "^1.7.1",
135
137
  "loglevel-message-prefix": "^3.0.0",
136
- "markdown-it": "^12.2.0",
138
+ "markdown-it": "^12.3.2",
137
139
  "moment": "^2.29.1",
138
140
  "moment-timezone": "^0.5.33",
139
141
  "ngeohash": "^0.6.3",
140
142
  "node-forge": "^0.10.0",
141
143
  "node-md6": "^0.1.0",
144
+ "node-sass": "^7.0.1",
142
145
  "nodom": "^2.4.0",
143
146
  "notepack.io": "^2.3.0",
144
147
  "nwmatcher": "^1.4.4",
@@ -168,14 +171,14 @@
168
171
  "scripts": {
169
172
  "start": "npx grunt dev",
170
173
  "build": "npx grunt prod",
171
- "repl": "node src/node/repl.js",
172
- "test": "npx grunt configTests && node --experimental-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs",
174
+ "repl": "node --experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings src/node/repl.mjs",
175
+ "test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation tests/operations/index.mjs",
173
176
  "test-node-consumer": "npx grunt testnodeconsumer",
174
177
  "testui": "npx grunt testui",
175
178
  "testuidev": "npx nightwatch --env=dev",
176
179
  "lint": "npx grunt lint",
177
180
  "postinstall": "npx grunt exec:fixCryptoApiImports",
178
- "newop": "node --experimental-modules src/core/config/scripts/newOperation.mjs",
181
+ "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
179
182
  "getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",
180
183
  "setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048"
181
184
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import Chef from "./Chef.mjs";
10
- import OperationConfig from "./config/OperationConfig.json";
10
+ import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
11
11
  import OpModules from "./config/modules/OpModules.mjs";
12
12
 
13
13
  // Add ">" to the start of all log messages in the Chef Worker
@@ -4,7 +4,7 @@
4
4
  * @license Apache-2.0
5
5
  */
6
6
 
7
- import OperationConfig from "./config/OperationConfig.json";
7
+ import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
8
8
  import OperationError from "./errors/OperationError.mjs";
9
9
  import Operation from "./Operation.mjs";
10
10
  import DishError from "./errors/DishError.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import Bombe from "../../operations/Bombe.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import Entropy from "../../operations/Entropy.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import A1Z26CipherDecode from "../../operations/A1Z26CipherDecode.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import CSSBeautify from "../../operations/CSSBeautify.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import Bzip2Compress from "../../operations/Bzip2Compress.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import Adler32Checksum from "../../operations/Adler32Checksum.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import ADD from "../../operations/ADD.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import Diff from "../../operations/Diff.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import CitrixCTX1Decode from "../../operations/CitrixCTX1Decode.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import BLAKE2b from "../../operations/BLAKE2b.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import AddTextToImage from "../../operations/AddTextToImage.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import OpticalCharacterRecognition from "../../operations/OpticalCharacterRecognition.mjs";
@@ -4,7 +4,7 @@
4
4
  * Imports all modules for builds which do not load modules separately.
5
5
  *
6
6
  * @author n1474335 [n1474335@gmail.com]
7
- * @copyright Crown Copyright 2021
7
+ * @copyright Crown Copyright 2022
8
8
  * @license Apache-2.0
9
9
  */
10
10
  import CiphersModule from "./Ciphers.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import GeneratePGPKeyPair from "../../operations/GeneratePGPKeyPair.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import ProtobufDecode from "../../operations/ProtobufDecode.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import HexToObjectIdentifier from "../../operations/HexToObjectIdentifier.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import ExtractDates from "../../operations/ExtractDates.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import AvroToJSON from "../../operations/AvroToJSON.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import DisassembleX86 from "../../operations/DisassembleX86.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import ParseURI from "../../operations/ParseURI.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import ParseUserAgent from "../../operations/ParseUserAgent.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import YARARules from "../../operations/YARARules.mjs";
@@ -1,6 +1,6 @@
1
1
  import OperationError from "./OperationError.mjs";
2
2
  import DishError from "./DishError.mjs";
3
- import ExcludedOperationError from "./ExcludedOperationError";
3
+ import ExcludedOperationError from "./ExcludedOperationError.mjs";
4
4
 
5
5
  export {
6
6
  OperationError,
@@ -1,4 +1,4 @@
1
- import OperationConfig from "../config/OperationConfig.json";
1
+ import OperationConfig from "../config/OperationConfig.json" assert {type: "json"};
2
2
  import Utils, { isWorkerEnvironment } from "../Utils.mjs";
3
3
  import Recipe from "../Recipe.mjs";
4
4
  import Dish from "../Dish.mjs";
@@ -2,7 +2,7 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateOpsIndex.mjs
3
3
  *
4
4
  * @author n1474335 [n1474335@gmail.com]
5
- * @copyright Crown Copyright 2021
5
+ * @copyright Crown Copyright 2022
6
6
  * @license Apache-2.0
7
7
  */
8
8
  import A1Z26CipherDecode from "./A1Z26CipherDecode.mjs";
package/src/node/api.mjs CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  import NodeDish from "./NodeDish.mjs";
12
12
  import NodeRecipe from "./NodeRecipe.mjs";
13
- import OperationConfig from "../core/config/OperationConfig.json";
13
+ import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
14
14
  import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils.mjs";
15
15
  import ExcludedOperationError from "../core/errors/ExcludedOperationError.mjs";
16
16
 
@@ -41,7 +41,7 @@ let code = `/**
41
41
  import NodeDish from "./NodeDish.mjs";
42
42
  import { _wrap, help, bake, _explainExcludedFunction } from "./api.mjs";
43
43
  import File from "./File.mjs";
44
- import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index";
44
+ import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index.mjs";
45
45
  import {
46
46
  // import as core_ to avoid name clashes after wrap.
47
47
  `;
@@ -52,7 +52,7 @@ includedOperations.forEach((op) => {
52
52
  });
53
53
 
54
54
  code +=`
55
- } from "../core/operations/index";
55
+ } from "../core/operations/index.mjs";
56
56
 
57
57
  global.File = File;
58
58
 
@@ -12,7 +12,7 @@
12
12
  import NodeDish from "./NodeDish.mjs";
13
13
  import { _wrap, help, bake, _explainExcludedFunction } from "./api.mjs";
14
14
  import File from "./File.mjs";
15
- import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index";
15
+ import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index.mjs";
16
16
  import {
17
17
  // import as core_ to avoid name clashes after wrap.
18
18
  A1Z26CipherDecode as core_A1Z26CipherDecode,
@@ -370,7 +370,7 @@ import {
370
370
  ZlibDeflate as core_ZlibDeflate,
371
371
  ZlibInflate as core_ZlibInflate,
372
372
 
373
- } from "../core/operations/index";
373
+ } from "../core/operations/index.mjs";
374
374
 
375
375
  global.File = File;
376
376
 
@@ -7,8 +7,8 @@
7
7
  * @license Apache-2.0
8
8
  */
9
9
 
10
- const chef = require("./cjs.js");
11
- const repl = require("repl");
10
+ import chef from "./index.mjs";
11
+ import repl from "repl";
12
12
 
13
13
 
14
14
  /* eslint no-console: ["off"] */
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Export the main ESM module as CommonJS
3
+ *
4
+ *
5
+ * @author d98762656 [d98762625@gmail.com]
6
+ * @copyright Crown Copyright 2019
7
+ * @license Apache-2.0
8
+ */
9
+
10
+ module.exports = (async () => await import("./index.mjs"))();
11
+ module.exports.File = (async () => await import("./File.mjs"))();
package/src/web/index.js CHANGED
@@ -17,8 +17,8 @@ import * as CanvasComponents from "../core/lib/CanvasComponents.mjs";
17
17
 
18
18
  // CyberChef
19
19
  import App from "./App.mjs";
20
- import Categories from "../core/config/Categories.json";
21
- import OperationConfig from "../core/config/OperationConfig.json";
20
+ import Categories from "../core/config/Categories.json" assert {type: "json"};
21
+ import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"};
22
22
 
23
23
 
24
24
  /**
@@ -1,5 +1,5 @@
1
1
  import sm from "sitemap";
2
- import OperationConfig from "../../core/config/OperationConfig.json";
2
+ import OperationConfig from "../../core/config/OperationConfig.json" assert {type: "json"};
3
3
 
4
4
 
5
5
  /**
@@ -6,24 +6,27 @@
6
6
  * @license Apache-2.0
7
7
  */
8
8
 
9
- const chef = require("cyberchef");
10
9
  const assert = require("assert");
11
10
 
12
- const d = chef.bake("Testing, 1 2 3", [
13
- chef.toHex,
14
- chef.reverse,
15
- {
16
- op: chef.unique,
17
- args: {
18
- delimiter: "Space",
19
- }
20
- },
21
- {
22
- op: chef.multiply,
23
- args: {
24
- delimiter: "Space",
11
+ require("cyberchef").then(chef => {
12
+
13
+ const d = chef.bake("Testing, 1 2 3", [
14
+ chef.toHex,
15
+ chef.reverse,
16
+ {
17
+ op: chef.unique,
18
+ args: {
19
+ delimiter: "Space",
20
+ }
21
+ },
22
+ {
23
+ op: chef.multiply,
24
+ args: {
25
+ delimiter: "Space",
26
+ }
25
27
  }
26
- }
27
- ]);
28
+ ]);
29
+
30
+ assert.equal(d.value, "630957449041920");
28
31
 
29
- assert.equal(d.value, "630957449041920");
32
+ });
@@ -7,8 +7,28 @@
7
7
  */
8
8
  import assert from "assert";
9
9
  import chef from "cyberchef";
10
+ import { bake, toHex, reverse, unique, multiply } from "cyberchef";
10
11
 
11
- const d = chef.bake("Testing, 1 2 3", [
12
+ const a = bake("Testing, 1 2 3", [
13
+ toHex,
14
+ reverse,
15
+ {
16
+ op: unique,
17
+ args: {
18
+ delimiter: "Space",
19
+ }
20
+ },
21
+ {
22
+ op: multiply,
23
+ args: {
24
+ delimiter: "Space",
25
+ }
26
+ }
27
+ ]);
28
+
29
+ assert.equal(a.value, "630957449041920");
30
+
31
+ const b = chef.bake("Testing, 1 2 3", [
12
32
  chef.toHex,
13
33
  chef.reverse,
14
34
  {
@@ -25,4 +45,4 @@ const d = chef.bake("Testing, 1 2 3", [
25
45
  }
26
46
  ]);
27
47
 
28
- assert.equal(d.value, "630957449041920");
48
+ assert.equal(b.value, "630957449041920");
@@ -1,6 +1,6 @@
1
1
  import TestRegister from "../../lib/TestRegister.mjs";
2
- import Categories from "../../../src/core/config/Categories.json";
3
- import OperationConfig from "../../../src/core/config/OperationConfig.json";
2
+ import Categories from "../../../src/core/config/Categories.json" assert {type: "json"};
3
+ import OperationConfig from "../../../src/core/config/OperationConfig.json" assert {type: "json"};
4
4
  import it from "../assertionHandler.mjs";
5
5
  import assert from "assert";
6
6
 
@@ -32,7 +32,7 @@ import {
32
32
  CSSMinify,
33
33
  toBase64,
34
34
  toHex
35
- } from "../../../src/node/index";
35
+ } from "../../../src/node/index.mjs";
36
36
  import chef from "../../../src/node/index.mjs";
37
37
  import TestRegister from "../../lib/TestRegister.mjs";
38
38
  import File from "../../../src/node/File.mjs";
@@ -6,7 +6,7 @@
6
6
  * @license Apache-2.0
7
7
  */
8
8
 
9
- import TestRegister from "../../lib/TestRegister";
9
+ import TestRegister from "../../lib/TestRegister.mjs";
10
10
 
11
11
  TestRegister.addTests([
12
12
  {
@@ -5,8 +5,8 @@
5
5
  * @copyright Karsten Silkenbäumer 2019
6
6
  * @license Apache-2.0
7
7
  */
8
- import TestRegister from "../../lib/TestRegister";
9
- import { BACON_ALPHABETS, BACON_TRANSLATIONS } from "../../../src/core/lib/Bacon";
8
+ import TestRegister from "../../lib/TestRegister.mjs";
9
+ import { BACON_ALPHABETS, BACON_TRANSLATIONS } from "../../../src/core/lib/Bacon.mjs";
10
10
 
11
11
  const alphabets = Object.keys(BACON_ALPHABETS);
12
12
  const translations = BACON_TRANSLATIONS;
package/src/node/cjs.js DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * Export the main ESM module as CommonJS
3
- *
4
- *
5
- * @author d98762656 [d98762625@gmail.com]
6
- * @copyright Crown Copyright 2019
7
- * @license Apache-2.0
8
- */
9
-
10
- /* eslint no-global-assign: ["off"] */
11
- require = require("esm")(module);
12
- module.exports = require("./index.mjs");
13
- module.exports.File = require("./File.mjs");
@@ -1,28 +0,0 @@
1
- /**
2
- * Tests to ensure that a consuming app can use named imports from deep import patch
3
- *
4
- * @author d98762625 [d98762625@gmail.com]
5
- * @copyright Crown Copyright 2019
6
- * @license Apache-2.0
7
- */
8
- import assert from "assert";
9
- import { bake, toHex, reverse, unique, multiply } from "cyberchef/src/node/index.mjs";
10
-
11
- const d = bake("Testing, 1 2 3", [
12
- toHex,
13
- reverse,
14
- {
15
- op: unique,
16
- args: {
17
- delimiter: "Space",
18
- }
19
- },
20
- {
21
- op: multiply,
22
- args: {
23
- delimiter: "Space",
24
- }
25
- }
26
- ]);
27
-
28
- assert.equal(d.value, "630957449041920");