@thi.ng/csp 3.3.8 → 3.3.9
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/mult.js +2 -2
- package/ops.js +4 -4
- package/package.json +7 -7
- package/pubsub.js +1 -1
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/mult.js
CHANGED
|
@@ -83,14 +83,14 @@ class Mult {
|
|
|
83
83
|
*/
|
|
84
84
|
unsubscribeAll(close = true) {
|
|
85
85
|
if (close) {
|
|
86
|
-
for (
|
|
86
|
+
for (const t of this.taps) t.close();
|
|
87
87
|
}
|
|
88
88
|
this.taps.length = 0;
|
|
89
89
|
}
|
|
90
90
|
async process() {
|
|
91
91
|
let x;
|
|
92
92
|
while ((x = await this.src.read()) !== void 0) {
|
|
93
|
-
for (
|
|
93
|
+
for (const t of this.taps) {
|
|
94
94
|
if (!await t.write(x)) {
|
|
95
95
|
this.unsubscribe(t);
|
|
96
96
|
}
|
package/ops.js
CHANGED
|
@@ -3,15 +3,15 @@ import { assert } from "@thi.ng/errors/assert";
|
|
|
3
3
|
import { Channel } from "./channel.js";
|
|
4
4
|
const broadcast = async (src, dest, close = true) => {
|
|
5
5
|
for await (let x of src) {
|
|
6
|
-
for (
|
|
6
|
+
for (const chan of dest) chan.write(x);
|
|
7
7
|
}
|
|
8
8
|
if (close) {
|
|
9
|
-
for (
|
|
9
|
+
for (const chan of dest) chan.close();
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
const concat = async (dest, chans, close = true) => {
|
|
13
13
|
return (async () => {
|
|
14
|
-
for (
|
|
14
|
+
for (const c of chans) {
|
|
15
15
|
await consumeWith(c, (x) => dest.write(x));
|
|
16
16
|
}
|
|
17
17
|
close && dest.close();
|
|
@@ -73,7 +73,7 @@ const pipe = (src, dest, close = true) => {
|
|
|
73
73
|
const select = async (input, ...rest) => {
|
|
74
74
|
const inputs = shuffle([input, ...rest]);
|
|
75
75
|
const sel = await Promise.race(inputs.map((x) => x.race()));
|
|
76
|
-
for (
|
|
76
|
+
for (const chan of inputs) {
|
|
77
77
|
if (chan !== sel) chan.races.shift();
|
|
78
78
|
}
|
|
79
79
|
if (sel.writes.readable()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/csp",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.9",
|
|
4
4
|
"description": "Primitives & operators for Communicating Sequential Processes based on async/await and async iterables",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@thi.ng/api": "^8.12.
|
|
47
|
-
"@thi.ng/arrays": "^2.14.
|
|
48
|
-
"@thi.ng/buffers": "^1.0.
|
|
49
|
-
"@thi.ng/checks": "^3.
|
|
50
|
-
"@thi.ng/errors": "^2.5.
|
|
46
|
+
"@thi.ng/api": "^8.12.10",
|
|
47
|
+
"@thi.ng/arrays": "^2.14.3",
|
|
48
|
+
"@thi.ng/buffers": "^1.0.29",
|
|
49
|
+
"@thi.ng/checks": "^3.8.0",
|
|
50
|
+
"@thi.ng/errors": "^2.5.50"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"esbuild": "^0.27.0",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"status": "beta",
|
|
110
110
|
"year": 2016
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
|
|
113
113
|
}
|