@thi.ng/transducers 8.2.0 → 8.3.0
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 +7 -1
- package/README.md +2 -2
- package/keep.d.ts +1 -1
- package/map.d.ts +5 -0
- package/map.js +7 -0
- package/norm-range.d.ts +8 -8
- package/norm-range.js +8 -8
- package/package.json +14 -14
- package/partition-sync.d.ts +3 -3
- package/push-sort.d.ts +1 -1
- package/range-nd.d.ts +1 -1
- package/range-nd.js +1 -1
- package/rechunk.d.ts +1 -1
- package/renamer.d.ts +1 -1
- package/renamer.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**:
|
|
3
|
+
- **Last updated**: 2022-03-11T12:13:49Z
|
|
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,12 @@ 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
|
+
## [8.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers@8.3.0) (2022-03-11)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add mapA() helper ([5cc5795](https://github.com/thi-ng/umbrella/commit/5cc5795))
|
|
17
|
+
|
|
12
18
|
## [8.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers@8.2.0) (2021-12-14)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ node --experimental-repl-await
|
|
|
178
178
|
> const transducers = await import("@thi.ng/transducers");
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
Package sizes (gzipped, pre-treeshake): ESM: 9.
|
|
181
|
+
Package sizes (gzipped, pre-treeshake): ESM: 9.64 KB
|
|
182
182
|
|
|
183
183
|
## Dependencies
|
|
184
184
|
|
|
@@ -1024,4 +1024,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
1024
1024
|
|
|
1025
1025
|
## License
|
|
1026
1026
|
|
|
1027
|
-
© 2016 -
|
|
1027
|
+
© 2016 - 2022 Karsten Schmidt // Apache Software License 2.0
|
package/keep.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Transducer } from "./api.js";
|
|
|
4
4
|
* Transducer. Only keeps values for which (optional) predicate returns a
|
|
5
5
|
* non-null result. If no `pred` is given, uses values as is.
|
|
6
6
|
*
|
|
7
|
-
* @param pred
|
|
7
|
+
* @param pred -
|
|
8
8
|
*/
|
|
9
9
|
export declare function keep<T>(pred?: Fn<Nullable<T>, any>): Transducer<Nullable<T>, T>;
|
|
10
10
|
export declare function keep<T>(src: Iterable<Nullable<T>>): IterableIterator<T>;
|
package/map.d.ts
CHANGED
|
@@ -14,4 +14,9 @@ import type { Transducer } from "./api.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function map<A, B>(fn: Fn<A, B>): Transducer<A, B>;
|
|
16
16
|
export declare function map<A, B>(fn: Fn<A, B>, src: Iterable<A>): IterableIterator<B>;
|
|
17
|
+
/**
|
|
18
|
+
* Convenience wrapper for {@link map} to transform an iterable with given `fn`
|
|
19
|
+
* and immediatedly collect results into an array.
|
|
20
|
+
*/
|
|
21
|
+
export declare const mapA: <A, B>(fn: Fn<A, B>, src: Iterable<A>) => B[];
|
|
17
22
|
//# sourceMappingURL=map.d.ts.map
|
package/map.js
CHANGED
|
@@ -9,3 +9,10 @@ export function map(fn, src) {
|
|
|
9
9
|
return compR(rfn, (acc, x) => r(acc, fn(x)));
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Convenience wrapper for {@link map} to transform an iterable with given `fn`
|
|
14
|
+
* and immediatedly collect results into an array.
|
|
15
|
+
*/
|
|
16
|
+
export const mapA = (fn, src) => [
|
|
17
|
+
...map(fn, src),
|
|
18
|
+
];
|
package/norm-range.d.ts
CHANGED
|
@@ -15,20 +15,20 @@ export declare function normRange(n: number, includeLast?: boolean): IterableIte
|
|
|
15
15
|
/**
|
|
16
16
|
* 2D version of {@link normRange} in Y-major order (i.e. X is inner loop).
|
|
17
17
|
*
|
|
18
|
-
* @param nx
|
|
19
|
-
* @param ny
|
|
20
|
-
* @param includeLastX
|
|
21
|
-
* @param includeLastY
|
|
18
|
+
* @param nx -
|
|
19
|
+
* @param ny -
|
|
20
|
+
* @param includeLastX -
|
|
21
|
+
* @param includeLastY -
|
|
22
22
|
*/
|
|
23
23
|
export declare function normRange2d(nx: number, ny: number, includeLastX?: boolean, includeLastY?: boolean): Generator<number[], void, undefined>;
|
|
24
24
|
/**
|
|
25
25
|
* 3D version of {@link normRange} in Z-major order (i.e. X being innermost
|
|
26
26
|
* loop).
|
|
27
27
|
*
|
|
28
|
-
* @param nx
|
|
29
|
-
* @param ny
|
|
30
|
-
* @param includeLastX
|
|
31
|
-
* @param includeLastY
|
|
28
|
+
* @param nx -
|
|
29
|
+
* @param ny -
|
|
30
|
+
* @param includeLastX -
|
|
31
|
+
* @param includeLastY -
|
|
32
32
|
*/
|
|
33
33
|
export declare function normRange3d(nx: number, ny: number, nz: number, includeLastX?: boolean, includeLastY?: boolean, includeLastZ?: boolean): Generator<number[], void, undefined>;
|
|
34
34
|
//# sourceMappingURL=norm-range.d.ts.map
|
package/norm-range.js
CHANGED
|
@@ -22,10 +22,10 @@ export function* normRange(n, includeLast = true) {
|
|
|
22
22
|
/**
|
|
23
23
|
* 2D version of {@link normRange} in Y-major order (i.e. X is inner loop).
|
|
24
24
|
*
|
|
25
|
-
* @param nx
|
|
26
|
-
* @param ny
|
|
27
|
-
* @param includeLastX
|
|
28
|
-
* @param includeLastY
|
|
25
|
+
* @param nx -
|
|
26
|
+
* @param ny -
|
|
27
|
+
* @param includeLastX -
|
|
28
|
+
* @param includeLastY -
|
|
29
29
|
*/
|
|
30
30
|
export function* normRange2d(nx, ny, includeLastX = true, includeLastY = true) {
|
|
31
31
|
const rx = [...normRange(nx, includeLastX)];
|
|
@@ -37,10 +37,10 @@ export function* normRange2d(nx, ny, includeLastX = true, includeLastY = true) {
|
|
|
37
37
|
* 3D version of {@link normRange} in Z-major order (i.e. X being innermost
|
|
38
38
|
* loop).
|
|
39
39
|
*
|
|
40
|
-
* @param nx
|
|
41
|
-
* @param ny
|
|
42
|
-
* @param includeLastX
|
|
43
|
-
* @param includeLastY
|
|
40
|
+
* @param nx -
|
|
41
|
+
* @param ny -
|
|
42
|
+
* @param includeLastX -
|
|
43
|
+
* @param includeLastY -
|
|
44
44
|
*/
|
|
45
45
|
export function* normRange3d(nx, ny, nz, includeLastX = true, includeLastY = true, includeLastZ = true) {
|
|
46
46
|
const sliceXY = [...normRange2d(nx, ny, includeLastX, includeLastY)];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/transducers",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Lightweight transducer implementations for ES6 / TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/arrays": "^2.
|
|
39
|
-
"@thi.ng/checks": "^3.1.
|
|
40
|
-
"@thi.ng/compare": "^2.1.
|
|
41
|
-
"@thi.ng/compose": "^2.1.
|
|
42
|
-
"@thi.ng/errors": "^2.1.
|
|
43
|
-
"@thi.ng/math": "^5.
|
|
44
|
-
"@thi.ng/random": "^3.2.
|
|
37
|
+
"@thi.ng/api": "^8.3.4",
|
|
38
|
+
"@thi.ng/arrays": "^2.2.0",
|
|
39
|
+
"@thi.ng/checks": "^3.1.4",
|
|
40
|
+
"@thi.ng/compare": "^2.1.4",
|
|
41
|
+
"@thi.ng/compose": "^2.1.4",
|
|
42
|
+
"@thi.ng/errors": "^2.1.4",
|
|
43
|
+
"@thi.ng/math": "^5.3.0",
|
|
44
|
+
"@thi.ng/random": "^3.2.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@microsoft/api-extractor": "^7.19.
|
|
48
|
-
"@thi.ng/testament": "^0.2.
|
|
47
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
48
|
+
"@thi.ng/testament": "^0.2.4",
|
|
49
49
|
"rimraf": "^3.0.2",
|
|
50
50
|
"tools": "^0.0.1",
|
|
51
|
-
"typedoc": "^0.22.
|
|
52
|
-
"typescript": "^4.
|
|
51
|
+
"typedoc": "^0.22.13",
|
|
52
|
+
"typescript": "^4.6.2"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"2d",
|
|
@@ -567,5 +567,5 @@
|
|
|
567
567
|
],
|
|
568
568
|
"year": 2016
|
|
569
569
|
},
|
|
570
|
-
"gitHead": "
|
|
570
|
+
"gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
|
|
571
571
|
}
|
package/partition-sync.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface PartitionSync<T> extends Transducer<T, IObjectOf<T>> {
|
|
|
12
12
|
/**
|
|
13
13
|
* Adds `id` to set of required inputs.
|
|
14
14
|
*
|
|
15
|
-
* @param id
|
|
15
|
+
* @param id -
|
|
16
16
|
*/
|
|
17
17
|
add(id: PropertyKey): void;
|
|
18
18
|
/**
|
|
@@ -20,8 +20,8 @@ export interface PartitionSync<T> extends Transducer<T, IObjectOf<T>> {
|
|
|
20
20
|
* also removes any previously received value(s) for that input in
|
|
21
21
|
* the result tuple.
|
|
22
22
|
*
|
|
23
|
-
* @param id
|
|
24
|
-
* @param clean
|
|
23
|
+
* @param id -
|
|
24
|
+
* @param clean -
|
|
25
25
|
*/
|
|
26
26
|
delete(id: PropertyKey, clean?: boolean): void;
|
|
27
27
|
}
|
package/push-sort.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Reducer } from "./api.js";
|
|
|
5
5
|
* using optionally given comparator (default
|
|
6
6
|
* {@link @thi.ng/compare#compare}).
|
|
7
7
|
*
|
|
8
|
-
* @param cmp
|
|
8
|
+
* @param cmp -
|
|
9
9
|
*/
|
|
10
10
|
export declare function pushSort<T>(cmp?: Comparator<T>): Reducer<T[], T>;
|
|
11
11
|
export declare function pushSort<T>(cmp: Comparator<T>, xs: Iterable<T>): T[];
|
package/range-nd.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { ArrayLikeIterable } from "@thi.ng/api";
|
|
|
30
30
|
* // ]
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* @param vec
|
|
33
|
+
* @param vec -
|
|
34
34
|
*/
|
|
35
35
|
export declare const rangeNd: (min: ArrayLikeIterable<number>, max?: ArrayLikeIterable<number> | undefined) => IterableIterator<any[]>;
|
|
36
36
|
//# sourceMappingURL=range-nd.d.ts.map
|
package/range-nd.js
CHANGED
package/rechunk.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ import type { Transducer } from "./api.js";
|
|
|
39
39
|
* // output done
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
|
-
* @param re
|
|
42
|
+
* @param re -
|
|
43
43
|
*/
|
|
44
44
|
export declare function rechunk(re?: RegExp): Transducer<string, string>;
|
|
45
45
|
export declare function rechunk(xs: Iterable<string>): IterableIterator<string>;
|
package/renamer.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { IObjectOf } from "@thi.ng/api";
|
|
|
3
3
|
* Higher order helper function for {@link rename} transducer. Takes an object
|
|
4
4
|
* of key mappings and returns function applying these mapping/renames.
|
|
5
5
|
*
|
|
6
|
-
* @param kmap
|
|
6
|
+
* @param kmap -
|
|
7
7
|
*/
|
|
8
8
|
export declare const renamer: (kmap: IObjectOf<PropertyKey>) => (x: any) => any;
|
|
9
9
|
//# sourceMappingURL=renamer.d.ts.map
|
package/renamer.js
CHANGED