@thi.ng/rstream-graph 4.1.204 → 4.1.205
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 +1 -1
- package/graph.js +6 -6
- package/nodes/math.js +2 -2
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 211 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/graph.js
CHANGED
|
@@ -10,7 +10,7 @@ import { fromViewUnsafe } from "@thi.ng/rstream/view";
|
|
|
10
10
|
import { map } from "@thi.ng/transducers/map";
|
|
11
11
|
const initGraph = (state, spec) => {
|
|
12
12
|
const res = {};
|
|
13
|
-
for (
|
|
13
|
+
for (const id in spec) {
|
|
14
14
|
const n = spec[id];
|
|
15
15
|
res[id] = __isNodeSpec(n) ? nodeFromSpec(state, n, id) : n;
|
|
16
16
|
}
|
|
@@ -26,7 +26,7 @@ const nodeFromSpec = (state, spec, id) => (resolve2) => {
|
|
|
26
26
|
const __prepareNodeInputs = (ins, state, resolve2) => {
|
|
27
27
|
const res = {};
|
|
28
28
|
if (!ins) return res;
|
|
29
|
-
for (
|
|
29
|
+
for (const id in ins) {
|
|
30
30
|
const i = ins[id];
|
|
31
31
|
const src = __getNodeInput(i, id, state, resolve2);
|
|
32
32
|
res[id] = i.xform ? src.transform(i.xform, { id }) : src;
|
|
@@ -39,7 +39,7 @@ const __getNodeInput = (i, id, state, resolve2) => i.path ? fromViewUnsafe(state
|
|
|
39
39
|
const __prepareNodeOutputs = (outs, node3, state, nodeID) => {
|
|
40
40
|
const res = {};
|
|
41
41
|
if (!outs) return res;
|
|
42
|
-
for (
|
|
42
|
+
for (const id in outs) {
|
|
43
43
|
const out = outs[id];
|
|
44
44
|
res[id] = isFunction(out) ? out(node3, id) : id == "*" ? __nodeOutAll(node3, state, nodeID, out) : __nodeOutID(node3, state, nodeID, out, id);
|
|
45
45
|
}
|
|
@@ -72,7 +72,7 @@ const removeNode = (graph, id) => {
|
|
|
72
72
|
const node3 = graph[id];
|
|
73
73
|
if (node3) {
|
|
74
74
|
node3.node.unsubscribe();
|
|
75
|
-
for (
|
|
75
|
+
for (const id2 in node3.outs) {
|
|
76
76
|
node3.outs[id2].unsubscribe();
|
|
77
77
|
}
|
|
78
78
|
delete graph[id];
|
|
@@ -81,7 +81,7 @@ const removeNode = (graph, id) => {
|
|
|
81
81
|
return false;
|
|
82
82
|
};
|
|
83
83
|
const stop = (graph) => {
|
|
84
|
-
for (
|
|
84
|
+
for (const id in graph) {
|
|
85
85
|
graph[id].node.unsubscribe();
|
|
86
86
|
}
|
|
87
87
|
};
|
|
@@ -97,7 +97,7 @@ const node2 = (xform, inputIDs = ["a", "b"], reset = false) => node(xform, input
|
|
|
97
97
|
const ensureInputs = (src, inputIDs, nodeID) => {
|
|
98
98
|
if (inputIDs) {
|
|
99
99
|
const missing = [];
|
|
100
|
-
for (
|
|
100
|
+
for (const i of inputIDs) {
|
|
101
101
|
!src[i] && missing.push(i);
|
|
102
102
|
}
|
|
103
103
|
missing.length && illegalArgs(
|
package/nodes/math.js
CHANGED
|
@@ -4,7 +4,7 @@ const add = node(
|
|
|
4
4
|
map((ports) => {
|
|
5
5
|
let acc = 0;
|
|
6
6
|
let v;
|
|
7
|
-
for (
|
|
7
|
+
for (const p in ports) {
|
|
8
8
|
if ((v = ports[p]) == null) return;
|
|
9
9
|
acc += v;
|
|
10
10
|
}
|
|
@@ -15,7 +15,7 @@ const mul = node(
|
|
|
15
15
|
map((ports) => {
|
|
16
16
|
let acc = 1;
|
|
17
17
|
let v;
|
|
18
|
-
for (
|
|
18
|
+
for (const p in ports) {
|
|
19
19
|
if ((v = ports[p]) == null) return;
|
|
20
20
|
acc *= v;
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rstream-graph",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.205",
|
|
4
4
|
"description": "Declarative dataflow graph construction for @thi.ng/rstream",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/atom": "^5.3.
|
|
44
|
-
"@thi.ng/checks": "^3.
|
|
45
|
-
"@thi.ng/errors": "^2.5.
|
|
46
|
-
"@thi.ng/paths": "^5.2.
|
|
47
|
-
"@thi.ng/resolve-map": "^7.1.
|
|
48
|
-
"@thi.ng/rstream": "^9.3.
|
|
49
|
-
"@thi.ng/transducers": "^9.6.
|
|
42
|
+
"@thi.ng/api": "^8.12.10",
|
|
43
|
+
"@thi.ng/atom": "^5.3.51",
|
|
44
|
+
"@thi.ng/checks": "^3.8.0",
|
|
45
|
+
"@thi.ng/errors": "^2.5.50",
|
|
46
|
+
"@thi.ng/paths": "^5.2.29",
|
|
47
|
+
"@thi.ng/resolve-map": "^7.1.122",
|
|
48
|
+
"@thi.ng/rstream": "^9.3.8",
|
|
49
|
+
"@thi.ng/transducers": "^9.6.19"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"esbuild": "^0.27.0",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
],
|
|
105
105
|
"year": 2018
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
|
|
108
108
|
}
|