@thi.ng/transducers-fsm 2.2.0 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-12-16T12:52:25Z
3
+ - **Last updated**: 2022-12-22T21:47:08Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -26,7 +26,7 @@ updated with new features.**
26
26
 
27
27
  ## About
28
28
 
29
- Transducer-based Finite State Machine transformer
29
+ Transducer-based Finite State Machine transformer. This is a support package for [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers).
30
30
 
31
31
  This package provides a single function, a general purpose [Finite State
32
32
  Machine](https://en.wikipedia.org/wiki/Finite-state_machine) transducer,
package/index.d.ts CHANGED
@@ -11,29 +11,27 @@ export interface FSMOpts<T extends FSMState, A, B> {
11
11
  init: Fn0<T>;
12
12
  }
13
13
  /**
14
- * Finite State Machine transducer. Takes an FSM configuration object
15
- * and returns a transducer, which processes inputs using the provided
16
- * state handler functions, which in turn can return any number of
17
- * outputs per consumed input.
14
+ * Finite State Machine transducer. Takes an FSM configuration object and
15
+ * returns a transducer, which processes inputs using the provided state handler
16
+ * functions, which in turn can return any number of outputs per consumed input.
18
17
  *
19
- * Before processing the first input, the FSM state is initialized by
20
- * calling the user provided `init()` function, which MUST return a
21
- * state object with at least a `state` key, whose value is used for
22
- * dynamic (i.e. stateful) dispatch during input processing. This state
23
- * object is passed with each input value to the current state handler,
24
- * which is expected to mutate this object, e.g. to cause state changes
25
- * based on given inputs.
18
+ * Before processing the first input, the FSM state is initialized by calling
19
+ * the user provided `init()` function, which MUST return a state object with at
20
+ * least a `state` key, whose value is used for dynamic (i.e. stateful) dispatch
21
+ * during input processing. This state object is passed with each input value to
22
+ * the current state handler, which is expected to mutate this object, e.g. to
23
+ * cause state changes based on given inputs.
26
24
  *
27
- * If a state handler needs to "emit" results for downstream processing,
28
- * it can return an array of values. Any such values are passed on
29
- * (individually, not as array) to the next reducer in the chain. If a
30
- * state handler returns `null` or `undefined`, further downstream
31
- * processing of the current input is skipped.
25
+ * If a state handler needs to "emit" results for downstream processing, it can
26
+ * return an array of values. Any such values are passed on (individually, not
27
+ * as array) to the next reducer in the chain. If a state handler returns `null`
28
+ * or `undefined`, further downstream processing of the current input is
29
+ * skipped.
32
30
  *
33
- * Regardless of return value, if a state handler has caused a state
34
- * change to the configured `terminal` state, processing is terminated
35
- * (by calling {@link @thi.ng/transducers#ensureReduced}) and no further
36
- * inputs will be consumed.
31
+ * Regardless of return value, if a state handler has caused a state change to
32
+ * the configured `terminal` state, processing is terminated (by calling
33
+ * [`ensureReduced()`](https://docs.thi.ng/umbrella/transducers/functions/ensureReduced.html))
34
+ * and no further inputs will be consumed.
37
35
  *
38
36
  * @example
39
37
  * ```ts
package/index.js CHANGED
@@ -1,29 +1,27 @@
1
1
  import { compR } from "@thi.ng/transducers/compr";
2
2
  import { ensureReduced, isReduced } from "@thi.ng/transducers/reduced";
3
3
  /**
4
- * Finite State Machine transducer. Takes an FSM configuration object
5
- * and returns a transducer, which processes inputs using the provided
6
- * state handler functions, which in turn can return any number of
7
- * outputs per consumed input.
4
+ * Finite State Machine transducer. Takes an FSM configuration object and
5
+ * returns a transducer, which processes inputs using the provided state handler
6
+ * functions, which in turn can return any number of outputs per consumed input.
8
7
  *
9
- * Before processing the first input, the FSM state is initialized by
10
- * calling the user provided `init()` function, which MUST return a
11
- * state object with at least a `state` key, whose value is used for
12
- * dynamic (i.e. stateful) dispatch during input processing. This state
13
- * object is passed with each input value to the current state handler,
14
- * which is expected to mutate this object, e.g. to cause state changes
15
- * based on given inputs.
8
+ * Before processing the first input, the FSM state is initialized by calling
9
+ * the user provided `init()` function, which MUST return a state object with at
10
+ * least a `state` key, whose value is used for dynamic (i.e. stateful) dispatch
11
+ * during input processing. This state object is passed with each input value to
12
+ * the current state handler, which is expected to mutate this object, e.g. to
13
+ * cause state changes based on given inputs.
16
14
  *
17
- * If a state handler needs to "emit" results for downstream processing,
18
- * it can return an array of values. Any such values are passed on
19
- * (individually, not as array) to the next reducer in the chain. If a
20
- * state handler returns `null` or `undefined`, further downstream
21
- * processing of the current input is skipped.
15
+ * If a state handler needs to "emit" results for downstream processing, it can
16
+ * return an array of values. Any such values are passed on (individually, not
17
+ * as array) to the next reducer in the chain. If a state handler returns `null`
18
+ * or `undefined`, further downstream processing of the current input is
19
+ * skipped.
22
20
  *
23
- * Regardless of return value, if a state handler has caused a state
24
- * change to the configured `terminal` state, processing is terminated
25
- * (by calling {@link @thi.ng/transducers#ensureReduced}) and no further
26
- * inputs will be consumed.
21
+ * Regardless of return value, if a state handler has caused a state change to
22
+ * the configured `terminal` state, processing is terminated (by calling
23
+ * [`ensureReduced()`](https://docs.thi.ng/umbrella/transducers/functions/ensureReduced.html))
24
+ * and no further inputs will be consumed.
27
25
  *
28
26
  * @example
29
27
  * ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/transducers-fsm",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Transducer-based Finite State Machine transformer",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,12 +34,12 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.6.0",
38
- "@thi.ng/transducers": "^8.3.26"
37
+ "@thi.ng/api": "^8.6.2",
38
+ "@thi.ng/transducers": "^8.3.28"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@microsoft/api-extractor": "^7.33.7",
42
- "@thi.ng/testament": "^0.3.7",
42
+ "@thi.ng/testament": "^0.3.8",
43
43
  "rimraf": "^3.0.2",
44
44
  "tools": "^0.0.1",
45
45
  "typedoc": "^0.23.22",
@@ -74,5 +74,5 @@
74
74
  "status": "completed",
75
75
  "year": 2018
76
76
  },
77
- "gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
77
+ "gitHead": "bc6f7f5e2765bb96fe64db804eaf4b2443b47fc6\n"
78
78
  }