state-machine-cat 9.2.3 → 10.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-machine-cat",
3
- "version": "9.2.3",
3
+ "version": "10.0.0",
4
4
  "description": "write beautiful state charts",
5
5
  "main": "./dist/commonjs/index.js",
6
6
  "module": "./src/index.mjs",
@@ -23,35 +23,31 @@
23
23
  "scripts": {
24
24
  "build": "make clean dist pages",
25
25
  "build:cli": "make cli-build",
26
- "check": "run-p --aggregate-output depcruise lint test:cover",
27
- "depcruise": "depcruise --output-type err-long --config config/dependency-cruiser.js src test bin",
28
- "depcruise:graph": "run-p depcruise:graph:doc:*",
29
- "depcruise:graph:doc:archi-html": "depcruise --progress none --output-type archi --config config/dependency-cruiser-graph.js src bin | dot -Tsvg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-archi-graph.html",
30
- "depcruise:graph:doc:archi-svg": "depcruise --progress none --output-type archi --config config/dependency-cruiser-graph.js src bin | dot -Tsvg > docs/dependency-cruiser-archi-graph.svg",
31
- "depcruise:graph:doc:dir-html": "depcruise --progress none --output-type ddot --config config/dependency-cruiser-graph.js src bin | dot -Tsvg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-dir-graph.html",
32
- "depcruise:graph:doc:dir-svg": "depcruise --progress none --output-type ddot --config config/dependency-cruiser-graph.js src bin | dot -Tsvg > docs/dependency-cruiser-dir-graph.svg",
33
- "depcruise:graph:doc:deps-html": "depcruise --progress none --output-type dot --config config/dependency-cruiser-graph.js src bin | dot -Tsvg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-graph.html",
34
- "depcruise:graph:doc:deps-svg": "depcruise --progress none --output-type dot --config config/dependency-cruiser-graph.js src bin | dot -Tsvg > docs/dependency-cruiser-graph.svg",
35
- "depcruise:graph:doc:flat-dot-html": "depcruise --progress none --output-type flat --config config/dependency-cruiser-graph.js src bin | dot -Tsvg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-graph-flat-dot.html",
36
- "depcruise:graph:doc:flat-dot-svg": "depcruise --progress none --output-type flat --config config/dependency-cruiser-graph.js src bin | dot -Tsvg > docs/dependency-cruiser-graph-flat-dot.svg",
37
- "depcruise:graph:doc:flat-circo-html": "depcruise --progress none --output-type flat --config config/dependency-cruiser-graph.js src bin | circo -Tsvg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-graph-flat-circo.html",
38
- "depcruise:graph:doc:flat-circo-svg": "depcruise --progress none --output-type flat --config config/dependency-cruiser-graph.js src bin | circo -Tsvg > docs/dependency-cruiser-graph-flat-circo.svg",
39
- "depcruise:graph:doc:flat-twopi-html": "depcruise --progress none --output-type flat --config config/dependency-cruiser-graph.js src bin | twopi -Tsvg | depcruise-wrap-stream-in-html > docs/dependency-cruiser-graph-flat-twopi.html",
40
- "depcruise:graph:doc:flat-twopi-svg": "depcruise --progress none --output-type flat --config config/dependency-cruiser-graph.js src bin | twopi -Tsvg > docs/dependency-cruiser-graph-flat-twopi.svg",
41
- "depcruise:html-report": "depcruise --output-type err-html --config config/dependency-cruiser.js src test bin --output-to dependency-violation-report.html",
42
- "depcruise:graph:dev": "depcruise --output-type dot --config config/dependency-cruiser-graph.js --prefix vscode://file/$(pwd)/ src bin | dot -Tsvg | depcruise-wrap-stream-in-html | browser",
43
- "depcruise:graph:dev:flat": "depcruise --output-type flat --config config/dependency-cruiser-graph.js --prefix vscode://file/$(pwd)/ src bin | twopi -Tsvg | depcruise-wrap-stream-in-html | browser",
44
- "depcruise:view-report": "depcruise --output-type err-html --config config/dependency-cruiser.js --prefix vscode://file/$(pwd)/ src test bin | browser",
45
- "lint": "run-p --aggregate-output lint:eslint lint:prettier lint:types",
46
- "lint:eslint": "eslint --cache --cache-location .cache src test config",
47
- "lint:prettier": "prettier --check \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"types/*.ts\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
48
- "lint:types": "run-s lint:types:*",
49
- "lint:types:tsc": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters types/state-machine-cat.d.ts",
50
- "lint:types:eslint": "eslint types/*.d.ts",
51
- "lint:fix": "run-s lint:fix:eslint lint:fix:prettier lint:fix:types",
52
- "lint:fix:eslint": "eslint --cache --cache-location .cache --fix src test config",
53
- "lint:fix:prettier": "prettier --loglevel warn --write \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"types/*.ts\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
54
- "lint:fix:types": "eslint --fix types",
26
+ "check": "wireit",
27
+ "cachefolder": "wireit",
28
+ "depcruise": "wireit",
29
+ "depcruise:json": "wireit",
30
+ "depcruise:graph": "wireit",
31
+ "depcruise:graph:doc:archi-html": "wireit",
32
+ "depcruise:graph:doc:archi-svg": "wireit",
33
+ "depcruise:graph:doc:deps-html": "wireit",
34
+ "depcruise:graph:doc:deps-svg": "wireit",
35
+ "depcruise:graph:doc:flat-deps-html": "wireit",
36
+ "depcruise:graph:doc:flat-deps-svg": "wireit",
37
+ "depcruise:html-report": "wireit",
38
+ "depcruise:graph:dev": "wireit",
39
+ "depcruise:graph:dev:flat": "wireit",
40
+ "depcruise:view-report": "wireit",
41
+ "lint": "wireit",
42
+ "lint:eslint": "wireit",
43
+ "lint:prettier": "wireit",
44
+ "lint:types": "wireit",
45
+ "lint:types:tsc": "wireit",
46
+ "lint:types:eslint": "wireit",
47
+ "lint:fix": "wireit",
48
+ "lint:fix:eslint": "wireit",
49
+ "lint:fix:prettier": "wireit",
50
+ "lint:fix:types": "wireit",
55
51
  "scm:push": "run-p --aggregate-output scm:push:*",
56
52
  "scm:push:github": "run-p --aggregate-output scm:push:github:*",
57
53
  "scm:push:github:commits": "git push",
@@ -63,10 +59,8 @@
63
59
  "scm:push:bitbucket-mirror:commits": "git push bitbucket-mirror",
64
60
  "scm:push:bitbucket-mirror:tags": "git push --tags bitbucket-mirror",
65
61
  "scm:stage": "git add .",
66
- "test": "mocha --reporter spec --full-trace --timeout 4000 --recursive test",
67
- "test:unit": "mocha --reporter spec --timeout 4000 --recursive test --invert --fgrep integration",
68
- "test:integration": "mocha --reporter spec --timeout 4000 --recursive test --invert --fgrep integration",
69
- "test:cover": "c8 --all --check-coverage --statements 100 --branches 99.1 --functions 100 --lines 100 --exclude \"{bin/*,config/**/*,coverage/**/*,docs/**/*,public/**/*,test/**/*,tools/**/*,types/**/*,dist/commonjs/*,src/**/*{template,-parser}.{mjs,cjs,js},tmp*}\" --reporter text-summary --reporter html --reporter lcov npm test",
62
+ "test": "wireit",
63
+ "test:cover": "wireit",
70
64
  "update-dependencies": "run-s upem:update upem:install lint:fix check",
