Comparing version 5.72.5 to 5.73.0
@@ -5,3 +5,3 @@ # Changelog | ||
931 merges; 120 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md) | ||
933 merges; 122 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md) | ||
@@ -16,3 +16,3 @@ | ||
<a href="#5__72__3">5.72.3</a>, <a href="#5__72__2">5.72.2</a>, <a href="#5__72__1">5.72.1</a>, <a href="#5__72__0">5.72.0</a>, <a href="#5__71__1">5.71.1</a>, <a href="#5__71__0">5.71.0</a>, <a href="#5__70__36">5.70.36</a>, <a href="#5__70__35">5.70.35</a>, <a href="#5__70__34">5.70.34</a>, <a href="#5__70__33">5.70.33</a>, <a href="#5__70__32">5.70.32</a>, <a href="#5__70__31">5.70.31</a>, <a href="#5__70__30">5.70.30</a>, <a href="#5__70__29">5.70.29</a>, <a href="#5__70__28">5.70.28</a>, <a href="#5__70__27">5.70.27</a>, <a href="#5__70__26">5.70.26</a>, <a href="#5__70__25">5.70.25</a>, <a href="#5__70__24">5.70.24</a>, <a href="#5__70__23">5.70.23</a>, <a href="#5__70__22">5.70.22</a>, <a href="#5__70__21">5.70.21</a>, <a href="#5__70__20">5.70.20</a>, <a href="#5__70__19">5.70.19</a>, <a href="#5__70__18">5.70.18</a>, <a href="#5__70__16">5.70.16</a>, <a href="#5__70__15">5.70.15</a>, <a href="#5__70__14">5.70.14</a>, <a href="#5__70__13">5.70.13</a>, <a href="#5__70__12">5.70.12</a>, <a href="#5__70__11">5.70.11</a>, <a href="#5__70__10">5.70.10</a>, <a href="#5__70__9">5.70.9</a>, <a href="#5__70__8">5.70.8</a>, <a href="#5__70__7">5.70.7</a>, <a href="#5__70__6">5.70.6</a>, <a href="#5__70__5">5.70.5</a>, <a href="#5__70__4">5.70.4</a>, <a href="#5__70__3">5.70.3</a>, <a href="#5__70__2">5.70.2</a>, <a href="#5__70__1">5.70.1</a>, <a href="#5__70__0">5.70.0</a>, <a href="#5__69__4">5.69.4</a>, <a href="#5__69__3">5.69.3</a>, <a href="#5__69__2">5.69.2</a>, <a href="#5__69__0">5.69.0</a>, <a href="#5__68__0">5.68.0</a>, <a href="#5__67__2">5.67.2</a>, <a href="#5__67__0">5.67.0</a>, <a href="#5__66__0">5.66.0</a>, <a href="#5__65__14">5.65.14</a>, <a href="#5__65__12">5.65.12</a>, <a href="#5__65__11">5.65.11</a>, <a href="#5__65__10">5.65.10</a>, <a href="#5__65__9">5.65.9</a>, <a href="#5__65__8">5.65.8</a>, <a href="#5__65__7">5.65.7</a>, <a href="#5__65__5">5.65.5</a>, <a href="#5__65__4">5.65.4</a>, <a href="#5__65__3">5.65.3</a>, <a href="#5__65__2">5.65.2</a>, <a href="#5__65__1">5.65.1</a>, <a href="#5__65__0">5.65.0</a>, <a href="#5__64__2">5.64.2</a>, <a href="#5__64__1">5.64.1</a>, <a href="#5__64__0">5.64.0</a>, <a href="#5__63__0">5.63.0</a>, <a href="#5__62__0">5.62.0</a>, <a href="#5__61__4">5.61.4</a>, <a href="#5__61__3">5.61.3</a>, <a href="#5__61__2">5.61.2</a>, <a href="#5__61__1">5.61.1</a>, <a href="#5__60__4">5.60.4</a>, <a href="#5__60__3">5.60.3</a>, <a href="#5__60__0">5.60.0</a>, <a href="#5__59__1">5.59.1</a>, <a href="#5__59__0">5.59.0</a>, <a href="#5__58__1">5.58.1</a>, <a href="#5__58__0">5.58.0</a>, <a href="#5__57__1">5.57.1</a>, <a href="#5__57__0">5.57.0</a>, <a href="#5__56__2">5.56.2</a>, <a href="#5__56__1">5.56.1</a>, <a href="#5__55__0">5.55.0</a>, <a href="#5__54__0">5.54.0</a>, <a href="#5__53__0">5.53.0</a>, <a href="#5__52__0">5.52.0</a>, <a href="#5__51__0">5.51.0</a>, <a href="#5__50__0">5.50.0</a>, <a href="#5__49__0">5.49.0</a>, <a href="#5__48__0">5.48.0</a>, <a href="#5__47__0">5.47.0</a>, <a href="#5__46__0">5.46.0</a>, <a href="#5__45__2">5.45.2</a>, <a href="#5__45__0">5.45.0</a>, <a href="#5__44__0">5.44.0</a>, <a href="#5__43__2">5.43.2</a>, <a href="#v5__42__0">v5.42.0</a>, <a href="#5__42__0">5.42.0</a>, <a href="#v5__41__15">v5.41.15</a>, <a href="#5__41__15">5.41.15</a>, <a href="#v5__41__14">v5.41.14</a>, <a href="#5__41__14">5.41.14</a>, <a href="#v5__41__12">v5.41.12</a>, <a href="#5__41__12">5.41.12</a>, <a href="#v5__41__10">v5.41.10</a>, <a href="#5__41__10">5.41.10</a>, <a href="#v5__41__9">v5.41.9</a>, <a href="#5__41__9">5.41.9</a>, <a href="#v5__41__8">v5.41.8</a>, <a href="#5__41__8">5.41.8</a>, <a href="#v5__41__7">v5.41.7</a>, <a href="#v5__41__2">v5.41.2</a>, <a href="#v5__41__1">v5.41.1</a>, <a href="#v5__32__14">v5.32.14</a>, <a href="#5__14__0">5.14.0</a>, <a href="#5__12__0">5.12.0</a>, <a href="#5__11__12">5.11.12</a>, <a href="#5__11__1">5.11.1</a>, <a href="#5__11__0">5.11.0</a> | ||
<a href="#5__72__5">5.72.5</a>, <a href="#5__72__4">5.72.4</a>, <a href="#5__72__3">5.72.3</a>, <a href="#5__72__2">5.72.2</a>, <a href="#5__72__1">5.72.1</a>, <a href="#5__72__0">5.72.0</a>, <a href="#5__71__1">5.71.1</a>, <a href="#5__71__0">5.71.0</a>, <a href="#5__70__36">5.70.36</a>, <a href="#5__70__35">5.70.35</a>, <a href="#5__70__34">5.70.34</a>, <a href="#5__70__33">5.70.33</a>, <a href="#5__70__32">5.70.32</a>, <a href="#5__70__31">5.70.31</a>, <a href="#5__70__30">5.70.30</a>, <a href="#5__70__29">5.70.29</a>, <a href="#5__70__28">5.70.28</a>, <a href="#5__70__27">5.70.27</a>, <a href="#5__70__26">5.70.26</a>, <a href="#5__70__25">5.70.25</a>, <a href="#5__70__24">5.70.24</a>, <a href="#5__70__23">5.70.23</a>, <a href="#5__70__22">5.70.22</a>, <a href="#5__70__21">5.70.21</a>, <a href="#5__70__20">5.70.20</a>, <a href="#5__70__19">5.70.19</a>, <a href="#5__70__18">5.70.18</a>, <a href="#5__70__16">5.70.16</a>, <a href="#5__70__15">5.70.15</a>, <a href="#5__70__14">5.70.14</a>, <a href="#5__70__13">5.70.13</a>, <a href="#5__70__12">5.70.12</a>, <a href="#5__70__11">5.70.11</a>, <a href="#5__70__10">5.70.10</a>, <a href="#5__70__9">5.70.9</a>, <a href="#5__70__8">5.70.8</a>, <a href="#5__70__7">5.70.7</a>, <a href="#5__70__6">5.70.6</a>, <a href="#5__70__5">5.70.5</a>, <a href="#5__70__4">5.70.4</a>, <a href="#5__70__3">5.70.3</a>, <a href="#5__70__2">5.70.2</a>, <a href="#5__70__1">5.70.1</a>, <a href="#5__70__0">5.70.0</a>, <a href="#5__69__4">5.69.4</a>, <a href="#5__69__3">5.69.3</a>, <a href="#5__69__2">5.69.2</a>, <a href="#5__69__0">5.69.0</a>, <a href="#5__68__0">5.68.0</a>, <a href="#5__67__2">5.67.2</a>, <a href="#5__67__0">5.67.0</a>, <a href="#5__66__0">5.66.0</a>, <a href="#5__65__14">5.65.14</a>, <a href="#5__65__12">5.65.12</a>, <a href="#5__65__11">5.65.11</a>, <a href="#5__65__10">5.65.10</a>, <a href="#5__65__9">5.65.9</a>, <a href="#5__65__8">5.65.8</a>, <a href="#5__65__7">5.65.7</a>, <a href="#5__65__5">5.65.5</a>, <a href="#5__65__4">5.65.4</a>, <a href="#5__65__3">5.65.3</a>, <a href="#5__65__2">5.65.2</a>, <a href="#5__65__1">5.65.1</a>, <a href="#5__65__0">5.65.0</a>, <a href="#5__64__2">5.64.2</a>, <a href="#5__64__1">5.64.1</a>, <a href="#5__64__0">5.64.0</a>, <a href="#5__63__0">5.63.0</a>, <a href="#5__62__0">5.62.0</a>, <a href="#5__61__4">5.61.4</a>, <a href="#5__61__3">5.61.3</a>, <a href="#5__61__2">5.61.2</a>, <a href="#5__61__1">5.61.1</a>, <a href="#5__60__4">5.60.4</a>, <a href="#5__60__3">5.60.3</a>, <a href="#5__60__0">5.60.0</a>, <a href="#5__59__1">5.59.1</a>, <a href="#5__59__0">5.59.0</a>, <a href="#5__58__1">5.58.1</a>, <a href="#5__58__0">5.58.0</a>, <a href="#5__57__1">5.57.1</a>, <a href="#5__57__0">5.57.0</a>, <a href="#5__56__2">5.56.2</a>, <a href="#5__56__1">5.56.1</a>, <a href="#5__55__0">5.55.0</a>, <a href="#5__54__0">5.54.0</a>, <a href="#5__53__0">5.53.0</a>, <a href="#5__52__0">5.52.0</a>, <a href="#5__51__0">5.51.0</a>, <a href="#5__50__0">5.50.0</a>, <a href="#5__49__0">5.49.0</a>, <a href="#5__48__0">5.48.0</a>, <a href="#5__47__0">5.47.0</a>, <a href="#5__46__0">5.46.0</a>, <a href="#5__45__2">5.45.2</a>, <a href="#5__45__0">5.45.0</a>, <a href="#5__44__0">5.44.0</a>, <a href="#5__43__2">5.43.2</a>, <a href="#v5__42__0">v5.42.0</a>, <a href="#5__42__0">5.42.0</a>, <a href="#v5__41__15">v5.41.15</a>, <a href="#5__41__15">5.41.15</a>, <a href="#v5__41__14">v5.41.14</a>, <a href="#5__41__14">5.41.14</a>, <a href="#v5__41__12">v5.41.12</a>, <a href="#5__41__12">5.41.12</a>, <a href="#v5__41__10">v5.41.10</a>, <a href="#5__41__10">5.41.10</a>, <a href="#v5__41__9">v5.41.9</a>, <a href="#5__41__9">5.41.9</a>, <a href="#v5__41__8">v5.41.8</a>, <a href="#5__41__8">5.41.8</a>, <a href="#v5__41__7">v5.41.7</a>, <a href="#v5__41__2">v5.41.2</a>, <a href="#v5__41__1">v5.41.1</a>, <a href="#v5__32__14">v5.32.14</a>, <a href="#5__14__0">5.14.0</a>, <a href="#5__12__0">5.12.0</a>, <a href="#5__11__12">5.11.12</a>, <a href="#5__11__1">5.11.1</a>, <a href="#5__11__0">5.11.0</a> | ||
@@ -27,4 +27,41 @@ | ||
## [Untagged] - 6/25/2022 8:12:11 AM | ||
<a name="5__72__5" /> | ||
## [5.72.5] - 6/25/2022 11:07:29 AM | ||
Commit [f1a61f1e967df66b87f2b6b39f75636659f496e9](https://github.com/StoneCypher/jssm/commit/f1a61f1e967df66b87f2b6b39f75636659f496e9) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
Merges [dc3096f, 751c5fd] | ||
* Merge pull request #503 from StoneCypher/AttemptToCaptureTestResults | ||
* Captures test results, fixes StoneCypher/fsl#944, tools readme, fixes StoneCypher/fsl#736 | ||
| ||
| ||
## [Untagged] - 6/25/2022 11:04:20 AM | ||
Commit [751c5fd0cc8c9751331e664e8f51af34f736ce31](https://github.com/StoneCypher/jssm/commit/751c5fd0cc8c9751331e664e8f51af34f736ce31) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* Captures test results, fixes StoneCypher/fsl#944, tools readme, fixes StoneCypher/fsl#736 | ||
| ||
| ||
<a name="5__72__4" /> | ||
## [5.72.4] - 6/25/2022 8:12:11 AM | ||
Commit [dc3096f064e58ea616899b12d3d25c973f326c1c](https://github.com/StoneCypher/jssm/commit/dc3096f064e58ea616899b12d3d25c973f326c1c) | ||
@@ -147,32 +184,2 @@ | ||
* Merge pull request #501 from StoneCypher/MovingToAbstractHooks | ||
* Moving to abstract hooks | ||
| ||
| ||
## [Untagged] - 6/24/2022 7:44:55 PM | ||
Commit [d52217ab9dde2a5746cd0704597d337362057024](https://github.com/StoneCypher/jssm/commit/d52217ab9dde2a5746cd0704597d337362057024) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* Basic conversion to abstract hooks complete; fixes StoneCypher/fsl#931 | ||
| ||
| ||
## [Untagged] - 6/24/2022 7:36:27 PM | ||
Commit [adfa9069ba5e78d8a227896a5f7e14a8f4b80117](https://github.com/StoneCypher/jssm/commit/adfa9069ba5e78d8a227896a5f7e14a8f4b80117) | ||
Author: `John Haugeland <stonecypher@gmail.com>` | ||
* the conversion continues | ||
* Moving to abstract hooks |
@@ -105,2 +105,3 @@ declare type StateType = string; | ||
check?: JssmStatePermitterMaybeArray<DataType>; | ||
history?: number; | ||
min_exits?: number; | ||
@@ -107,0 +108,0 @@ max_exits?: number; |
declare type StateType = string; | ||
import { circular_buffer } from 'circular_buffer_js'; | ||
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule, | ||
@@ -236,3 +237,5 @@ JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types'; | ||
_any_transition_hook: HookHandler<mDT> | undefined; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, data }: JssmGenericConfig<mDT>); | ||
_history: circular_buffer<[StateType, mDT]>; | ||
_history_length: number; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data }: JssmGenericConfig<mDT>); | ||
/******** | ||
@@ -555,2 +558,84 @@ * | ||
transition_impl(newStateOrAction: StateType, newData: mDT | undefined, wasForced: boolean, wasAction: boolean): boolean; | ||
/********* | ||
* | ||
* Get a truncated history of the recent states and data of the machine. | ||
* Turned off by default; configure with `.from('...', {data: 5})` by length, | ||
* or set `.history_length` at runtime. | ||
* | ||
* History *does not contain the current state*. If you want that, call | ||
* `.history_inclusive` instead. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from( | ||
* "a 'next' -> b 'next' -> c 'next' -> d 'next' -> e;", | ||
* { history: 3 } | ||
* ); | ||
* | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* | ||
* foo.history; // [ ['b',undefined], ['c',undefined], ['d',undefined] ] | ||
* ``` | ||
* | ||
* Notice that the machine's current state, `e`, is not in the returned list. | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history(): [string, mDT][]; | ||
/********* | ||
* | ||
* Get a truncated history of the recent states and data of the machine, | ||
* including the current state. Turned off by default; configure with | ||
* `.from('...', {data: 5})` by length, or set `.history_length` at runtime. | ||
* | ||
* History inclusive contains the current state. If you only want past | ||
* states, call `.history` instead. | ||
* | ||
* The list returned will be one longer than the history buffer kept, as the | ||
* history buffer kept gets the current state added to it to produce this | ||
* list. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from( | ||
* "a 'next' -> b 'next' -> c 'next' -> d 'next' -> e;", | ||
* { history: 3 } | ||
* ); | ||
* | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* | ||
* foo.history_inclusive; // [ ['b',undefined], ['c',undefined], ['d',undefined], ['e',undefined] ] | ||
* ``` | ||
* | ||
* Notice that the machine's current state, `e`, is in the returned list. | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history_inclusive(): [string, mDT][]; | ||
/********* | ||
* | ||
* Find out how long a history this machine is keeping. Defaults to zero. | ||
* Settable directly. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from("a -> b;"); | ||
* foo.history_length; // 0 | ||
* | ||
* const bar = jssm.from("a -> b;", { history: 3 }); | ||
* foo.history_length; // 3 | ||
* foo.history_length = 5; | ||
* foo.history_length; // 5 | ||
* ``` | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history_length(): number; | ||
set history_length(to: number); | ||
/******** | ||
@@ -557,0 +642,0 @@ * |
// whargarbl lots of these return arrays could/should be sets | ||
import { reduce as reduce_to_639 } from 'reduce-to-639-1'; | ||
import { circular_buffer } from 'circular_buffer_js'; | ||
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, array_box_if_string, hook_name, named_hook_name } from './jssm_util'; | ||
@@ -537,3 +538,3 @@ import { shapes, gviz_shapes, named_colors } from './jssm_constants'; | ||
// whargarbl this badly needs to be broken up, monolith master | ||
constructor({ start_states, complete = [], transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble = undefined, arrange_declaration = [], arrange_start_declaration = [], arrange_end_declaration = [], theme = 'default', flow = 'down', graph_layout = 'dot', instance_name, data }) { | ||
constructor({ start_states, complete = [], transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble = undefined, arrange_declaration = [], arrange_start_declaration = [], arrange_end_declaration = [], theme = 'default', flow = 'down', graph_layout = 'dot', instance_name, history, data }) { | ||
this._instance_name = instance_name; | ||
@@ -586,2 +587,4 @@ this._state = start_states[0]; | ||
this._data = data; | ||
this._history_length = history || 0; | ||
this._history = new circular_buffer(this._history_length); | ||
if (state_declaration) { | ||
@@ -1431,2 +1434,5 @@ state_declaration.map((state_decl) => { | ||
// all hooks passed! let's now establish the result | ||
if (this._history_length) { | ||
this._history.shove([this._state, this._data]); | ||
} | ||
this._state = newState; | ||
@@ -1440,2 +1446,5 @@ if (data_changed) { | ||
else { | ||
if (this._history_length) { | ||
this._history.shove([this._state, this._data]); | ||
} | ||
this._state = newState; | ||
@@ -1450,2 +1459,95 @@ return true; | ||
} | ||
/********* | ||
* | ||
* Get a truncated history of the recent states and data of the machine. | ||
* Turned off by default; configure with `.from('...', {data: 5})` by length, | ||
* or set `.history_length` at runtime. | ||
* | ||
* History *does not contain the current state*. If you want that, call | ||
* `.history_inclusive` instead. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from( | ||
* "a 'next' -> b 'next' -> c 'next' -> d 'next' -> e;", | ||
* { history: 3 } | ||
* ); | ||
* | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* | ||
* foo.history; // [ ['b',undefined], ['c',undefined], ['d',undefined] ] | ||
* ``` | ||
* | ||
* Notice that the machine's current state, `e`, is not in the returned list. | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history() { | ||
return this._history.toArray(); | ||
} | ||
/********* | ||
* | ||
* Get a truncated history of the recent states and data of the machine, | ||
* including the current state. Turned off by default; configure with | ||
* `.from('...', {data: 5})` by length, or set `.history_length` at runtime. | ||
* | ||
* History inclusive contains the current state. If you only want past | ||
* states, call `.history` instead. | ||
* | ||
* The list returned will be one longer than the history buffer kept, as the | ||
* history buffer kept gets the current state added to it to produce this | ||
* list. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from( | ||
* "a 'next' -> b 'next' -> c 'next' -> d 'next' -> e;", | ||
* { history: 3 } | ||
* ); | ||
* | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* | ||
* foo.history_inclusive; // [ ['b',undefined], ['c',undefined], ['d',undefined], ['e',undefined] ] | ||
* ``` | ||
* | ||
* Notice that the machine's current state, `e`, is in the returned list. | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history_inclusive() { | ||
const ret = this._history.toArray(); | ||
ret.push([this.state(), this.data()]); | ||
return ret; | ||
} | ||
/********* | ||
* | ||
* Find out how long a history this machine is keeping. Defaults to zero. | ||
* Settable directly. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from("a -> b;"); | ||
* foo.history_length; // 0 | ||
* | ||
* const bar = jssm.from("a -> b;", { history: 3 }); | ||
* foo.history_length; // 3 | ||
* foo.history_length = 5; | ||
* foo.history_length; // 5 | ||
* ``` | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history_length() { | ||
return this._history_length; | ||
} | ||
set history_length(to) { | ||
this._history_length = to; | ||
this._history.resize(to, true); | ||
} | ||
/******** | ||
@@ -1452,0 +1554,0 @@ * |
@@ -1,2 +0,2 @@ | ||
const version = "5.72.5"; | ||
const version = "5.73.0"; | ||
export { version }; |
@@ -105,2 +105,3 @@ declare type StateType = string; | ||
check?: JssmStatePermitterMaybeArray<DataType>; | ||
history?: number; | ||
min_exits?: number; | ||
@@ -107,0 +108,0 @@ max_exits?: number; |
declare type StateType = string; | ||
import { circular_buffer } from 'circular_buffer_js'; | ||
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule, | ||
@@ -236,3 +237,5 @@ JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types'; | ||
_any_transition_hook: HookHandler<mDT> | undefined; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, data }: JssmGenericConfig<mDT>); | ||
_history: circular_buffer<[StateType, mDT]>; | ||
_history_length: number; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data }: JssmGenericConfig<mDT>); | ||
/******** | ||
@@ -555,2 +558,84 @@ * | ||
transition_impl(newStateOrAction: StateType, newData: mDT | undefined, wasForced: boolean, wasAction: boolean): boolean; | ||
/********* | ||
* | ||
* Get a truncated history of the recent states and data of the machine. | ||
* Turned off by default; configure with `.from('...', {data: 5})` by length, | ||
* or set `.history_length` at runtime. | ||
* | ||
* History *does not contain the current state*. If you want that, call | ||
* `.history_inclusive` instead. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from( | ||
* "a 'next' -> b 'next' -> c 'next' -> d 'next' -> e;", | ||
* { history: 3 } | ||
* ); | ||
* | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* | ||
* foo.history; // [ ['b',undefined], ['c',undefined], ['d',undefined] ] | ||
* ``` | ||
* | ||
* Notice that the machine's current state, `e`, is not in the returned list. | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history(): [string, mDT][]; | ||
/********* | ||
* | ||
* Get a truncated history of the recent states and data of the machine, | ||
* including the current state. Turned off by default; configure with | ||
* `.from('...', {data: 5})` by length, or set `.history_length` at runtime. | ||
* | ||
* History inclusive contains the current state. If you only want past | ||
* states, call `.history` instead. | ||
* | ||
* The list returned will be one longer than the history buffer kept, as the | ||
* history buffer kept gets the current state added to it to produce this | ||
* list. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from( | ||
* "a 'next' -> b 'next' -> c 'next' -> d 'next' -> e;", | ||
* { history: 3 } | ||
* ); | ||
* | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* foo.action('next'); | ||
* | ||
* foo.history_inclusive; // [ ['b',undefined], ['c',undefined], ['d',undefined], ['e',undefined] ] | ||
* ``` | ||
* | ||
* Notice that the machine's current state, `e`, is in the returned list. | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history_inclusive(): [string, mDT][]; | ||
/********* | ||
* | ||
* Find out how long a history this machine is keeping. Defaults to zero. | ||
* Settable directly. | ||
* | ||
* ```typescript | ||
* const foo = jssm.from("a -> b;"); | ||
* foo.history_length; // 0 | ||
* | ||
* const bar = jssm.from("a -> b;", { history: 3 }); | ||
* foo.history_length; // 3 | ||
* foo.history_length = 5; | ||
* foo.history_length; // 5 | ||
* ``` | ||
* | ||
* @typeparam mDT The type of the machine data member; usually omitted | ||
* | ||
*/ | ||
get history_length(): number; | ||
set history_length(to: number); | ||
/******** | ||
@@ -557,0 +642,0 @@ * |
{ | ||
"name": "jssm", | ||
"version": "5.72.5", | ||
"version": "5.73.0", | ||
"engines": { | ||
@@ -113,2 +113,3 @@ "node": ">=10.0.0" | ||
"benny": "^3.7.1", | ||
"circular_buffer_js": "^1.10.0", | ||
"coveralls": "^3.0.11", | ||
@@ -115,0 +116,0 @@ "eslint": "^7.32.0", |
@@ -21,3 +21,3 @@ <!-- | ||
* Generated for version 5.72.5 at 6/25/2022, 10:53:38 AM | ||
* Generated for version 5.73.0 at 6/27/2022, 2:27:29 AM | ||
@@ -29,3 +29,3 @@ --> | ||
tests. Fuzz tests. Language tests for a dozen languages and emoji. Easy to | ||
share online. Easy to embed. ***4,611 tests***. | ||
share online. Easy to embed. ***4,617 tests***. | ||
@@ -32,0 +32,0 @@ Readable, useful state machines as one-liner strings. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1031071
7424
28