@thi.ng/transducers 9.0.0 → 9.0.2
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 +3 -3
- package/mapcat-indexed.d.ts +4 -4
- package/match-first.d.ts +2 -2
- package/match-last.d.ts +2 -2
- package/package.json +10 -10
- package/push-sort.d.ts +2 -2
- package/step.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-04-
|
|
3
|
+
- **Last updated**: 2024-04-20T14:42:45Z
|
|
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
|
+
### [9.0.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers@9.0.2) (2024-04-20)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update type usage ([b0e87ab](https://github.com/thi-ng/umbrella/commit/b0e87ab))
|
|
17
|
+
|
|
12
18
|
# [9.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers@9.0.0) (2024-04-08)
|
|
13
19
|
|
|
14
20
|
#### 🛑 Breaking changes
|
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 192 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
|
>
|
|
@@ -140,10 +140,10 @@ import * as tx from "@thi.ng/transducers";
|
|
|
140
140
|
Browser ESM import:
|
|
141
141
|
|
|
142
142
|
```html
|
|
143
|
-
<script type="module" src="https://
|
|
143
|
+
<script type="module" src="https://esm.run/@thi.ng/transducers"></script>
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
[
|
|
146
|
+
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
147
147
|
|
|
148
148
|
For Node.js REPL:
|
|
149
149
|
|
package/mapcat-indexed.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fn2 } from "@thi.ng/api";
|
|
1
|
+
import type { Fn2, Nullable } from "@thi.ng/api";
|
|
2
2
|
import type { Transducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Transducer. Similar to {@link mapcat}, but given `fn` takes two arguments:
|
|
@@ -11,7 +11,7 @@ import type { Transducer } from "./api.js";
|
|
|
11
11
|
* @param fn - transformation function
|
|
12
12
|
* @param offset - initial index
|
|
13
13
|
*/
|
|
14
|
-
export declare function mapcatIndexed<A, B>(fn: Fn2<number, A, Iterable<B
|
|
15
|
-
export declare function mapcatIndexed<A, B>(fn: Fn2<number, A, Iterable<B
|
|
16
|
-
export declare function mapcatIndexed<A, B>(fn: Fn2<number, A, Iterable<B
|
|
14
|
+
export declare function mapcatIndexed<A, B>(fn: Fn2<number, A, Nullable<Iterable<B>>>, offset?: number): Transducer<A, B>;
|
|
15
|
+
export declare function mapcatIndexed<A, B>(fn: Fn2<number, A, Nullable<Iterable<B>>>, src: Iterable<A>): IterableIterator<B>;
|
|
16
|
+
export declare function mapcatIndexed<A, B>(fn: Fn2<number, A, Nullable<Iterable<B>>>, offset: number, src: Iterable<A>): IterableIterator<B>;
|
|
17
17
|
//# sourceMappingURL=mapcat-indexed.d.ts.map
|
package/match-first.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Predicate } from "@thi.ng/api";
|
|
1
|
+
import type { Maybe, Predicate } from "@thi.ng/api";
|
|
2
2
|
import type { Transducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Transducer composition / syntax sugar for:
|
|
@@ -36,5 +36,5 @@ import type { Transducer } from "./api.js";
|
|
|
36
36
|
* @param pred - predicate function
|
|
37
37
|
*/
|
|
38
38
|
export declare function matchFirst<T>(pred: Predicate<T>): Transducer<T, T>;
|
|
39
|
-
export declare function matchFirst<T>(pred: Predicate<T>, src: Iterable<T>): T
|
|
39
|
+
export declare function matchFirst<T>(pred: Predicate<T>, src: Iterable<T>): Maybe<T>;
|
|
40
40
|
//# sourceMappingURL=match-first.d.ts.map
|
package/match-last.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Predicate } from "@thi.ng/api";
|
|
1
|
+
import type { Maybe, Predicate } from "@thi.ng/api";
|
|
2
2
|
import type { Transducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Similar to {@link matchFirst}, but matches yields none or only the **last**
|
|
@@ -26,5 +26,5 @@ import type { Transducer } from "./api.js";
|
|
|
26
26
|
* @param pred - predicate function
|
|
27
27
|
*/
|
|
28
28
|
export declare function matchLast<T>(pred: Predicate<T>): Transducer<T, T>;
|
|
29
|
-
export declare function matchLast<T>(pred: Predicate<T>, src: Iterable<T>): T
|
|
29
|
+
export declare function matchLast<T>(pred: Predicate<T>, src: Iterable<T>): Maybe<T>;
|
|
30
30
|
//# sourceMappingURL=match-last.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/transducers",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "Lightweight transducer implementations for ES6 / TypeScript",
|
|
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.
|
|
44
|
-
"@thi.ng/arrays": "^2.9.
|
|
45
|
-
"@thi.ng/checks": "^3.6.
|
|
46
|
-
"@thi.ng/compare": "^2.3.
|
|
47
|
-
"@thi.ng/compose": "^3.0.
|
|
48
|
-
"@thi.ng/errors": "^2.5.
|
|
49
|
-
"@thi.ng/math": "^5.10.
|
|
50
|
-
"@thi.ng/random": "^3.7.
|
|
43
|
+
"@thi.ng/api": "^8.11.0",
|
|
44
|
+
"@thi.ng/arrays": "^2.9.4",
|
|
45
|
+
"@thi.ng/checks": "^3.6.2",
|
|
46
|
+
"@thi.ng/compare": "^2.3.3",
|
|
47
|
+
"@thi.ng/compose": "^3.0.2",
|
|
48
|
+
"@thi.ng/errors": "^2.5.5",
|
|
49
|
+
"@thi.ng/math": "^5.10.11",
|
|
50
|
+
"@thi.ng/random": "^3.7.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@microsoft/api-extractor": "^7.43.0",
|
|
@@ -590,5 +590,5 @@
|
|
|
590
590
|
],
|
|
591
591
|
"year": 2016
|
|
592
592
|
},
|
|
593
|
-
"gitHead": "
|
|
593
|
+
"gitHead": "8339d05ecc857e529c7325a9839c0063b89e728d\n"
|
|
594
594
|
}
|
package/push-sort.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Comparator } from "@thi.ng/api";
|
|
1
|
+
import type { Comparator, Maybe } from "@thi.ng/api";
|
|
2
2
|
import type { Reducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Similar to {@link push}, but sorts result array upon completion using
|
|
@@ -8,5 +8,5 @@ import type { Reducer } from "./api.js";
|
|
|
8
8
|
* @param cmp -
|
|
9
9
|
*/
|
|
10
10
|
export declare function pushSort<T>(cmp?: Comparator<T>): Reducer<T, T[]>;
|
|
11
|
-
export declare function pushSort<T>(cmp: Comparator<T
|
|
11
|
+
export declare function pushSort<T>(cmp: Maybe<Comparator<T>>, xs: Iterable<T>): T[];
|
|
12
12
|
//# sourceMappingURL=push-sort.d.ts.map
|
package/step.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fn } from "@thi.ng/api";
|
|
1
|
+
import type { Fn, Maybe } from "@thi.ng/api";
|
|
2
2
|
import type { TxLike } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Single-step transducer execution wrapper. Returns array if the given
|
|
@@ -51,5 +51,5 @@ import type { TxLike } from "./api.js";
|
|
|
51
51
|
* @param tx -
|
|
52
52
|
* @param unwrap -
|
|
53
53
|
*/
|
|
54
|
-
export declare const step: <A, B>(tx: TxLike<A, B>, unwrap?: boolean) => Fn<A, B | B[]
|
|
54
|
+
export declare const step: <A, B>(tx: TxLike<A, B>, unwrap?: boolean) => Fn<A, Maybe<B | B[]>>;
|
|
55
55
|
//# sourceMappingURL=step.d.ts.map
|