71
65
  "upem:install": "npm install",
72
66
  "upem:update": "npm outdated --json | upem",
@@ -86,14 +80,9 @@
86
80
  "upem": {
87
81
  "policies": [
88
82
  {
89
- "package": "eslint",
90
- "policy": "wanted",
91
- "because": "some plugins are not compatible with eslint 8 yet"
92
- },
93
- {
94
- "package": "eslint-plugin-unicorn",
95
- "policy": "wanted",
96
- "because": ">=41 aren't compatible with eslint 7 anymore"
83
+ "package": "eslint-plugin-mocha",
84
+ "policy": "pin",
85
+ "because": "https://github.com/lo1tuma/eslint-plugin-mocha/issues/322"
97
86
  },
98
87
  {
99
88
  "package": "fast-xml-parser",
@@ -112,6 +101,261 @@
112
101
  }
113
102
  ]
114
103
  },
104
+ "wireit": {
105
+ "check": {
106
+ "dependencies": [
107
+ "depcruise",
108
+ "lint",
109
+ "test:cover"
110
+ ]
111
+ },
112
+ "cachefolder": {
113
+ "command": "mkdir -p node_modules/.cache",
114
+ "clean": false,
115
+ "files": [],
116
+ "output": [
117
+ "node_modules/.cache"
118
+ ],
119
+ "packageLocks": []
120
+ },
121
+ "depcruise:json": {
122
+ "command": "dependency-cruise --progress none --output-type json --output-to node_modules/.cache/depcruise-cache.json --config config/dependency-cruiser.js src test bin",
123
+ "files": [
124
+ "src/**/*",
125
+ "test/**/*",
126
+ "bin/**/*",
127
+ "config/dependency-cruiser.js"
128
+ ],
129
+ "dependencies": [
130
+ "cachefolder"
131
+ ],
132
+ "clean": true,
133
+ "output": [
134
+ "node_modules/.cache/depcruise-cache.json"
135
+ ]
136
+ },
137
+ "depcruise": {
138
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type err-long",
139
+ "files": [
140
+ "node_modules/.cache/depcruise-cache.json"
141
+ ],
142
+ "dependencies": [
143
+ "depcruise:json"
144
+ ],
145
+ "output": []
146
+ },
147
+ "depcruise:html-report": {
148
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type err-html --output-to dependency-violation-report.html",
149
+ "files": [
150
+ "node_modules/.cache/depcruise-cache.json"
151
+ ],
152
+ "dependencies": [
153
+ "depcruise:json"
154
+ ],
155
+ "clean": false,
156
+ "output": [
157
+ "dependency-violation-report.html"
158
+ ]
159
+ },
160
+ "depcruise:graph:doc:deps-svg": {
161
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --include-only '^(bin|src|package\\.json)' --output-type dot | dot -T svg -o docs/dependency-cruiser-graph.svg",
162
+ "files": [
163
+ "node_modules/.cache/depcruise-cache.json"
164
+ ],
165
+ "dependencies": [
166
+ "depcruise:json"
167
+ ],
168
+ "clean": false,
169
+ "output": [
170
+ "docs/dependency-cruiser-graph.svg"
171
+ ]
172
+ },
173
+ "depcruise:graph:doc:deps-html": {
174
+ "command": "depcruise-wrap-stream-in-html < docs/dependency-cruiser-graph.svg > docs/dependency-cruiser-graph.html",
175
+ "files": [
176
+ "node_modules/.cache/depcruise-cache.json"
177
+ ],
178
+ "dependencies": [
179
+ "depcruise:graph:doc:deps-svg"
180
+ ],
181
+ "clean": false,
182
+ "output": [
183
+ "docs/dependency-cruiser-graph.html"
184
+ ]
185
+ },
186
+ "depcruise:graph:doc:flat-deps-svg": {
187
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --include-only '^(bin|src|package\\.json)' --output-type flat | dot -T svg -o docs/dependency-cruiser-graph-flat-dot.svg",
188
+ "files": [
189
+ "node_modules/.cache/depcruise-cache.json"
190
+ ],
191
+ "dependencies": [
192
+ "depcruise:json"
193
+ ],
194
+ "clean": false,
195
+ "output": [
196
+ "docs/dependency-cruiser-graph-flat-dot.svg"
197
+ ]
198
+ },
199
+ "depcruise:graph:doc:flat-deps-html": {
200
+ "command": "depcruise-wrap-stream-in-html < docs/dependency-cruiser-graph-flat-dot.svg > docs/dependency-cruiser-graph-flat-dot.html",
201
+ "files": [
202
+ "node_modules/.cache/depcruise-cache.json"
203
+ ],
204
+ "dependencies": [
205
+ "depcruise:graph:doc:flat-deps-svg"
206
+ ],
207
+ "clean": false,
208
+ "output": [
209
+ "docs/dependency-cruiser-graph-flat-dot.html"
210
+ ]
211
+ },
212
+ "depcruise:graph:doc:archi-svg": {
213
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --include-only '^(bin|src|package\\.json)' --output-type archi | dot -T svg -o docs/dependency-cruiser-archi-graph.svg",
214
+ "files": [
215
+ "node_modules/.cache/depcruise-cache.json"
216
+ ],
217
+ "dependencies": [
218
+ "depcruise:json"
219
+ ],
220
+ "clean": false,
221
+ "output": [
222
+ "docs/dependency-cruiser-archi-graph.svg"
223
+ ]
224
+ },
225
+ "depcruise:graph:doc:archi-html": {
226
+ "command": "depcruise-wrap-stream-in-html < docs/dependency-cruiser-archi-graph.svg > docs/dependency-cruiser-archi-graph.html",
227
+ "files": [
228
+ "node_modules/.cache/depcruise-cache.json"
229
+ ],
230
+ "dependencies": [
231
+ "depcruise:graph:doc:archi-svg"
232
+ ],
233
+ "clean": false,
234
+ "output": [
235
+ "docs/dependency-cruiser-archi-graph.html"
236
+ ]
237
+ },
238
+ "depcruise:graph": {
239
+ "dependencies": [
240
+ "depcruise:graph:doc:archi-html",
241
+ "depcruise:graph:doc:deps-html",
242
+ "depcruise:graph:doc:flat-deps-html"
243
+ ]
244
+ },
245
+ "depcruise:graph:dev": {
246
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type dot --include-only '^(bin|src|package\\.json)' --prefix vscode://file/$(pwd)/ | dot -Tsvg | depcruise-wrap-stream-in-html | browser",
247
+ "dependencies": [
248
+ "depcruise:json"
249
+ ]
250
+ },
251
+ "depcruise:graph:dev:flat": {
252
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type flat --include-only '^(bin|src|package\\.json)' --prefix vscode://file/$(pwd)/ | twopi -Tsvg | depcruise-wrap-stream-in-html | browser",
253
+ "dependencies": [
254
+ "depcruise:json"
255
+ ]
256
+ },
257
+ "depcruise:view-report": {
258
+ "command": "depcruise-fmt node_modules/.cache/depcruise-cache.json --output-type err-html --prefix vscode://file/$(pwd)/ | browser",
259
+ "dependencies": [
260
+ "depcruise:json"
261
+ ]
262
+ },
263
+ "lint": {
264
+ "dependencies": [
265
+ "lint:eslint",
266
+ "lint:prettier",
267
+ "lint:types"
268
+ ]
269
+ },
270
+ "lint:eslint": {
271
+ "command": "eslint --cache --cache-location .cache --color src test config",
272
+ "files": [
273
+ "{src,test}/**/*.{js,mjs}",
274
+ "config/**/*.{js,json}",
275
+ ".eslintrc.json"
276
+ ]
277
+ },
278
+ "lint:prettier": {
279
+ "command": "prettier --check \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"types/*.ts\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
280
+ "files": [
281
+ "bin/*.mjs",
282
+ "{src,test}/**/*.{js,mjs}",
283
+ "{config,test}/**/*.{js,json}",
284
+ "tools/*.{js,mjs,json}",
285
+ "types/*.ts",
286
+ "*.{json,yml,md}",
287
+ "docs/{smcat-online-interpreter.js,*.md}"
288
+ ]
289
+ },
290
+ "lint:types": {
291
+ "dependencies": [
292
+ "lint:types:tsc",
293
+ "lint:types:eslint"
294
+ ]
295
+ },
296
+ "lint:types:tsc": {
297
+ "command": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters --pretty types/*.d.ts",
298
+ "files": [
299
+ "types/*.d.ts"
300
+ ]
301
+ },
302
+ "lint:types:eslint": {
303
+ "command": "eslint types/*.d.ts",
304
+ "files": [
305
+ "types/*.d.ts",
306
+ ".eslintrc.json"
307
+ ]
308
+ },
309
+ "lint:fix": {
310
+ "dependencies": [
311
+ "lint:fix:eslint",
312
+ "lint:fix:prettier",
313
+ "lint:fix:types"
314
+ ]
315
+ },
316
+ "lint:fix:eslint": {
317
+ "command": "eslint --cache --cache-location .cache --fix --color src test config",
318
+ "files": [
319
+ "{src,test}/**/*.{js,mjs}",
320
+ "config/**/*.{js,json}",
321
+ ".eslintrc.json"
322
+ ]
323
+ },
324
+ "lint:fix:prettier": {
325
+ "command": "prettier --loglevel warn --write \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"types/*.ts\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
326
+ "files": [
327
+ "bin/*.mjs",
328
+ "{src,test}/**/*.{js,mjs}",
329
+ "{config,test}/**/*.{js,json}",
330
+ "tools/*.{js,mjs,json}",
331
+ "types/*.ts",
332
+ "*.{json,yml,md}",
333
+ "docs/{smcat-online-interpreter.js,*.md}"
334
+ ]
335
+ },
336
+ "lint:fix:types": {
337
+ "command": "eslint --fix types/*.d.ts",
338
+ "files": [
339
+ "types/*.d.ts",
340
+ ".eslintrc.json"
341
+ ]
342
+ },
343
+ "test": {
344
+ "command": "mocha --reporter spec --full-trace --timeout 4000 --recursive test",
345
+ "files": [
346
+ "{src,test}/**/*.{js,mjs,json}"
347
+ ]
348
+ },
349
+ "test:cover": {
350
+ "command": "c8 --all --check-coverage --statements 100 --branches 99.1 --functions 100 --lines 100 --exclude \"{bin/*,config/**/*,coverage/**/*,docs/**/*,public/**/*,test/**/*,tools/**/*,types/**/*,dist/commonjs/*,src/**/*{template,-parser}.{mjs,cjs,js},tmp*}\" --reporter text-summary --reporter html --reporter lcov mocha --reporter spec --full-trace --timeout 4000 --recursive test",
351
+ "output": [
352
+ "coverage/lcov.info"
353
+ ],
354
+ "files": [
355
+ "{src,test}/**/*.{js,mjs,json}"
356
+ ]
357
+ }
358
+ },
115
359
  "keywords": [
116
360
  "state",
117
361
  "state chart",
@@ -131,51 +375,48 @@
131
375
  "state-machine-cat": "bin/smcat.mjs"
132
376
  },
