@thi.ng/transducers 8.3.24 → 8.3.26
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 +1 -1
- package/README.md +10 -20
- package/api.d.ts +5 -5
- package/convolve.d.ts +3 -3
- package/flatten-with.d.ts +1 -1
- package/labeled.d.ts +1 -1
- package/package.json +19 -15
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/transducers)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -55,13 +55,11 @@ This project is part of the
|
|
|
55
55
|
- [Generators / Iterators](#generators--iterators)
|
|
56
56
|
- [Reducers](#reducers)
|
|
57
57
|
- [Authors](#authors)
|
|
58
|
-
- [Maintainer](#maintainer)
|
|
59
|
-
- [Contributors](#contributors)
|
|
60
58
|
- [License](#license)
|
|
61
59
|
|
|
62
60
|
## About
|
|
63
61
|
|
|
64
|
-
Lightweight transducer implementations for ES6 / TypeScript
|
|
62
|
+
Lightweight transducer implementations for ES6 / TypeScript
|
|
65
63
|
|
|
66
64
|
This library provides altogether ~130 transducers, reducers, sequence
|
|
67
65
|
generators (ES6 generators/iterators) and additional supporting
|
|
@@ -171,14 +169,11 @@ ES module import:
|
|
|
171
169
|
|
|
172
170
|
For Node.js REPL:
|
|
173
171
|
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
node --experimental-repl-await
|
|
177
|
-
|
|
178
|
-
> const transducers = await import("@thi.ng/transducers");
|
|
172
|
+
```js
|
|
173
|
+
const transducers = await import("@thi.ng/transducers");
|
|
179
174
|
```
|
|
180
175
|
|
|
181
|
-
Package sizes (
|
|
176
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 8.64 KB
|
|
182
177
|
|
|
183
178
|
## Dependencies
|
|
184
179
|
|
|
@@ -1006,14 +1001,9 @@ and return a reduced result (as if it would be called via `reduce()`).
|
|
|
1006
1001
|
|
|
1007
1002
|
## Authors
|
|
1008
1003
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
-
|
|
1012
|
-
|
|
1013
|
-
### Contributors
|
|
1014
|
-
|
|
1015
|
-
- Alberto ([@nkint](https://github.com/nkint))
|
|
1016
|
-
- Gavin Cannizzaro ([@gavinpc-mindgrub](https://github.com/gavinpc-mindgrub))
|
|
1004
|
+
- [Karsten Schmidt](https://thi.ng) (Main author)
|
|
1005
|
+
- [Gavin Cannizzaro](https://github.com/gavinpc-mindgrub)
|
|
1006
|
+
- [@nkint](https://github.com/nkint)
|
|
1017
1007
|
|
|
1018
1008
|
If this project contributes to an academic publication, please cite it as:
|
|
1019
1009
|
|
|
@@ -1028,4 +1018,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
1028
1018
|
|
|
1029
1019
|
## License
|
|
1030
1020
|
|
|
1031
|
-
© 2016 - 2022 Karsten Schmidt // Apache
|
|
1021
|
+
© 2016 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Comparator, Fn, IObjectOf } from "@thi.ng/api";
|
|
2
2
|
import type { Reduced } from "./reduced.js";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type Transducer<A, B> = (rfn: Reducer<any, B>) => Reducer<any, A>;
|
|
4
|
+
export type TxLike<A, B> = Transducer<A, B> | IXform<A, B>;
|
|
5
|
+
export type ReductionFn<A, B> = (acc: A, x: B) => A | Reduced<A>;
|
|
6
6
|
export interface Reducer<A, B> extends Array<any> {
|
|
7
7
|
[0]: () => A;
|
|
8
8
|
[1]: (acc: A) => A;
|
|
@@ -49,8 +49,8 @@ export interface IXform<A, B> {
|
|
|
49
49
|
export interface IReducible<A, B> {
|
|
50
50
|
$reduce(rfn: ReductionFn<A, B>, acc: A): A | Reduced<A>;
|
|
51
51
|
}
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type TransformFn = (x: any) => any;
|
|
53
|
+
export type TransformSubSpec = IObjectOf<TransformSpec | TransformFn>;
|
|
54
54
|
export interface TransformSpec extends Array<any> {
|
|
55
55
|
[0]: TransformFn;
|
|
56
56
|
[1]?: TransformSubSpec;
|
package/convolve.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Fn0 } from "@thi.ng/api";
|
|
2
2
|
import type { Reducer, Transducer } from "./api.js";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type ConvolutionKernel1D = [number, number][];
|
|
4
|
+
export type ConvolutionKernel2D = [number, [number, number]][];
|
|
5
|
+
export type ConvolutionKernel3D = [number, [number, number, number]][];
|
|
6
6
|
export interface ConvolutionOpts<K> {
|
|
7
7
|
/**
|
|
8
8
|
* Current cell states
|
package/flatten-with.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DeepArrayValue, Fn, Nullable } from "@thi.ng/api";
|
|
2
2
|
import type { Transducer } from "./api.js";
|
|
3
|
-
|
|
3
|
+
type MaybeIterable<T> = Nullable<Iterable<T>>;
|
|
4
4
|
/**
|
|
5
5
|
* Transducer. Takes a function `fn` which will be applied to each input
|
|
6
6
|
* value. If the function returns an ES6 Iterable, the result will be
|
package/labeled.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transducer } from "./api.js";
|
|
2
|
-
export
|
|
2
|
+
export type LabelFn<L, T> = L | ((x: T) => L);
|
|
3
3
|
export declare function labeled<L, T>(id: LabelFn<L, T>): Transducer<T, [L, T]>;
|
|
4
4
|
export declare function labeled<L, T>(id: LabelFn<L, T>, src: Iterable<T>): IterableIterator<[L, T]>;
|
|
5
5
|
//# sourceMappingURL=labeled.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/transducers",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.26",
|
|
4
4
|
"description": "Lightweight transducer implementations for ES6 / TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
|
+
"contributors": [
|
|
26
|
+
"Gavin Cannizzaro (https://github.com/gavinpc-mindgrub)",
|
|
27
|
+
"@nkint (https://github.com/nkint)"
|
|
28
|
+
],
|
|
25
29
|
"license": "Apache-2.0",
|
|
26
30
|
"scripts": {
|
|
27
31
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,22 +38,22 @@
|
|
|
34
38
|
"test": "testament test"
|
|
35
39
|
},
|
|
36
40
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/arrays": "^2.4.
|
|
39
|
-
"@thi.ng/checks": "^3.3.
|
|
40
|
-
"@thi.ng/compare": "^2.1.
|
|
41
|
-
"@thi.ng/compose": "^2.1.
|
|
42
|
-
"@thi.ng/errors": "^2.2.
|
|
43
|
-
"@thi.ng/math": "^5.3.
|
|
44
|
-
"@thi.ng/random": "^3.3.
|
|
41
|
+
"@thi.ng/api": "^8.6.0",
|
|
42
|
+
"@thi.ng/arrays": "^2.4.5",
|
|
43
|
+
"@thi.ng/checks": "^3.3.5",
|
|
44
|
+
"@thi.ng/compare": "^2.1.19",
|
|
45
|
+
"@thi.ng/compose": "^2.1.21",
|
|
46
|
+
"@thi.ng/errors": "^2.2.6",
|
|
47
|
+
"@thi.ng/math": "^5.3.16",
|
|
48
|
+
"@thi.ng/random": "^3.3.18"
|
|
45
49
|
},
|
|
46
50
|
"devDependencies": {
|
|
47
|
-
"@microsoft/api-extractor": "^7.33.
|
|
48
|
-
"@thi.ng/testament": "^0.3.
|
|
51
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
52
|
+
"@thi.ng/testament": "^0.3.7",
|
|
49
53
|
"rimraf": "^3.0.2",
|
|
50
54
|
"tools": "^0.0.1",
|
|
51
|
-
"typedoc": "^0.23.
|
|
52
|
-
"typescript": "^4.
|
|
55
|
+
"typedoc": "^0.23.22",
|
|
56
|
+
"typescript": "^4.9.4"
|
|
53
57
|
},
|
|
54
58
|
"keywords": [
|
|
55
59
|
"2d",
|
|
@@ -567,5 +571,5 @@
|
|
|
567
571
|
],
|
|
568
572
|
"year": 2016
|
|
569
573
|
},
|
|
570
|
-
"gitHead": "
|
|
574
|
+
"gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
|
|
571
575
|
}
|