jssm 5.121.0 → 5.122.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/README.md CHANGED
@@ -18,10 +18,10 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`
18
18
 
19
19
 
20
20
 
21
- * Generated for version 5.121.0 at 5/16/2026, 8:32:21 PM
21
+ * Generated for version 5.122.2 at 5/17/2026, 9:09:21 PM
22
22
 
23
23
  -->
24
- # jssm 5.121.0
24
+ # jssm 5.122.2
25
25
 
26
26
  [**Try the live editor**](https://stonecypher.github.io/jssm-viz-demo/graph_explorer.html) ·
27
27
  [Documentation](https://stonecypher.github.io/jssm/docs/) ·
@@ -281,7 +281,7 @@ That decision shows up everywhere downstream:
281
281
  or run `npm run benny` against your own machine.
282
282
 
283
283
  - **More thoroughly tested than any other JavaScript state-machine
284
- library.** 6,009 tests at 100.0% line coverage
284
+ library.** 6,041 tests at 100.0% line coverage
285
285
  ([report](https://coveralls.io/github/StoneCypher/jssm)), plus
286
286
  fuzz testing via `fast-check`, with parser test data across ten natural
287
287
  languages and Emoji.
@@ -414,11 +414,11 @@ If your contribution is missing here, please open an issue.
414
414
 
415
415
  <br/>
416
416
 
417
- ***6,009 tests***, run 56,796 times.
417
+ ***6,041 tests***, run 56,828 times.
418
418
 
419
- - 5,496 specs with 100.0% coverage
420
- - 513 fuzz tests with 20.2% coverage
421
- - 4,280 TypeScript lines - 1.4 tests per line, 13.3 generated tests per line
419
+ - 5,528 specs with 100.0% coverage
420
+ - 513 fuzz tests with 4.6% coverage
421
+ - 4,281 TypeScript lines - 1.4 tests per line, 13.3 generated tests per line
422
422
 
423
423
  [![Actions Status](https://github.com/StoneCypher/jssm/workflows/Node%20CI/badge.svg)](https://github.com/StoneCypher/jssm/actions)
424
424
  [![NPM version](https://img.shields.io/npm/v/jssm.svg)](https://www.npmjs.com/package/jssm)
package/dist/cdn/viz.js CHANGED
@@ -20957,7 +20957,8 @@ theme_mapping.set('bold', bold_theme);
20957
20957
  * plus the high-Unicode range `U+0080`–`U+FFFF`.
20958
20958
  *
20959
20959
  * @example
20960
- * state_name_chars.some(r => 'A' >= r.from && 'A' <= r.to); // true
20960
+ * import { state_name_chars } from 'jssm';
20961
+ * state_name_chars.some(r => 'A' >= r.from && 'A' <= r.to); // => true
20961
20962
  */
20962
20963
  // keep in sync with src/ts/fsl_parser.peg:278
20963
20964
  const state_name_chars$1 = Object.freeze([
@@ -20989,7 +20990,8 @@ const state_name_chars$1 = Object.freeze([
20989
20990
  * `?`, `,`, and the high-Unicode range `U+0080`–`U+FFFF`.
20990
20991
  *
20991
20992
  * @example
20992
- * state_name_first_chars.some(r => '+' >= r.from && '+' <= r.to); // false
20993
+ * import { state_name_first_chars } from 'jssm';
20994
+ * state_name_first_chars.some(r => '+' >= r.from && '+' <= r.to); // => false
20993
20995
  */
20994
20996
  // keep in sync with src/ts/fsl_parser.peg:275
20995
20997
  const state_name_first_chars$1 = Object.freeze([
@@ -21015,8 +21017,9 @@ const state_name_first_chars$1 = Object.freeze([
21015
21017
  * Three ranges: `U+0020`–`U+0026`, `U+0028`–`U+005B`, `U+005D`–`U+FFFF`.
21016
21018
  *
21017
21019
  * @example
21018
- * action_label_chars.some(r => ' ' >= r.from && ' ' <= r.to); // true
21019
- * action_label_chars.some(r => "'" >= r.from && "'" <= r.to); // false
21020
+ * import { action_label_chars } from 'jssm';
21021
+ * action_label_chars.some(r => ' ' >= r.from && ' ' <= r.to); // => true
21022
+ * action_label_chars.some(r => "'" >= r.from && "'" <= r.to); // => false
21020
21023
  */
21021
21024
  // keep in sync with src/ts/fsl_parser.peg:240
21022
21025
  const action_label_chars$1 = Object.freeze([
@@ -21038,7 +21041,7 @@ var constants = /*#__PURE__*/Object.freeze({
21038
21041
  * Useful for runtime diagnostics and for embedding in serialized machine
21039
21042
  * snapshots so that deserializers can detect version-skew.
21040
21043
  */
21041
- const version = "5.121.0";
21044
+ const version = "5.122.2";
21042
21045
 
21043
21046
  // whargarbl lots of these return arrays could/should be sets
21044
21047
  const { state_name_chars, state_name_first_chars, action_label_chars } = constants;
@@ -21467,12 +21470,18 @@ class Machine {
21467
21470
  }
21468
21471
  // done building, do checks
21469
21472
  // assert all props are valid
21473
+ // _state_properties keys are always JSON.stringify([string, string]),
21474
+ // built by name_bind_prop_and_state which throws on non-strings — so the
21475
+ // non-array / non-string else-arms below are unreachable, not untested.
21470
21476
  this._state_properties.forEach((_value, key) => {
21471
21477
  const inside = JSON.parse(key);
21478
+ /* v8 ignore else */
21472
21479
  if (Array.isArray(inside)) {
21473
21480
  const j_property = inside[0];
21481
+ /* v8 ignore else */
21474
21482
  if (typeof j_property === 'string') {
21475
21483
  const j_state = inside[1];
21484
+ /* v8 ignore else */
21476
21485
  if (typeof j_state === 'string') {
21477
21486
  if (!(this.known_prop(j_property))) {
21478
21487
  throw new JssmError(this, `State "${j_state}" has property "${j_property}" which is not globally declared`);
@@ -22193,8 +22202,9 @@ class Machine {
22193
22202
  * @returns An array of `{from, to}` inclusive character ranges.
22194
22203
  *
22195
22204
  * @example
22205
+ * import { sm } from 'jssm';
22196
22206
  * const m = sm`a -> b;`;
22197
- * m.all_state_name_chars().some(r => '+' >= r.from && '+' <= r.to); // true
22207
+ * m.all_state_name_chars().some(r => '+' >= r.from && '+' <= r.to); // => true
22198
22208
  */
22199
22209
  all_state_name_chars() {
22200
22210
  return state_name_chars;
@@ -22206,8 +22216,9 @@ class Machine {
22206
22216
  * @returns An array of `{from, to}` inclusive character ranges.
22207
22217
  *
22208
22218
  * @example
22219
+ * import { sm } from 'jssm';
22209
22220
  * const m = sm`a -> b;`;
22210
- * m.all_state_name_first_chars().some(r => '+' >= r.from && '+' <= r.to); // false
22221
+ * m.all_state_name_first_chars().some(r => '+' >= r.from && '+' <= r.to); // => false
22211
22222
  */
22212
22223
  all_state_name_first_chars() {
22213
22224
  return state_name_first_chars;
@@ -22219,9 +22230,10 @@ class Machine {
22219
22230
  * @returns An array of `{from, to}` inclusive character ranges.
22220
22231
  *
22221
22232
  * @example
22233
+ * import { sm } from 'jssm';
22222
22234
  * const m = sm`a -> b;`;
22223
- * m.all_action_label_chars().some(r => ' ' >= r.from && ' ' <= r.to); // true
22224
- * m.all_action_label_chars().some(r => "'" >= r.from && "'" <= r.to); // false
22235
+ * m.all_action_label_chars().some(r => ' ' >= r.from && ' ' <= r.to); // => true
22236
+ * m.all_action_label_chars().some(r => "'" >= r.from && "'" <= r.to); // => false
22225
22237
  */
22226
22238
  all_action_label_chars() {
22227
22239
  return action_label_chars;
@@ -23722,9 +23734,7 @@ class Machine {
23722
23734
  layers.push(theme.state);
23723
23735
  }
23724
23736
  });
23725
- if (this._state_style) {
23726
- layers.push(this._state_style);
23727
- }
23737
+ layers.push(this._state_style);
23728
23738
  // hooked state style
23729
23739
  // if (this.has_hooks(state)) {
23730
23740
  // layers.push(base_theme.hooked);
@@ -23741,9 +23751,7 @@ class Machine {
23741
23751
  layers.push(theme.terminal);
23742
23752
  }
23743
23753
  });
23744
- if (this._terminal_state_style) {
23745
- layers.push(this._terminal_state_style);
23746
- }
23754
+ layers.push(this._terminal_state_style);
23747
23755
  }
23748
23756
  // start state style
23749
23757
  if (this.is_start_state(state)) {
@@ -23753,9 +23761,7 @@ class Machine {
23753
23761
  layers.push(theme.start);
23754
23762
  }
23755
23763
  });
23756
- if (this._start_state_style) {
23757
- layers.push(this._start_state_style);
23758
- }
23764
+ layers.push(this._start_state_style);
23759
23765
  }
23760
23766
  // end state style
23761
23767
  if (this.is_end_state(state)) {
@@ -23765,9 +23771,7 @@ class Machine {
23765
23771
  layers.push(theme.end);
23766
23772
  }
23767
23773
  });
23768
- if (this._end_state_style) {
23769
- layers.push(this._end_state_style);
23770
- }
23774
+ layers.push(this._end_state_style);
23771
23775
  }
23772
23776
  // active state style
23773
23777
  if (this.state() === state) {
@@ -23777,9 +23781,7 @@ class Machine {
23777
23781
  layers.push(theme.active);
23778
23782
  }
23779
23783
  });
23780
- if (this._active_state_style) {
23781
- layers.push(this._active_state_style);
23782
- }
23784
+ layers.push(this._active_state_style);
23783
23785
  }
23784
23786
  const individual_style = {}, decl = this._state_declarations.get(state);
23785
23787
  individual_style.color = decl === null || decl === void 0 ? void 0 : decl.color;