133
377
  "dependencies": {
134
- "ajv": "8.10.0",
135
- "chalk": "5.0.0",
136
- "commander": "9.0.0",
378
+ "ajv": "8.11.0",
379
+ "chalk": "5.0.1",
380
+ "commander": "9.3.0",
137
381
  "fast-xml-parser": "3.21.1",
138
382
  "get-stream": "6.0.1",
139
383
  "handlebars": "4.7.7",
140
384
  "he": "1.2.0",
141
385
  "indent-string": "5.0.0",
142
- "lodash.castarray": "4.4.0",
143
- "lodash.clonedeep": "4.5.0",
144
- "lodash.get": "4.4.2",
145
- "lodash.has": "4.5.2",
146
- "lodash.reject": "4.6.0",
147
- "semver": "^7.3.5",
386
+ "lodash": "4.17.21",
387
+ "semver": "^7.3.7",
148
388
  "viz.js": "1.8.2",
149
389
  "wrap-ansi": "8.0.1"
150
390
  },
151
391
  "devDependencies": {
152
- "@typescript-eslint/eslint-plugin": "5.12.0",
153
- "@typescript-eslint/parser": "5.12.0",
154
- "c8": "7.11.0",
392
+ "@typescript-eslint/eslint-plugin": "5.27.0",
393
+ "@typescript-eslint/parser": "5.27.0",
394
+ "c8": "7.11.3",
155
395
  "chai": "4.3.6",
156
396
  "chai-as-promised": "7.1.1",
157
397
  "chai-json-schema": "1.5.1",
158
398
  "chai-xml": "0.4.0",
159
- "dependency-cruiser": "11.3.1",
160
- "esbuild": "0.14.23",
161
- "eslint": "^7.32.0",
162
- "eslint-config-moving-meadow": "2.0.9",
163
- "eslint-config-prettier": "8.4.0",
164
- "eslint-plugin-budapestian": "3.0.1",
165
- "eslint-plugin-import": "2.25.4",
399
+ "dependency-cruiser": "11.8.0",
400
+ "esbuild": "0.14.42",
401
+ "eslint": "^8.17.0",
402
+ "eslint-config-moving-meadow": "3.0.0",
403
+ "eslint-config-prettier": "8.5.0",
404
+ "eslint-plugin-budapestian": "3.0.2",
405
+ "eslint-plugin-import": "2.26.0",
166
406
  "eslint-plugin-mocha": "10.0.3",
167
407
  "eslint-plugin-node": "11.1.0",
168
- "eslint-plugin-security": "1.4.0",
169
- "eslint-plugin-unicorn": "^40.1.0",
170
- "husky": "4.3.0",
171
- "lint-staged": "12.3.4",
172
- "mocha": "9.2.1",
408
+ "eslint-plugin-security": "1.5.0",
409
+ "eslint-plugin-unicorn": "^42.0.0",
410
+ "husky": "4.3.8",
411
+ "lint-staged": "13.0.0",
412
+ "mocha": "10.0.0",
173
413
  "npm-run-all": "4.1.5",
174
- "peggy": "1.2.0",
175
- "prettier": "^2.5.0",
414
+ "peggy": "2.0.1",
415
+ "prettier": "^2.6.2",
176
416
  "query-string": "7.1.1",
177
- "typescript": "4.5.5",
417
+ "typescript": "4.7.3",
178
418
  "upem": "^7.0.0",
419
+ "wireit": "0.5.0",
179
420
  "xml-name-validator": "4.0.0"
180
421
  },
