jssm 5.85.7 → 5.85.8

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/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- 1054 merges; 167 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)
5
+ 1055 merges; 167 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)
6
6
 
7
7
 
8
8
 
@@ -18,6 +18,22 @@ Published tags:
18
18
 
19
19
 
20
20
 
21
+  
22
+
23
+  
24
+
25
+ ## [Untagged] - 9/12/2022 7:19:21 PM
26
+
27
+ Commit [771f4c8d67274b40451ae6dfef168fe3c15949df](https://github.com/StoneCypher/jssm/commit/771f4c8d67274b40451ae6dfef168fe3c15949df)
28
+
29
+ Author: `John Haugeland <stonecypher@gmail.com>`
30
+
31
+ * Add tests for unicode labels (atom and string)
32
+ * Fixes StoneCypher/fsl#1193, fixes StoneCypher/fsl#1194
33
+
34
+
35
+
36
+
21
37
  &nbsp;
22
38
 
23
39
  &nbsp;
@@ -163,19 +179,4 @@ Author: `John Haugeland <stonecypher@gmail.com>`
163
179
  Merges [461a287, 0f3025a]
164
180
 
165
181
  * Merge pull request #539 from StoneCypher/TrimTweet
166
- * Shorten the tweet notice
167
-
168
-
169
-
170
-
171
- &nbsp;
172
-
173
- &nbsp;
174
-
175
- ## [Untagged] - 9/12/2022 9:59:52 AM
176
-
177
- Commit [0f3025ae2e484afbda57b5f39f5485c4831e7ce7](https://github.com/StoneCypher/jssm/commit/0f3025ae2e484afbda57b5f39f5485c4831e7ce7)
178
-
179
- Author: `John Haugeland <stonecypher@gmail.com>`
180
-
181
182
  * Shorten the tweet notice
package/README.md CHANGED
@@ -18,7 +18,7 @@ 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.85.7 at 9/12/2022, 7:17:57 PM
21
+ * Generated for version 5.85.8 at 9/12/2022, 8:16:52 PM
22
22
 
23
23
  -->
24
24
  # jssm
@@ -29,7 +29,7 @@ share online. Easy to embed.
29
29
 
30
30
  Readable, useful state machines as one-liner strings.
31
31
 
32
- ***4,864 tests*** run 5,755 times. 4,855 specs with 100.0% coverage, 9 fuzz tests with 13.0% coverage. With 2,714 lines, that's about 1.8 tests per line, or 2.1 generated tests per line.
32
+ ***4,864 tests*** run 5,755 times. 4,855 specs with 100.0% coverage, 9 fuzz tests with 13.2% coverage. With 2,725 lines, that's about 1.8 tests per line, or 2.1 generated tests per line.
33
33
 
34
34
  ***Meet your new state machine library.***
35
35
 
@@ -1,61 +1,11 @@
1
1
  declare type StateType = string;
2
2
  import { JssmGenericState, JssmGenericConfig, JssmStateConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
3
- JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmStateStyleKeyList, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslDirections, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types';
3
+ JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmStateStyleKeyList, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslDirections, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types';
4
+ import { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow';
4
5
  import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
5
6
  import * as constants from './jssm_constants';
6
7
  declare const shapes: string[], gviz_shapes: string[], named_colors: string[];
7
8
  import { version, build_time } from './version';
8
- /*********
9
- *
10
- * Return the direction of an arrow - `right`, `left`, or `both`.
11
- *
12
- * ```typescript
13
- * import { arrow_direction } from 'jssm';
14
- *
15
- * arrow_direction('->'); // 'right'
16
- * arrow_direction('<~=>'); // 'both'
17
- * ```
18
- *
19
- * @param arrow The arrow to be evaluated
20
- *
21
- */
22
- declare function arrow_direction(arrow: JssmArrow): JssmArrowDirection;
23
- /*********
24
- *
25
- * Return the direction of an arrow - `right`, `left`, or `both`.
26
- *
27
- * ```typescript
28
- * import { arrow_left_kind } from 'jssm';
29
- *
30
- * arrow_left_kind('<-'); // 'legal'
31
- * arrow_left_kind('<='); // 'main'
32
- * arrow_left_kind('<~'); // 'forced'
33
- * arrow_left_kind('<->'); // 'legal'
34
- * arrow_left_kind('->'); // 'none'
35
- * ```
36
- *
37
- * @param arrow The arrow to be evaluated
38
- *
39
- */
40
- declare function arrow_left_kind(arrow: JssmArrow): JssmArrowKind;
41
- /*********
42
- *
43
- * Return the direction of an arrow - `right`, `left`, or `both`.
44
- *
45
- * ```typescript
46
- * import { arrow_left_kind } from 'jssm';
47
- *
48
- * arrow_left_kind('->'); // 'legal'
49
- * arrow_left_kind('=>'); // 'main'
50
- * arrow_left_kind('~>'); // 'forced'
51
- * arrow_left_kind('<->'); // 'legal'
52
- * arrow_left_kind('<-'); // 'none'
53
- * ```
54
- *
55
- * @param arrow The arrow to be evaluated
56
- *
57
- */
58
- declare function arrow_right_kind(arrow: JssmArrow): JssmArrowKind;
59
9
  /*********
60
10
  *
61
11
  * This method wraps the parser call that comes from the peg grammar,
package/dist/es6/jssm.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { reduce as reduce_to_639 } from 'reduce-to-639-1';
3
3
  import { circular_buffer } from 'circular_buffer_js';
4
4
  import { FslDirections } from './jssm_types';
5
+ import { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow';
5
6
  import { base_theme } from './themes/jssm_base_stylesheet';
6
7
  import { default_theme } from './themes/jssm_theme_default';
7
8
  import { modern_theme } from './themes/jssm_theme_modern';
@@ -20,191 +21,6 @@ const { shapes, gviz_shapes, named_colors } = constants;
20
21
  import { parse } from './fsl_parser';
21
22
  import { version, build_time } from './version'; // replaced from package.js in build
22
23
  import { JssmError } from './jssm_error';
23
- /* eslint-disable complexity */
24
- /*********
25
- *
26
- * Return the direction of an arrow - `right`, `left`, or `both`.
27
- *
28
- * ```typescript
29
- * import { arrow_direction } from 'jssm';
30
- *
31
- * arrow_direction('->'); // 'right'
32
- * arrow_direction('<~=>'); // 'both'
33
- * ```
34
- *
35
- * @param arrow The arrow to be evaluated
36
- *
37
- */
38
- function arrow_direction(arrow) {
39
- switch (String(arrow)) {
40
- case '->':
41
- case '→':
42
- case '=>':
43
- case '⇒':
44
- case '~>':
45
- case '↛':
46
- return 'right';
47
- case '<-':
48
- case '←':
49
- case '<=':
50
- case '⇐':
51
- case '<~':
52
- case '↚':
53
- return 'left';
54
- case '<->':
55
- case '↔':
56
- case '<-=>':
57
- case '←⇒':
58
- case '←=>':
59
- case '<-⇒':
60
- case '<-~>':
61
- case '←↛':
62
- case '←~>':
63
- case '<-↛':
64
- case '<=>':
65
- case '⇔':
66
- case '<=->':
67
- case '⇐→':
68
- case '⇐->':
69
- case '<=→':
70
- case '<=~>':
71
- case '⇐↛':
72
- case '⇐~>':
73
- case '<=↛':
74
- case '<~>':
75
- case '↮':
76
- case '<~->':
77
- case '↚→':
78
- case '↚->':
79
- case '<~→':
80
- case '<~=>':
81
- case '↚⇒':
82
- case '↚=>':
83
- case '<~⇒':
84
- return 'both';
85
- default:
86
- throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
87
- }
88
- }
89
- /* eslint-enable complexity */
90
- /* eslint-disable complexity */
91
- /*********
92
- *
93
- * Return the direction of an arrow - `right`, `left`, or `both`.
94
- *
95
- * ```typescript
96
- * import { arrow_left_kind } from 'jssm';
97
- *
98
- * arrow_left_kind('<-'); // 'legal'
99
- * arrow_left_kind('<='); // 'main'
100
- * arrow_left_kind('<~'); // 'forced'
101
- * arrow_left_kind('<->'); // 'legal'
102
- * arrow_left_kind('->'); // 'none'
103
- * ```
104
- *
105
- * @param arrow The arrow to be evaluated
106
- *
107
- */
108
- function arrow_left_kind(arrow) {
109
- switch (String(arrow)) {
110
- case '->':
111
- case '→':
112
- case '=>':
113
- case '⇒':
114
- case '~>':
115
- case '↛':
116
- return 'none';
117
- case '<-':
118
- case '←':
119
- case '<->':
120
- case '↔':
121
- case '<-=>':
122
- case '←⇒':
123
- case '<-~>':
124
- case '←↛':
125
- return 'legal';
126
- case '<=':
127
- case '⇐':
128
- case '<=>':
129
- case '⇔':
130
- case '<=->':
131
- case '⇐→':
132
- case '<=~>':
133
- case '⇐↛':
134
- return 'main';
135
- case '<~':
136
- case '↚':
137
- case '<~>':
138
- case '↮':
139
- case '<~->':
140
- case '↚→':
141
- case '<~=>':
142
- case '↚⇒':
143
- return 'forced';
144
- default:
145
- throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
146
- }
147
- }
148
- /* eslint-enable complexity */
149
- /* eslint-disable complexity */
150
- /*********
151
- *
152
- * Return the direction of an arrow - `right`, `left`, or `both`.
153
- *
154
- * ```typescript
155
- * import { arrow_left_kind } from 'jssm';
156
- *
157
- * arrow_left_kind('->'); // 'legal'
158
- * arrow_left_kind('=>'); // 'main'
159
- * arrow_left_kind('~>'); // 'forced'
160
- * arrow_left_kind('<->'); // 'legal'
161
- * arrow_left_kind('<-'); // 'none'
162
- * ```
163
- *
164
- * @param arrow The arrow to be evaluated
165
- *
166
- */
167
- function arrow_right_kind(arrow) {
168
- switch (String(arrow)) {
169
- case '<-':
170
- case '←':
171
- case '<=':
172
- case '⇐':
173
- case '<~':
174
- case '↚':
175
- return 'none';
176
- case '->':
177
- case '→':
178
- case '<->':
179
- case '↔':
180
- case '<=->':
181
- case '⇐→':
182
- case '<~->':
183
- case '↚→':
184
- return 'legal';
185
- case '=>':
186
- case '⇒':
187
- case '<=>':
188
- case '⇔':
189
- case '<-=>':
190
- case '←⇒':
191
- case '<~=>':
192
- case '↚⇒':
193
- return 'main';
194
- case '~>':
195
- case '↛':
196
- case '<~>':
197
- case '↮':
198
- case '<-~>':
199
- case '←↛':
200
- case '<=~>':
201
- case '⇐↛':
202
- return 'forced';
203
- default:
204
- throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
205
- }
206
- }
207
- /* eslint-enable complexity */
208
24
  /*********
209
25
  *
210
26
  * Internal method meant to perform factory assembly of an edge. Not meant for
@@ -0,0 +1,53 @@
1
+ import { JssmArrow, JssmArrowDirection, JssmArrowKind } from './jssm_types';
2
+ /*********
3
+ *
4
+ * Return the direction of an arrow - `right`, `left`, or `both`.
5
+ *
6
+ * ```typescript
7
+ * import { arrow_direction } from 'jssm';
8
+ *
9
+ * arrow_direction('->'); // 'right'
10
+ * arrow_direction('<~=>'); // 'both'
11
+ * ```
12
+ *
13
+ * @param arrow The arrow to be evaluated
14
+ *
15
+ */
16
+ declare function arrow_direction(arrow: JssmArrow): JssmArrowDirection;
17
+ /*********
18
+ *
19
+ * Return the direction of an arrow - `right`, `left`, or `both`.
20
+ *
21
+ * ```typescript
22
+ * import { arrow_left_kind } from 'jssm';
23
+ *
24
+ * arrow_left_kind('<-'); // 'legal'
25
+ * arrow_left_kind('<='); // 'main'
26
+ * arrow_left_kind('<~'); // 'forced'
27
+ * arrow_left_kind('<->'); // 'legal'
28
+ * arrow_left_kind('->'); // 'none'
29
+ * ```
30
+ *
31
+ * @param arrow The arrow to be evaluated
32
+ *
33
+ */
34
+ declare function arrow_left_kind(arrow: JssmArrow): JssmArrowKind;
35
+ /*********
36
+ *
37
+ * Return the direction of an arrow - `right`, `left`, or `both`.
38
+ *
39
+ * ```typescript
40
+ * import { arrow_left_kind } from 'jssm';
41
+ *
42
+ * arrow_left_kind('->'); // 'legal'
43
+ * arrow_left_kind('=>'); // 'main'
44
+ * arrow_left_kind('~>'); // 'forced'
45
+ * arrow_left_kind('<->'); // 'legal'
46
+ * arrow_left_kind('<-'); // 'none'
47
+ * ```
48
+ *
49
+ * @param arrow The arrow to be evaluated
50
+ *
51
+ */
52
+ declare function arrow_right_kind(arrow: JssmArrow): JssmArrowKind;
53
+ export { arrow_direction, arrow_left_kind, arrow_right_kind };
@@ -0,0 +1,187 @@
1
+ import { JssmError } from './jssm_error';
2
+ /* eslint-disable complexity */
3
+ /*********
4
+ *
5
+ * Return the direction of an arrow - `right`, `left`, or `both`.
6
+ *
7
+ * ```typescript
8
+ * import { arrow_direction } from 'jssm';
9
+ *
10
+ * arrow_direction('->'); // 'right'
11
+ * arrow_direction('<~=>'); // 'both'
12
+ * ```
13
+ *
14
+ * @param arrow The arrow to be evaluated
15
+ *
16
+ */
17
+ function arrow_direction(arrow) {
18
+ switch (String(arrow)) {
19
+ case '->':
20
+ case '→':
21
+ case '=>':
22
+ case '⇒':
23
+ case '~>':
24
+ case '↛':
25
+ return 'right';
26
+ case '<-':
27
+ case '←':
28
+ case '<=':
29
+ case '⇐':
30
+ case '<~':
31
+ case '↚':
32
+ return 'left';
33
+ case '<->':
34
+ case '↔':
35
+ case '<-=>':
36
+ case '←⇒':
37
+ case '←=>':
38
+ case '<-⇒':
39
+ case '<-~>':
40
+ case '←↛':
41
+ case '←~>':
42
+ case '<-↛':
43
+ case '<=>':
44
+ case '⇔':
45
+ case '<=->':
46
+ case '⇐→':
47
+ case '⇐->':
48
+ case '<=→':
49
+ case '<=~>':
50
+ case '⇐↛':
51
+ case '⇐~>':
52
+ case '<=↛':
53
+ case '<~>':
54
+ case '↮':
55
+ case '<~->':
56
+ case '↚→':
57
+ case '↚->':
58
+ case '<~→':
59
+ case '<~=>':
60
+ case '↚⇒':
61
+ case '↚=>':
62
+ case '<~⇒':
63
+ return 'both';
64
+ default:
65
+ throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
66
+ }
67
+ }
68
+ /* eslint-enable complexity */
69
+ /* eslint-disable complexity */
70
+ /*********
71
+ *
72
+ * Return the direction of an arrow - `right`, `left`, or `both`.
73
+ *
74
+ * ```typescript
75
+ * import { arrow_left_kind } from 'jssm';
76
+ *
77
+ * arrow_left_kind('<-'); // 'legal'
78
+ * arrow_left_kind('<='); // 'main'
79
+ * arrow_left_kind('<~'); // 'forced'
80
+ * arrow_left_kind('<->'); // 'legal'
81
+ * arrow_left_kind('->'); // 'none'
82
+ * ```
83
+ *
84
+ * @param arrow The arrow to be evaluated
85
+ *
86
+ */
87
+ function arrow_left_kind(arrow) {
88
+ switch (String(arrow)) {
89
+ case '->':
90
+ case '→':
91
+ case '=>':
92
+ case '⇒':
93
+ case '~>':
94
+ case '↛':
95
+ return 'none';
96
+ case '<-':
97
+ case '←':
98
+ case '<->':
99
+ case '↔':
100
+ case '<-=>':
101
+ case '←⇒':
102
+ case '<-~>':
103
+ case '←↛':
104
+ return 'legal';
105
+ case '<=':
106
+ case '⇐':
107
+ case '<=>':
108
+ case '⇔':
109
+ case '<=->':
110
+ case '⇐→':
111
+ case '<=~>':
112
+ case '⇐↛':
113
+ return 'main';
114
+ case '<~':
115
+ case '↚':
116
+ case '<~>':
117
+ case '↮':
118
+ case '<~->':
119
+ case '↚→':
120
+ case '<~=>':
121
+ case '↚⇒':
122
+ return 'forced';
123
+ default:
124
+ throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
125
+ }
126
+ }
127
+ /* eslint-enable complexity */
128
+ /* eslint-disable complexity */
129
+ /*********
130
+ *
131
+ * Return the direction of an arrow - `right`, `left`, or `both`.
132
+ *
133
+ * ```typescript
134
+ * import { arrow_left_kind } from 'jssm';
135
+ *
136
+ * arrow_left_kind('->'); // 'legal'
137
+ * arrow_left_kind('=>'); // 'main'
138
+ * arrow_left_kind('~>'); // 'forced'
139
+ * arrow_left_kind('<->'); // 'legal'
140
+ * arrow_left_kind('<-'); // 'none'
141
+ * ```
142
+ *
143
+ * @param arrow The arrow to be evaluated
144
+ *
145
+ */
146
+ function arrow_right_kind(arrow) {
147
+ switch (String(arrow)) {
148
+ case '<-':
149
+ case '←':
150
+ case '<=':
151
+ case '⇐':
152
+ case '<~':
153
+ case '↚':
154
+ return 'none';
155
+ case '->':
156
+ case '→':
157
+ case '<->':
158
+ case '↔':
159
+ case '<=->':
160
+ case '⇐→':
161
+ case '<~->':
162
+ case '↚→':
163
+ return 'legal';
164
+ case '=>':
165
+ case '⇒':
166
+ case '<=>':
167
+ case '⇔':
168
+ case '<-=>':
169
+ case '←⇒':
170
+ case '<~=>':
171
+ case '↚⇒':
172
+ return 'main';
173
+ case '~>':
174
+ case '↛':
175
+ case '<~>':
176
+ case '↮':
177
+ case '<-~>':
178
+ case '←↛':
179
+ case '<=~>':
180
+ case '⇐↛':
181
+ return 'forced';
182
+ default:
183
+ throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
184
+ }
185
+ }
186
+ /* eslint-enable complexity */
187
+ export { arrow_direction, arrow_left_kind, arrow_right_kind };
@@ -1,2 +1,2 @@
1
- const version = "5.85.7", build_time = 1663035398527;
1
+ const version = "5.85.8", build_time = 1663038933181;
2
2
  export { version, build_time };