state-machine-cat 9.2.4 → 10.0.1

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.
@@ -1,4 +1,3 @@
1
- import _get from "lodash.get";
2
1
  import utl from "./utl.mjs";
3
2
 
4
3
  function isType(pString) {
@@ -55,10 +54,9 @@ function flattenNote(pState) {
55
54
 
56
55
  function recolor(pNodeAttributes) {
57
56
  return (pState) => {
58
- const lNodeColor = _get(
59
- (pNodeAttributes || []).find((pAttribute) => pAttribute.name === "color"),
60
- "value"
61
- );
57
+ const lNodeColor = (pNodeAttributes || []).find(
58
+ (pAttribute) => pAttribute.name === "color"
59
+ )?.value;
62
60
 
63
61
  if (
64
62
  lNodeColor &&
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable security/detect-object-injection */
2
- import has from "lodash.has";
2
+ import has from "lodash/has.js";
3
3
  import smcat from "./smcat/index.js";
4
4
  import dot from "./dot/index.mjs";
5
5
  import vector from "./vector/vector-native-dot-with-fallback.mjs";
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable security/detect-object-injection */
2
- import has from "lodash.has";
2
+ import has from "lodash/has.js";
3
3
  import smcat from "./smcat/index.js";
4
4
  import dot from "./dot/index.mjs";
5
5
  import svg from "./vector/vector-with-viz-js.mjs";
@@ -1,5 +1,5 @@
1
1
  const Handlebars = require("handlebars/dist/handlebars.runtime.js");
2
- const _clonedeep = require("lodash.clonedeep");
2
+ const cloneDeep = require("lodash/cloneDeep.js");
3
3
 
4
4
  // eslint-disable-next-line import/no-unassigned-import
5
5
  require("./smcat.template.js");
@@ -89,7 +89,7 @@ Handlebars.registerHelper("quotifyActions", (pItem) =>
89
89
  module.exports = function renderSmcat(pAST) {
90
90
  return Handlebars.templates["smcat.template.hbs"]({
91
91
  ...pAST,
92
- states: transformStates(_clonedeep(pAST.states)),
93
- transitions: transformTransitions(_clonedeep(pAST.transitions || [])),
92
+ states: transformStates(cloneDeep(pAST.states)),
93
+ transitions: transformTransitions(cloneDeep(pAST.transitions || [])),
94
94
  });
95
95
  };
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable security/detect-object-injection */
2
- import _clonedeep from "lodash.clonedeep";
3
- import _reject from "lodash.reject";
2
+ import cloneDeep from "lodash/cloneDeep.js";
3
+ import reject from "lodash/reject.js";
4
4
  import StateMachineModel from "../state-machine-model.mjs";
5
5
  import utl from "./utl.mjs";
6
6
 
@@ -70,7 +70,7 @@ function deSugarPseudoStates(
70
70
  pPseudoStateNames,
71
71
  pOutgoingTransitionMap
72
72
  ) {
73
- const lMachine = _clonedeep(pMachine);
73
+ const lMachine = cloneDeep(pMachine);
74
74
 
75
75
  if (lMachine.transitions && pPseudoStateNames.length > 0) {
76
76
  lMachine.transitions = fuseTransitions(
@@ -97,10 +97,10 @@ function deSugarPseudoStates(
97
97
  }
98
98
 
99
99
  function removeStatesCascading(pMachine, pStateNames) {
100
- const lMachine = _clonedeep(pMachine);
100
+ const lMachine = cloneDeep(pMachine);
101
101
 
102
102
  if (lMachine.transitions) {
103
- lMachine.transitions = _reject(lMachine.transitions, (pTransition) =>
103
+ lMachine.transitions = reject(lMachine.transitions, (pTransition) =>
104
104
  pStateNames.some(
105
105
  (pJunctionStateName) =>
106
106
  pJunctionStateName === pTransition.from ||
@@ -109,7 +109,7 @@ function removeStatesCascading(pMachine, pStateNames) {
109
109
  );
110
110
  }
111
111
 
112
- lMachine.states = _reject(lMachine.states, (pState) =>
112
+ lMachine.states = reject(lMachine.states, (pState) =>
113
113
  pStateNames.includes(pState.name)
114
114
  ).map((pState) =>
115
115
  pState.statemachine
package/src/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "9.2.4";
1
+ export const version = "10.0.1";
@@ -252,7 +252,7 @@ export interface IRenderOptions {
252
252
  * See below for the complete list.
253
253
  * @return the string with the rendered content if
254
254
  * no error was found
255
- * @throws If an error occurred and no callback
255
+ * @throws {Error} If an error occurred and no callback
256
256
  * function was passed: the error
257
257
  *
258
258
  * Options: see https://github.com/sverweij/state-machine-cat/docs/api.md