181
422
  "eslintIgnore": [
@@ -188,7 +429,7 @@
188
429
  "src/**/*.template.js"
189
430
  ],
190
431
  "engines": {
191
- "node": "^12.20||^14.13.1||>=16"
432
+ "node": "^14.13.1||^16||>=18"
192
433
  },
193
434
  "types": "types/state-machine-cat.d.ts",
194
435
  "browserslist": [
@@ -7,7 +7,7 @@ const LICENSE = `
7
7
 
8
8
  The MIT License (MIT)
9
9
 
10
- Copyright (c) 2016-2020 Sander Verweij
10
+ Copyright (c) 2016-2022 Sander Verweij
11
11
 
12
12
  Permission is hereby granted, free of charge, to any person obtaining
13
13
  a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- // Generated by Peggy 1.2.0.
1
+ // Generated by Peggy 2.0.1.
2
2
  //
3
3
  // https://peggyjs.org/
4
4
 
@@ -10,6 +10,7 @@ function peg$subclass(child, parent) {
10
10
 
11
11
  function peg$SyntaxError(message, expected, found, location) {
12
12
  var self = Error.call(this, message);
13
+ // istanbul ignore next Check is a necessary evil to support older environments
13
14
  if (Object.setPrototypeOf) {
14
15
  Object.setPrototypeOf(self, peg$SyntaxError.prototype);
15
16
  }
@@ -45,14 +46,15 @@ peg$SyntaxError.prototype.format = function(sources) {
45
46
  var loc = this.location.source + ":" + s.line + ":" + s.column;
46
47
  if (src) {
47
48
  var e = this.location.end;
48
- var filler = peg$padEnd("", s.line.toString().length);
49
+ var filler = peg$padEnd("", s.line.toString().length, ' ');
49
50
  var line = src[s.line - 1];
50
51
  var last = s.line === e.line ? e.column : line.length + 1;
52
+ var hatLen = (last - s.column) || 1;
51
53
  str += "\n --> " + loc + "\n"
52
54
  + filler + " |\n"
53
55
  + s.line + " | " + line + "\n"
54
- + filler + " | " + peg$padEnd("", s.column - 1)
55
- + peg$padEnd("", last - s.column, "^");
56
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
57
+ + peg$padEnd("", hatLen, "^");
56
58
  } else {
57
59
  str += "\n at " + loc;
58
60
  }
@@ -73,7 +75,7 @@ peg$SyntaxError.buildMessage = function(expected, found) {
73
75
  : classEscape(part);
74
76
  });
75
77
 
76
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
78
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
77
79
  },
78
80
 
79
81
  any: function() {
@@ -209,10 +211,10 @@ function peg$parse(input, options) {
209
211
  var peg$f1 = function(s) {return s.join("")};
210
212
  var peg$f2 = function(c) {return c};
211
213
  var peg$f3 = function(s) {return text()};
212
- var peg$f4 = function(bool) {return (bool==="true")};
213
- var peg$f5 = function() { return parseInt(text(), 10); };
214
- var peg$f6 = function() {return parseFloat(text())};
215
-
214
+ var peg$f4 = function(c) {return c};
215
+ var peg$f5 = function(bool) {return (bool==="true")};
216
+ var peg$f6 = function() { return parseInt(text(), 10); };
217
+ var peg$f7 = function() {return parseFloat(text())};
216
218
  var peg$currPos = 0;
217
219
  var peg$savedPos = 0;
218
220
  var peg$posDetailsCache = [{ line: 1, column: 1 }];
@@ -698,7 +700,7 @@ function peg$parse(input, options) {
698
700
  }
699
701
  if (s3 !== peg$FAILED) {
700
702
  peg$savedPos = s1;
701
- s1 = peg$f2(s3);
703
+ s1 = peg$f4(s3);
702
704
  } else {
703
705
  peg$currPos = s1;
704
706
  s1 = peg$FAILED;
@@ -773,7 +775,7 @@ function peg$parse(input, options) {
773
775
  }
774
776
  if (s3 !== peg$FAILED) {
775
777
  peg$savedPos = s1;
776
- s1 = peg$f2(s3);
778
+ s1 = peg$f4(s3);
777
779
  } else {
778
780
  peg$currPos = s1;
779
781
  s1 = peg$FAILED;
@@ -813,7 +815,7 @@ function peg$parse(input, options) {
813
815
  }
814
816
  if (s1 !== peg$FAILED) {
815
817
  peg$savedPos = s0;
816
- s1 = peg$f4(s1);
818
+ s1 = peg$f5(s1);
817
819
  }
818
820
  s0 = s1;
819
821
  peg$silentFails--;
@@ -854,7 +856,7 @@ function peg$parse(input, options) {
854
856
  }
855
857
  if (s1 !== peg$FAILED) {
856
858
  peg$savedPos = s0;
857
- s1 = peg$f5();
859
+ s1 = peg$f6();
858
860
  }
859
861
  s0 = s1;
860
862
  peg$silentFails--;
@@ -898,7 +900,7 @@ function peg$parse(input, options) {
898
900
  s2 = null;
899
901
  }
900
902
  peg$savedPos = s0;
901
- s0 = peg$f6();
903
+ s0 = peg$f7();
902
904
  } else {
903
905
  peg$currPos = s0;
904
906
  s0 = peg$FAILED;
@@ -962,5 +964,6 @@ function peg$parse(input, options) {
962
964
 
963
965
  export {
964
966
  peg$SyntaxError as SyntaxError,
967
+
965
968
  peg$parse as parse
966
969
  };
package/src/options.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import _get from "lodash.get";
2
-
3
1
  const ALLOWED_VALUES = Object.freeze({
4
2
  inputType: {
5
3
  default: "smcat",
@@ -58,11 +56,8 @@ const ALLOWED_VALUES = Object.freeze({
58
56
  * @return {any} value
59
57
  */
60
58
  function getOptionValue(pOptions, pOptionName) {
61
- return _get(
62
- pOptions,
63
- pOptionName,
64
- _get(ALLOWED_VALUES, `${pOptionName}.default`)
65
- );
59
+ // eslint-disable-next-line security/detect-object-injection
60
+ return pOptions?.[pOptionName] ?? ALLOWED_VALUES[pOptionName].default;
66
61
  }
67
62
 
68
63
  function getAllowedValues() {
@@ -1,8 +1,7 @@
1
1
  /* eslint-disable security/detect-object-injection */
2
2
  import fastxml from "fast-xml-parser";
3
3
  import he from "he";
4
- import _castArray from "lodash.castarray";
5
- import _get from "lodash.get";
4
+ import castArray from "lodash/castArray.js";
6
5
  import utl from "../../transform/utl.mjs";
7
6
  import parserHelpers from "../parser-helpers.mjs";
8
7
  import normalizeMachine from "./normalize-machine.mjs";
@@ -10,14 +9,14 @@ import normalizeMachine from "./normalize-machine.mjs";
10
9
  const formatLabel = utl.formatLabel;
11
10
 
12
11
  function extractActions(pState, pActionType) {
13
- return _castArray(pState[pActionType]).map((pAction) => ({
12
+ return castArray(pState[pActionType]).map((pAction) => ({
14
13
  type: pActionType === "onexit" ? "exit" : "entry",
15
14
  body: he.decode(pAction).trim(),
16
15
  }));
17
16
  }
18
17
 
19
18
  function extractActionsFromInvokes(pInvokeTriggers) {
20
- return _castArray(pInvokeTriggers).map((pInvokeTrigger) => {
19
+ return castArray(pInvokeTriggers).map((pInvokeTrigger) => {
21
20
  const lId = he.decode(pInvokeTrigger.id || "").trim();
22
21
 
23
22
  return {
@@ -148,7 +147,7 @@ function extractTransitions(pStates) {
148
147
  .reduce(
149
148
  (pAllTransitions, pThisState) =>
150
149
  pAllTransitions.concat(
151
- _castArray(pThisState.transition).reduce(
150
+ castArray(pThisState.transition).reduce(
152
151
  reduceTransition(pThisState),
153
152
  []
154
153
  )
@@ -195,7 +194,7 @@ export function parse(pSCXMLString) {
195
194
  stopNodes: ["onentry", "onexit", "transition"],
196
195
  });
197
196
 
198
- return mapMachine(_get(lXMLAsJSON, "scxml", {}));
197
+ return mapMachine(lXMLAsJSON?.scxml ?? {});
199
198
  }
200
199
  throw new Error("That doesn't look like valid xml ...\n");
201
200
  }
@@ -1,5 +1,4 @@
1
- import _get from "lodash.get";
2
- import _castArray from "lodash.castarray";
1
+ import castArray from "lodash/castArray.js";
3
2
 
4
3
  function normalizeInitialFromObject(pMachine) {
5
4
  const lReturnValue = {
@@ -60,9 +59,9 @@ export default function normalizeMachine(pMachine) {
60
59
  return {
61
60
  ...pMachine,
62
61
  initial: normalizeInitial(pMachine),
63
- state: _castArray(_get(pMachine, "state", [])),
64
- parallel: _castArray(_get(pMachine, "parallel", [])),
65
- history: _castArray(_get(pMachine, "history", [])),
66
- final: _castArray(_get(pMachine, "final", [])),
62
+ state: castArray(pMachine?.state ?? []),
63
+ parallel: castArray(pMachine?.parallel ?? []),
64
+ history: castArray(pMachine?.history ?? []),
65
+ final: castArray(pMachine?.final ?? []),
67
66
  };
68
67
  }