jssm 5.75.0 → 5.76.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/dist/es6/jssm.js CHANGED
@@ -1052,7 +1052,8 @@ class Machine {
1052
1052
  if (!(wstate)) {
1053
1053
  throw new JssmError(this, `No such state ${JSON.stringify(whichState)} in probable_exits_for`);
1054
1054
  }
1055
- const wstate_to = wstate.to, wtf = wstate_to
1055
+ const wstate_to = wstate.to, wtf // wstate_to_filtered -> wtf
1056
+ = wstate_to
1056
1057
  .map((ws) => this.lookup_transition_for(this.state(), ws))
1057
1058
  .filter(Boolean);
1058
1059
  return wtf;
@@ -1,19 +1,22 @@
1
1
  declare type StateType = string;
2
2
  declare type JssmSuccess = {
3
3
  success: true;
4
- };
4
+ }; /** Composite type indicating success as part of a result */
5
5
  declare type JssmFailure = {
6
6
  success: false;
7
7
  error: any;
8
- };
8
+ }; /** Composite type indicating an error, and why, as part of a result */
9
9
  declare type JssmIncomplete = {
10
10
  success: 'incomplete';
11
- };
12
- declare type JssmResult = JssmSuccess | JssmFailure | JssmIncomplete;
11
+ }; /** Composite type indicating that a result isn't finished */
12
+ declare type JssmResult = JssmSuccess | JssmFailure | JssmIncomplete; /** Composite type composing whether or not a result was successful */
13
13
  declare type JssmColor = string;
14
14
  declare type JssmPermitted = 'required' | 'disallowed';
15
15
  declare type JssmPermittedOpt = 'required' | 'disallowed' | 'optional';
16
16
  declare type JssmArrow = '->' | '<-' | '<->' | '<=->' | '<~->' | '=>' | '<=' | '<=>' | '<-=>' | '<~=>' | '~>' | '<~' | '<~>' | '<-~>' | '<=~>';
17
+ /**
18
+ * A type teaching Typescript the various supported shapes for nodes, mostly inherited from GraphViz
19
+ */
17
20
  declare type JssmShape = "box" | "polygon" | "ellipse" | "oval" | "circle" | "point" | "egg" | "triangle" | "plaintext" | "plain" | "diamond" | "trapezium" | "parallelogram" | "house" | "pentagon" | "hexagon" | "septagon" | "octagon" | "doublecircle" | "doubleoctagon" | "tripleoctagon" | "invtriangle" | "invtrapezium" | "invhouse" | "Mdiamond" | "Msquare" | "Mcircle" | "rect" | "rectangle" | "square" | "star" | "none" | "underline" | "cylinder" | "note" | "tab" | "folder" | "box3d" | "component" | "promoter" | "cds" | "terminator" | "utr" | "primersite" | "restrictionsite" | "fivepoverhang" | "threepoverhang" | "noverhang" | "assembly" | "signature" | "insulator" | "ribosite" | "rnastab" | "proteasesite" | "proteinstab" | "rpromoter" | "rarrow" | "larrow" | "lpromoter" | "record";
18
21
  declare type JssmArrowDirection = 'left' | 'right' | 'both';
19
22
  declare type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
@@ -252,7 +255,7 @@ declare type HookComplexResult<mDT> = {
252
255
  state?: StateType;
253
256
  data?: mDT;
254
257
  };
255
- declare type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>;
258
+ declare type HookResult<mDT> = true | false | undefined | void | HookComplexResult<mDT>; /** Documents whether a hook succeeded, either with a primitive or a reference to the hook complex object */
256
259
  declare type HookContext<mDT> = {
257
260
  data: mDT;
258
261
  };
@@ -261,4 +264,4 @@ declare type PostHookHandler<mDT> = (hook_context: HookContext<mDT>) => void;
261
264
  declare type JssmErrorExtendedInfo = {
262
265
  requested_state?: StateType | undefined;
263
266
  };
264
- export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
267
+ export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
@@ -49,4 +49,12 @@ declare const hook_name: (from: string, to: string) => string;
49
49
  *
50
50
  */
51
51
  declare const named_hook_name: (from: string, to: string, action: string) => string;
52
- export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name };
52
+ /*******
53
+ *
54
+ * Creates a Mulberry32 random generator. Used by the randomness test suite.
55
+ *
56
+ * Sourced from `bryc` at StackOverflow: https://stackoverflow.com/a/47593316/763127
57
+ *
58
+ */
59
+ declare const make_mulberry_rand: (a?: number | undefined) => () => number;
60
+ export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name, make_mulberry_rand };
@@ -84,4 +84,20 @@ const hook_name = (from, to) => JSON.stringify([from, to]);
84
84
  *
85
85
  */
86
86
  const named_hook_name = (from, to, action) => JSON.stringify([from, to, action]);
87
- export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name };
87
+ /*******
88
+ *
89
+ * Creates a Mulberry32 random generator. Used by the randomness test suite.
90
+ *
91
+ * Sourced from `bryc` at StackOverflow: https://stackoverflow.com/a/47593316/763127
92
+ *
93
+ */
94
+ const make_mulberry_rand = (a) => () => {
95
+ if (a === undefined) {
96
+ a = new Date().getTime();
97
+ }
98
+ let t = a += 0x6D2B79F5;
99
+ t = Math.imul(t ^ t >>> 15, t | 1);
100
+ t ^= t + Math.imul(t ^ t >>> 7, t | 61);
101
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
102
+ };
103
+ export { seq, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, hook_name, named_hook_name, make_mulberry_rand };
@@ -1,2 +1,2 @@
1
- const version = "5.75.0";
1
+ const version = "5.76.2";
2
2
  export { version };