state-machine-cat 15.0.5 → 15.0.6

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.
@@ -141,9 +141,7 @@ export function parseTransitionExpression(pString) {
141
141
  lReturnValue.cond = lMatch.groups.condition.slice(1, -1).trim();
142
142
  }
143
143
  if (lMatch.groups.action) {
144
- lReturnValue.action = lMatch.groups.action
145
- .slice(1, lMatch.groups.action.length)
146
- .trim();
144
+ lReturnValue.action = lMatch.groups.action.slice(1).trim();
147
145
  }
148
146
  }
149
147
  return lReturnValue;
@@ -47,12 +47,12 @@ function renderSimpleTag(pOnExit, pTag, pDepth) {
47
47
  return indentString(lReturnValue, pDepth * INDENT_LENGTH);
48
48
  }
49
49
  function renderOnEntries(pOnEntries, pDepth) {
50
- return (pOnEntries ?? [])
50
+ return pOnEntries
51
51
  .map((pOnEntry) => renderSimpleTag(pOnEntry, "onentry", pDepth))
52
52
  .join("");
53
53
  }
54
54
  function renderOnExits(pOnExits, pDepth) {
55
- return (pOnExits ?? [])
55
+ return pOnExits
56
56
  .map((pOnExit) => renderSimpleTag(pOnExit, "onexit", pDepth))
57
57
  .join("");
58
58
  }
@@ -69,9 +69,9 @@ function renderStateAttributes(pState) {
69
69
  function renderState(pState, pDepth) {
70
70
  let lReturnValue = `\n<${pState.kind}${renderStateAttributes(pState)}>`;
71
71
  lReturnValue += renderStates(pState.states, pDepth);
72
- lReturnValue += renderOnEntries(pState.onentries, pDepth);
73
- lReturnValue += renderOnExits(pState.onexits, pDepth);
74
- lReturnValue += renderTransitions(pState.transitions, pDepth);
72
+ lReturnValue += renderOnEntries(pState.onentries ?? [], pDepth);
73
+ lReturnValue += renderOnExits(pState.onexits ?? [], pDepth);
74
+ lReturnValue += renderTransitions(pState.transitions ?? [], pDepth);
75
75
  lReturnValue += `\n</${pState.kind}>`;
76
76
  return indentString(lReturnValue, pDepth * INDENT_LENGTH);
77
77
  }
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "15.0.5";
1
+ export const version = "15.0.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-machine-cat",
3
- "version": "15.0.5",
3
+ "version": "15.0.6",
4
4
  "description": "write beautiful state charts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -41,8 +41,8 @@
41
41
  "state-machine-cat": "dist/cli/main.mjs"
42
42
  },
43
43
  "dependencies": {
44
- "@hpcc-js/wasm-graphviz": "1.22.1",
45
- "fast-xml-parser": "5.9.0",
44
+ "@hpcc-js/wasm-graphviz": "1.24.1",
45
+ "fast-xml-parser": "5.9.3",
46
46
  "he": "1.2.0",
47
47
  "neotraverse": "^0.6.18"
48
48
  },
@@ -149,7 +149,6 @@ export interface IStateMachine {
149
149
  *
150
150
  * @type {string}
151
151
  */
152
- // eslint-disable-next-line init-declarations
153
152
  export const version: string;
154
153
 
155
154
  export interface IAllowedValue {
@@ -207,10 +206,7 @@ export type OutputType =
207
206
  export type EngineType = "dot" | "circo" | "fdp" | "neato" | "osage" | "twopi";
208
207
 
209
208
  export type DirectionType =
210
- | "top-down"
211
- | "bottom-top"
212
- | "left-right"
213
- | "right-left";
209
+ "top-down" | "bottom-top" | "left-right" | "right-left";
214
210
 
215
211
  export type dotAttributesType = {
216
212
  name: string;
@@ -273,12 +269,11 @@ export type StringRenderFunctionType = (
273
269
  export type WhateverRenderFunctionType = (
274
270
  pStateMachine: IStateMachine,
275
271
  pOptions?: IRenderOptions,
276
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
272
+ // oxlint-disable-next-line no-explicit-any
277
273
  ) => any;
278
274
 
279
275
  export type RenderFunctionType =
280
- | StringRenderFunctionType
281
- | WhateverRenderFunctionType;
276
+ StringRenderFunctionType | WhateverRenderFunctionType;
282
277
 
283
278
  /**
284
279
  * Translates the input script to an output script.
@@ -286,7 +281,7 @@ export type RenderFunctionType =
286
281
  * @param pScript The script to translate
287
282
  * @param pOptions options influencing parsing & rendering.
288
283
  * See below for the complete list.
289
- * @return a promise to the string with the rendered content if
284
+ * @returns a promise to the string with the rendered content if
290
285
  * no error was found
291
286
  * @throws {Error} If an error occurred and no callback
292
287
  * function was passed: the error