@thi.ng/csp 3.2.11 → 3.2.13
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 +8 -1
- package/README.md +1 -1
- package/ops.d.ts +13 -5
- package/ops.js +5 -11
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-10-17T15:38:52Z
|
|
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.
|
|
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [3.2.13](https://github.com/thi-ng/umbrella/tree/@thi.ng/csp@3.2.13) (2024-10-17)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- undeprecate `into()`, refactor `pipe()` ([c8788d9](https://github.com/thi-ng/umbrella/commit/c8788d9))
|
|
17
|
+
- update docstrings
|
|
18
|
+
|
|
12
19
|
### [3.2.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/csp@3.2.2) (2024-06-21)
|
|
13
20
|
|
|
14
21
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
package/ops.d.ts
CHANGED
|
@@ -42,15 +42,23 @@ export declare const drain: <T>(chan: Channel<T>) => Promise<Awaited<T>[]>;
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const fromAsyncIterable: <T>(src: AsyncIterable<T>, close?: boolean) => Channel<T>;
|
|
44
44
|
export declare const merge: <T>(src: Channel<T>[], dest?: Channel<T>, close?: boolean) => Channel<T>;
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated use {@link pipe} instead.
|
|
47
|
-
*/
|
|
48
|
-
export declare const into: <T, DEST extends IWriteable<T> & IClosable>(chan: DEST, src: Iterable<T> | AsyncIterable<T>, close?: boolean) => Promise<void>;
|
|
49
45
|
/**
|
|
50
46
|
* Receives values from `src` and writes them to `dest` for as long as it's
|
|
51
47
|
* accepting new writes (i.e. isn't closed from elsewhere). If `close` is true
|
|
52
48
|
* (default), the `dest` channel will be automatically closed once the `src` is
|
|
53
|
-
* exhausted. Returns
|
|
49
|
+
* exhausted. Returns a void-promise which resolves once done.
|
|
50
|
+
*
|
|
51
|
+
* @param dest
|
|
52
|
+
* @param src
|
|
53
|
+
* @param close
|
|
54
|
+
*/
|
|
55
|
+
export declare const into: <T, DEST extends IWriteable<T> & IClosable>(dest: DEST, src: Iterable<T> | AsyncIterable<T>, close?: boolean) => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Similar to {@link into} (and also calls that function asynchronously), but
|
|
58
|
+
* `pipe()` itself is synchronous and returns `dest` channel immediatedly.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Also note different argument order!
|
|
54
62
|
*
|
|
55
63
|
* @param src
|
|
56
64
|
* @param dest
|
package/ops.js
CHANGED
|
@@ -58,21 +58,15 @@ const merge = (src, dest, close = true) => {
|
|
|
58
58
|
})();
|
|
59
59
|
return dest;
|
|
60
60
|
};
|
|
61
|
-
const into = async (
|
|
61
|
+
const into = async (dest, src, close = false) => {
|
|
62
62
|
for await (let x of src) {
|
|
63
|
-
if (!
|
|
64
|
-
await
|
|
63
|
+
if (!dest.writable()) break;
|
|
64
|
+
await dest.write(x);
|
|
65
65
|
}
|
|
66
|
-
close &&
|
|
66
|
+
close && dest.close();
|
|
67
67
|
};
|
|
68
68
|
const pipe = (src, dest, close = true) => {
|
|
69
|
-
(
|
|
70
|
-
for await (let x of src) {
|
|
71
|
-
await dest.write(x);
|
|
72
|
-
if (!dest.writable()) break;
|
|
73
|
-
}
|
|
74
|
-
close && dest.close();
|
|
75
|
-
})();
|
|
69
|
+
into(dest, src, close);
|
|
76
70
|
return dest;
|
|
77
71
|
};
|
|
78
72
|
const select = async (input, ...rest) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/csp",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.13",
|
|
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",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.11.
|
|
44
|
-
"@thi.ng/buffers": "^0.1.
|
|
45
|
-
"@thi.ng/checks": "^3.6.
|
|
46
|
-
"@thi.ng/errors": "^2.5.
|
|
43
|
+
"@thi.ng/api": "^8.11.11",
|
|
44
|
+
"@thi.ng/buffers": "^0.1.14",
|
|
45
|
+
"@thi.ng/checks": "^3.6.13",
|
|
46
|
+
"@thi.ng/errors": "^2.5.17"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@microsoft/api-extractor": "^7.47.9",
|
|
50
|
-
"esbuild": "^0.
|
|
50
|
+
"esbuild": "^0.24.0",
|
|
51
51
|
"typedoc": "^0.26.7",
|
|
52
52
|
"typescript": "^5.6.2"
|
|
53
53
|
},
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"status": "beta",
|
|
107
107
|
"year": 2016
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "8301254c4436505a1fb0e3cc28eca3adb920c3e0\n"
|
|
110
110
|
}
|