@thi.ng/transducers 8.0.0 → 8.0.6
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 +48 -0
- package/README.md +8 -7
- package/add.d.ts +1 -1
- package/add.js +1 -1
- package/api.d.ts +1 -1
- package/assoc-map.d.ts +1 -1
- package/assoc-map.js +1 -1
- package/assoc-obj.d.ts +1 -1
- package/assoc-obj.js +1 -1
- package/auto-obj.d.ts +1 -1
- package/auto-obj.js +1 -1
- package/benchmark.d.ts +1 -1
- package/benchmark.js +2 -2
- package/cat.d.ts +1 -1
- package/cat.js +2 -2
- package/choices.js +1 -1
- package/comp.d.ts +1 -1
- package/comp.js +1 -1
- package/compr.d.ts +1 -1
- package/conj.d.ts +1 -1
- package/conj.js +1 -1
- package/converge.d.ts +1 -1
- package/converge.js +3 -3
- package/convolve.d.ts +1 -1
- package/convolve.js +7 -7
- package/count.d.ts +1 -1
- package/count.js +1 -1
- package/dedupe.d.ts +1 -1
- package/dedupe.js +2 -2
- package/deep-transform.d.ts +1 -1
- package/delayed.d.ts +1 -1
- package/delayed.js +1 -1
- package/distinct.d.ts +1 -1
- package/distinct.js +2 -2
- package/div.d.ts +1 -1
- package/div.js +1 -1
- package/drop-nth.d.ts +1 -1
- package/drop-nth.js +2 -2
- package/drop-while.d.ts +1 -1
- package/drop-while.js +2 -2
- package/drop.d.ts +1 -1
- package/drop.js +2 -2
- package/dup.js +1 -1
- package/duplicate.d.ts +1 -1
- package/duplicate.js +3 -3
- package/ensure.d.ts +1 -1
- package/every.d.ts +1 -1
- package/every.js +2 -2
- package/extend-sides.js +1 -1
- package/fill.d.ts +1 -1
- package/fill.js +1 -1
- package/filter-fuzzy.d.ts +1 -1
- package/filter-fuzzy.js +2 -2
- package/filter.d.ts +1 -1
- package/filter.js +2 -2
- package/flatten-with.d.ts +1 -1
- package/flatten-with.js +3 -3
- package/flatten.d.ts +1 -1
- package/flatten.js +1 -1
- package/frequencies.d.ts +1 -1
- package/frequencies.js +3 -3
- package/group-binary.d.ts +1 -1
- package/group-binary.js +2 -2
- package/group-by-map.d.ts +1 -1
- package/group-by-map.js +2 -2
- package/group-by-obj.d.ts +1 -1
- package/group-by-obj.js +2 -2
- package/index.d.ts +145 -145
- package/index.js +145 -145
- package/indexed.d.ts +1 -1
- package/indexed.js +2 -2
- package/interleave.d.ts +1 -1
- package/interleave.js +3 -3
- package/internal/drain.d.ts +1 -1
- package/internal/drain.js +1 -1
- package/internal/group-opts.d.ts +1 -1
- package/internal/group-opts.js +1 -1
- package/internal/mathop.d.ts +1 -1
- package/internal/mathop.js +1 -1
- package/internal/sort-opts.d.ts +1 -1
- package/interpolate-hermite.d.ts +1 -1
- package/interpolate-hermite.js +1 -1
- package/interpolate-linear.d.ts +1 -1
- package/interpolate-linear.js +1 -1
- package/interpolate.d.ts +1 -1
- package/interpolate.js +6 -6
- package/interpose.d.ts +1 -1
- package/interpose.js +3 -3
- package/iterator.d.ts +1 -1
- package/iterator.js +3 -3
- package/juxtr.d.ts +1 -1
- package/juxtr.js +1 -1
- package/keep.d.ts +1 -1
- package/keep.js +2 -2
- package/key-permutations.js +6 -6
- package/key-selector.js +1 -1
- package/labeled.d.ts +1 -1
- package/labeled.js +2 -2
- package/last.d.ts +1 -1
- package/last.js +1 -1
- package/line.js +2 -2
- package/map-deep.d.ts +1 -1
- package/map-deep.js +3 -3
- package/map-indexed.d.ts +1 -1
- package/map-indexed.js +2 -2
- package/map-keys.d.ts +1 -1
- package/map-keys.js +2 -2
- package/map-nth.d.ts +1 -1
- package/map-nth.js +2 -2
- package/map-vals.d.ts +1 -1
- package/map-vals.js +2 -2
- package/map.d.ts +1 -1
- package/map.js +2 -2
- package/mapcat-indexed.d.ts +1 -1
- package/mapcat-indexed.js +4 -4
- package/mapcat.d.ts +1 -1
- package/mapcat.js +4 -4
- package/match-first.d.ts +1 -1
- package/match-first.js +4 -4
- package/match-last.d.ts +1 -1
- package/match-last.js +4 -4
- package/max-compare.d.ts +1 -1
- package/max-compare.js +1 -1
- package/max-mag.d.ts +1 -1
- package/max-mag.js +1 -1
- package/max.d.ts +1 -1
- package/max.js +1 -1
- package/mean.d.ts +1 -1
- package/mean.js +1 -1
- package/min-compare.d.ts +1 -1
- package/min-compare.js +1 -1
- package/min-mag.d.ts +1 -1
- package/min-mag.js +1 -1
- package/min-max.d.ts +1 -1
- package/min-max.js +3 -3
- package/min.d.ts +1 -1
- package/min.js +1 -1
- package/moving-average.d.ts +1 -1
- package/moving-average.js +2 -2
- package/moving-median.d.ts +1 -1
- package/moving-median.js +5 -5
- package/mul.d.ts +1 -1
- package/mul.js +1 -1
- package/multiplex-obj.d.ts +1 -1
- package/multiplex-obj.js +4 -4
- package/multiplex.d.ts +1 -1
- package/multiplex.js +2 -2
- package/noop.d.ts +1 -1
- package/norm-count.d.ts +1 -1
- package/norm-count.js +1 -1
- package/norm-frequencies-auto.d.ts +1 -1
- package/norm-frequencies-auto.js +2 -2
- package/norm-frequencies.d.ts +1 -1
- package/norm-frequencies.js +3 -3
- package/norm-range.js +1 -1
- package/package.json +14 -11
- package/pad-last.d.ts +1 -1
- package/pad-last.js +2 -2
- package/pad-sides.js +2 -2
- package/page.d.ts +1 -1
- package/page.js +4 -4
- package/palindrome.js +3 -3
- package/partition-by.d.ts +1 -1
- package/partition-by.js +2 -2
- package/partition-of.d.ts +1 -1
- package/partition-of.js +2 -2
- package/partition-sort.d.ts +1 -1
- package/partition-sort.js +5 -5
- package/partition-sync.d.ts +1 -1
- package/partition-sync.js +2 -2
- package/partition-time.d.ts +1 -1
- package/partition-time.js +2 -2
- package/partition-when.d.ts +1 -1
- package/partition-when.js +2 -2
- package/partition.d.ts +1 -1
- package/partition.js +1 -1
- package/peek.d.ts +1 -1
- package/peek.js +1 -1
- package/permutations.js +1 -1
- package/pluck.d.ts +1 -1
- package/pluck.js +2 -2
- package/push-copy.d.ts +1 -1
- package/push-copy.js +1 -1
- package/push-sort.d.ts +1 -1
- package/push.d.ts +1 -1
- package/push.js +1 -1
- package/range-nd.js +4 -4
- package/range.d.ts +2 -2
- package/range.js +1 -4
- package/range2d.js +1 -1
- package/range3d.js +1 -1
- package/reduce.d.ts +1 -1
- package/reduce.js +1 -1
- package/reduced.js +0 -1
- package/reductions.d.ts +1 -1
- package/reductions.js +2 -2
- package/rename.d.ts +1 -1
- package/rename.js +6 -6
- package/run.d.ts +1 -1
- package/run.js +1 -1
- package/sample.d.ts +1 -1
- package/sample.js +2 -2
- package/scan.d.ts +1 -1
- package/scan.js +2 -2
- package/select-keys.d.ts +1 -1
- package/select-keys.js +3 -3
- package/side-effect.d.ts +1 -1
- package/side-effect.js +1 -1
- package/sliding-window.d.ts +1 -1
- package/sliding-window.js +2 -2
- package/some.d.ts +1 -1
- package/some.js +2 -2
- package/step.d.ts +1 -1
- package/step.js +3 -3
- package/str.d.ts +1 -1
- package/str.js +1 -1
- package/stream-shuffle.d.ts +1 -1
- package/stream-shuffle.js +2 -2
- package/stream-sort.d.ts +1 -1
- package/stream-sort.js +3 -3
- package/struct.d.ts +1 -1
- package/struct.js +6 -6
- package/sub.d.ts +1 -1
- package/sub.js +1 -1
- package/swizzle.d.ts +1 -1
- package/swizzle.js +2 -2
- package/take-last.d.ts +1 -1
- package/take-last.js +2 -2
- package/take-nth.d.ts +1 -1
- package/take-nth.js +2 -2
- package/take-while.d.ts +1 -1
- package/take-while.js +3 -3
- package/take.d.ts +1 -1
- package/take.js +3 -3
- package/throttle-time.d.ts +1 -1
- package/throttle-time.js +2 -2
- package/throttle.d.ts +1 -1
- package/throttle.js +2 -2
- package/toggle.d.ts +1 -1
- package/toggle.js +1 -1
- package/trace.d.ts +1 -1
- package/trace.js +1 -1
- package/transduce.d.ts +1 -1
- package/transduce.js +3 -3
- package/tween.js +2 -2
- package/word-wrap.d.ts +1 -1
- package/word-wrap.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,54 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.0.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@8.0.5...@thi.ng/transducers@8.0.6) (2021-10-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @thi.ng/transducers
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@8.0.4...@thi.ng/transducers@8.0.5) (2021-10-28)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @thi.ng/transducers
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [8.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@8.0.3...@thi.ng/transducers@8.0.4) (2021-10-25)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @thi.ng/transducers
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [8.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@8.0.2...@thi.ng/transducers@8.0.3) (2021-10-15)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @thi.ng/transducers
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [8.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@8.0.1...@thi.ng/transducers@8.0.2) (2021-10-15)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @thi.ng/transducers
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [8.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@8.0.0...@thi.ng/transducers@8.0.1) (2021-10-13)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @thi.ng/transducers
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
6
54
|
# [8.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@7.9.2...@thi.ng/transducers@8.0.0) (2021-10-12)
|
|
7
55
|
|
|
8
56
|
|
package/README.md
CHANGED
|
@@ -94,9 +94,9 @@ issue](https://github.com/thi-ng/umbrella/issues/186) by
|
|
|
94
94
|
[@gavinpc-mindgrub](https://github.com/gavinpc-mindgrub), various transducers
|
|
95
95
|
functions have been fixed for the case when they're invoked with an _empty_
|
|
96
96
|
string as input iterable. Furthermore,
|
|
97
|
-
[`flatten()`](https://
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
[`flatten()`](https://docs.thi.ng/umbrella/transducers/modules.html#flatten) is
|
|
98
|
+
_always_ treating strings as atomic values now, whereas before top-level strings
|
|
99
|
+
would be split into individual characters.
|
|
100
100
|
|
|
101
101
|
### 6.0.0 release
|
|
102
102
|
|
|
@@ -169,15 +169,16 @@ ES module import:
|
|
|
169
169
|
|
|
170
170
|
[Skypack documentation](https://docs.skypack.dev/)
|
|
171
171
|
|
|
172
|
-
For
|
|
172
|
+
For Node.js REPL:
|
|
173
173
|
|
|
174
174
|
```text
|
|
175
|
-
|
|
175
|
+
# with flag only for < v16
|
|
176
|
+
node --experimental-repl-await
|
|
176
177
|
|
|
177
178
|
> const transducers = await import("@thi.ng/transducers");
|
|
178
179
|
```
|
|
179
180
|
|
|
180
|
-
Package sizes (gzipped, pre-treeshake): ESM: 8.
|
|
181
|
+
Package sizes (gzipped, pre-treeshake): ESM: 8.67 KB
|
|
181
182
|
|
|
182
183
|
## Dependencies
|
|
183
184
|
|
|
@@ -234,7 +235,7 @@ A selection:
|
|
|
234
235
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rstream-grid.jpg" width="240"/> | Interactive grid generator, SVG generation & export, undo/redo support | [Demo](https://demo.thi.ng/umbrella/rstream-grid/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rstream-grid) |
|
|
235
236
|
| | rstream based UI updates & state handling | [Demo](https://demo.thi.ng/umbrella/rstream-hdom/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rstream-hdom) |
|
|
236
237
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/scenegraph.png" width="240"/> | 2D scenegraph & shape picking | [Demo](https://demo.thi.ng/umbrella/scenegraph/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/scenegraph) |
|
|
237
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-workers.jpg" width="240"/> | Fork-join worker-based raymarch renderer
|
|
238
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/shader-ast-workers.jpg" width="240"/> | Fork-join worker-based raymarch renderer (JS/CPU only) | [Demo](https://demo.thi.ng/umbrella/shader-ast-workers/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-workers) |
|
|
238
239
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-barchart.png" width="240"/> | Simplistic SVG bar chart component | [Demo](https://demo.thi.ng/umbrella/svg-barchart/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-barchart) |
|
|
239
240
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/svg-waveform.jpg" width="240"/> | Additive waveform synthesis & SVG visualization with undo/redo | [Demo](https://demo.thi.ng/umbrella/svg-waveform/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/svg-waveform) |
|
|
240
241
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/talk-slides.png" width="240"/> | hdom based slide deck viewer & slides from my ClojureX 2018 keynote | [Demo](https://demo.thi.ng/umbrella/talk-slides/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/talk-slides) |
|
package/add.d.ts
CHANGED
package/add.js
CHANGED
package/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Comparator, Fn, IObjectOf } from "@thi.ng/api";
|
|
2
|
-
import type { Reduced } from "./reduced";
|
|
2
|
+
import type { Reduced } from "./reduced.js";
|
|
3
3
|
export declare type Transducer<A, B> = (rfn: Reducer<any, B>) => Reducer<any, A>;
|
|
4
4
|
export declare type TxLike<A, B> = Transducer<A, B> | IXform<A, B>;
|
|
5
5
|
export declare type ReductionFn<A, B> = (acc: A, x: B) => A | Reduced<A>;
|
package/assoc-map.d.ts
CHANGED
package/assoc-map.js
CHANGED
package/assoc-obj.d.ts
CHANGED
package/assoc-obj.js
CHANGED
package/auto-obj.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IObjectOf } from "@thi.ng/api";
|
|
2
|
-
import type { Reducer } from "./api";
|
|
2
|
+
import type { Reducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Reducer accepting values of any type and assigning them to auto-labeled keys
|
|
5
5
|
* in an object. Keys consist of given `prefix` and monotonically increasing ID.
|
package/auto-obj.js
CHANGED
package/benchmark.d.ts
CHANGED
package/benchmark.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isIterable } from "@thi.ng/checks/is-iterable";
|
|
2
|
-
import { compR } from "./compr";
|
|
3
|
-
import { iterator1 } from "./iterator";
|
|
2
|
+
import { compR } from "./compr.js";
|
|
3
|
+
import { iterator1 } from "./iterator.js";
|
|
4
4
|
export function benchmark(src) {
|
|
5
5
|
return isIterable(src)
|
|
6
6
|
? iterator1(benchmark(), src)
|
package/cat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Nullable } from "@thi.ng/api";
|
|
2
|
-
import type { Transducer } from "./api";
|
|
2
|
+
import type { Transducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Transducer to concatenate iterable values. Iterates over each input
|
|
5
5
|
* and emits individual values down stream, therefore removing one level
|
package/cat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compR } from "./compr";
|
|
2
|
-
import { ensureReduced, isReduced, unreduced } from "./reduced";
|
|
1
|
+
import { compR } from "./compr.js";
|
|
2
|
+
import { ensureReduced, isReduced, unreduced } from "./reduced.js";
|
|
3
3
|
/**
|
|
4
4
|
* Transducer to concatenate iterable values. Iterates over each input
|
|
5
5
|
* and emits individual values down stream, therefore removing one level
|
package/choices.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureArray } from "@thi.ng/arrays/ensure-array";
|
|
2
2
|
import { SYSTEM } from "@thi.ng/random/system";
|
|
3
3
|
import { weightedRandom } from "@thi.ng/random/weighted-random";
|
|
4
|
-
import { repeatedly } from "./repeatedly";
|
|
4
|
+
import { repeatedly } from "./repeatedly.js";
|
|
5
5
|
/**
|
|
6
6
|
* Returns an infinite iterator of random choices and their (optional)
|
|
7
7
|
* weights. If `weights` is given, it must have at least the same size
|
package/comp.d.ts
CHANGED
package/comp.js
CHANGED
package/compr.d.ts
CHANGED
package/conj.d.ts
CHANGED
package/conj.js
CHANGED
package/converge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Predicate2 } from "@thi.ng/api";
|
|
2
|
-
import type { Transducer } from "./api";
|
|
2
|
+
import type { Transducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Transducer which for each input `x` (apart from the very first one)
|
|
5
5
|
* applies given predicate `pred` to previous input and `x`. Only passes
|
package/converge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SEMAPHORE } from "@thi.ng/api/api";
|
|
2
|
-
import { compR } from "./compr";
|
|
3
|
-
import { __iter } from "./iterator";
|
|
4
|
-
import { ensureReduced } from "./reduced";
|
|
2
|
+
import { compR } from "./compr.js";
|
|
3
|
+
import { __iter } from "./iterator.js";
|
|
4
|
+
import { ensureReduced } from "./reduced.js";
|
|
5
5
|
export function converge(...args) {
|
|
6
6
|
return (__iter(converge, args) ||
|
|
7
7
|
((rfn) => {
|
package/convolve.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fn0 } from "@thi.ng/api";
|
|
2
|
-
import type { Reducer, Transducer } from "./api";
|
|
2
|
+
import type { Reducer, Transducer } from "./api.js";
|
|
3
3
|
export declare type ConvolutionKernel1D = [number, number][];
|
|
4
4
|
export declare type ConvolutionKernel2D = [number, [number, number]][];
|
|
5
5
|
export declare type ConvolutionKernel3D = [number, [number, number, number]][];
|
package/convolve.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
|
|
2
|
-
import { add } from "./add";
|
|
3
|
-
import { iterator1 } from "./iterator";
|
|
4
|
-
import { map } from "./map";
|
|
5
|
-
import { range } from "./range";
|
|
6
|
-
import { range2d } from "./range2d";
|
|
7
|
-
import { transduce } from "./transduce";
|
|
8
|
-
import { zip } from "./zip";
|
|
2
|
+
import { add } from "./add.js";
|
|
3
|
+
import { iterator1 } from "./iterator.js";
|
|
4
|
+
import { map } from "./map.js";
|
|
5
|
+
import { range } from "./range.js";
|
|
6
|
+
import { range2d } from "./range2d.js";
|
|
7
|
+
import { transduce } from "./transduce.js";
|
|
8
|
+
import { zip } from "./zip.js";
|
|
9
9
|
export const buildKernel1d = (weights, w) => {
|
|
10
10
|
const w2 = w >> 1;
|
|
11
11
|
return [...zip(weights, range(-w2, w2 + 1))];
|
package/count.d.ts
CHANGED
package/count.js
CHANGED
package/dedupe.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Predicate2 } from "@thi.ng/api";
|
|
2
|
-
import type { Transducer } from "./api";
|
|
2
|
+
import type { Transducer } from "./api.js";
|
|
3
3
|
export declare function dedupe<T>(equiv?: Predicate2<T>): Transducer<T, T>;
|
|
4
4
|
export declare function dedupe<T>(src: Iterable<T>): IterableIterator<T>;
|
|
5
5
|
export declare function dedupe<T>(equiv: Predicate2<T>, src: Iterable<T>): IterableIterator<T>;
|
package/dedupe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SEMAPHORE } from "@thi.ng/api/api";
|
|
2
|
-
import { compR } from "./compr";
|
|
3
|
-
import { __iter } from "./iterator";
|
|
2
|
+
import { compR } from "./compr.js";
|
|
3
|
+
import { __iter } from "./iterator.js";
|
|
4
4
|
export function dedupe(...args) {
|
|
5
5
|
return (__iter(dedupe, args) ||
|
|
6
6
|
((rfn) => {
|
package/deep-transform.d.ts
CHANGED
package/delayed.d.ts
CHANGED
package/delayed.js
CHANGED
package/distinct.d.ts
CHANGED
package/distinct.js
CHANGED
package/div.d.ts
CHANGED
package/div.js
CHANGED
package/drop-nth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Transducer } from "./api";
|
|
1
|
+
import type { Transducer } from "./api.js";
|
|
2
2
|
export declare function dropNth<T>(n: number): Transducer<T, T>;
|
|
3
3
|
export declare function dropNth<T>(n: number, src: Iterable<T>): IterableIterator<T>;
|
|
4
4
|
//# sourceMappingURL=drop-nth.d.ts.map
|
package/drop-nth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isIterable } from "@thi.ng/checks/is-iterable";
|
|
2
2
|
import { clamp0 } from "@thi.ng/math/interval";
|
|
3
|
-
import { iterator1 } from "./iterator";
|
|
4
|
-
import { throttle } from "./throttle";
|
|
3
|
+
import { iterator1 } from "./iterator.js";
|
|
4
|
+
import { throttle } from "./throttle.js";
|
|
5
5
|
export function dropNth(n, src) {
|
|
6
6
|
if (isIterable(src)) {
|
|
7
7
|
return iterator1(dropNth(n), src);
|
package/drop-while.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Predicate } from "@thi.ng/api";
|
|
2
|
-
import type { Transducer } from "./api";
|
|
2
|
+
import type { Transducer } from "./api.js";
|
|
3
3
|
export declare function dropWhile<T>(pred?: Predicate<T>): Transducer<T, T>;
|
|
4
4
|
export declare function dropWhile<T>(src: Iterable<T>): IterableIterator<T>;
|
|
5
5
|
export declare function dropWhile<T>(pred: Predicate<T>, src: Iterable<T>): IterableIterator<T>;
|
package/drop-while.js
CHANGED
package/drop.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Transducer } from "./api";
|
|
1
|
+
import type { Transducer } from "./api.js";
|
|
2
2
|
export declare function drop<T>(n: number): Transducer<T, T>;
|
|
3
3
|
export declare function drop<T>(n: number, src: Iterable<T>): IterableIterator<T>;
|
|
4
4
|
//# sourceMappingURL=drop.d.ts.map
|
package/drop.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isIterable } from "@thi.ng/checks/is-iterable";
|
|
2
|
-
import { compR } from "./compr";
|
|
3
|
-
import { iterator1 } from "./iterator";
|
|
2
|
+
import { compR } from "./compr.js";
|
|
3
|
+
import { iterator1 } from "./iterator.js";
|
|
4
4
|
export function drop(n, src) {
|
|
5
5
|
return isIterable(src)
|
|
6
6
|
? iterator1(drop(n), src)
|
package/dup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureArray } from "@thi.ng/arrays/ensure-array";
|
|
2
2
|
import { isArray } from "@thi.ng/checks/is-array";
|
|
3
3
|
import { isString } from "@thi.ng/checks/is-string";
|
|
4
|
-
import { concat } from "./concat";
|
|
4
|
+
import { concat } from "./concat.js";
|
|
5
5
|
export function dup(x) {
|
|
6
6
|
return isString(x)
|
|
7
7
|
? x + x
|
package/duplicate.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Transducer } from "./api";
|
|
1
|
+
import type { Transducer } from "./api.js";
|
|
2
2
|
export declare function duplicate<T>(n?: number): Transducer<T, T>;
|
|
3
3
|
export declare function duplicate<T>(n: number, src: Iterable<T>): IterableIterator<T>;
|
|
4
4
|
//# sourceMappingURL=duplicate.d.ts.map
|
package/duplicate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isIterable } from "@thi.ng/checks/is-iterable";
|
|
2
|
-
import { compR } from "./compr";
|
|
3
|
-
import { iterator } from "./iterator";
|
|
4
|
-
import { isReduced } from "./reduced";
|
|
2
|
+
import { compR } from "./compr.js";
|
|
3
|
+
import { iterator } from "./iterator.js";
|
|
4
|
+
import { isReduced } from "./reduced.js";
|
|
5
5
|
export function duplicate(n = 1, src) {
|
|
6
6
|
return isIterable(src)
|
|
7
7
|
? iterator(duplicate(n), src)
|
package/ensure.d.ts
CHANGED
package/every.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Predicate } from "@thi.ng/api";
|
|
2
|
-
import type { Reducer } from "./api";
|
|
2
|
+
import type { Reducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Reducer which applies optional `pred` function to each value and
|
|
5
5
|
* terminates early if the predicate returned a falsy result. If no
|
package/every.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $$reduce, reducer } from "./reduce";
|
|
2
|
-
import { reduced } from "./reduced";
|
|
1
|
+
import { $$reduce, reducer } from "./reduce.js";
|
|
2
|
+
import { reduced } from "./reduced.js";
|
|
3
3
|
export function every(...args) {
|
|
4
4
|
const res = $$reduce(every, args);
|
|
5
5
|
if (res !== undefined) {
|
package/extend-sides.js
CHANGED
package/fill.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NumericArray } from "@thi.ng/api";
|
|
2
|
-
import type { Reducer } from "./api";
|
|
2
|
+
import type { Reducer } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Reducer which starts filling array with results from given `start`
|
|
5
5
|
* index (default: 0). Use {@link (fillN:1)} for typed array targets
|
package/fill.js
CHANGED
package/filter-fuzzy.d.ts
CHANGED
package/filter-fuzzy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fuzzyMatch } from "@thi.ng/arrays/fuzzy-match";
|
|
2
|
-
import { __iter } from "./iterator";
|
|
3
|
-
import { filter } from "./filter";
|
|
2
|
+
import { __iter } from "./iterator.js";
|
|
3
|
+
import { filter } from "./filter.js";
|
|
4
4
|
export function filterFuzzy(...args) {
|
|
5
5
|
const iter = args.length > 1 && __iter(filterFuzzy, args);
|
|
6
6
|
if (iter) {
|
package/filter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Predicate } from "@thi.ng/api";
|
|
2
|
-
import type { Transducer } from "./api";
|
|
2
|
+
import type { Transducer } from "./api.js";
|
|
3
3
|
export declare function filter<T>(pred: Predicate<T>): Transducer<T, T>;
|
|
4
4
|
export declare function filter<T>(pred: Predicate<T>, src: Iterable<T>): IterableIterator<T>;
|
|
5
5
|
//# sourceMappingURL=filter.d.ts.map
|
package/filter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isIterable } from "@thi.ng/checks/is-iterable";
|
|
2
|
-
import { compR } from "./compr";
|
|
3
|
-
import { iterator1 } from "./iterator";
|
|
2
|
+
import { compR } from "./compr.js";
|
|
3
|
+
import { iterator1 } from "./iterator.js";
|
|
4
4
|
export function filter(pred, src) {
|
|
5
5
|
return isIterable(src)
|
|
6
6
|
? iterator1(filter(pred), src)
|
package/flatten-with.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DeepArrayValue, Fn, Nullable } from "@thi.ng/api";
|
|
2
|
-
import type { Transducer } from "./api";
|
|
2
|
+
import type { Transducer } from "./api.js";
|
|
3
3
|
declare type MaybeIterable<T> = Nullable<Iterable<T>>;
|
|
4
4
|
/**
|
|
5
5
|
* Transducer. Takes a function `fn` which will be applied to each input
|
package/flatten-with.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isIterable } from "@thi.ng/checks/is-iterable";
|
|
2
2
|
import { isString } from "@thi.ng/checks/is-string";
|
|
3
|
-
import { compR } from "./compr";
|
|
4
|
-
import { iterator } from "./iterator";
|
|
5
|
-
import { isReduced } from "./reduced";
|
|
3
|
+
import { compR } from "./compr.js";
|
|
4
|
+
import { iterator } from "./iterator.js";
|
|
5
|
+
import { isReduced } from "./reduced.js";
|
|
6
6
|
export function flattenWith(fn, src) {
|
|
7
7
|
return isIterable(src)
|
|
8
8
|
? iterator(flattenWith(fn), isString(src) ? [src] : src)
|
package/flatten.d.ts
CHANGED
package/flatten.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNotStringAndIterable } from "@thi.ng/checks/is-not-string-iterable";
|
|
2
|
-
import { flattenWith } from "./flatten-with";
|
|
2
|
+
import { flattenWith } from "./flatten-with.js";
|
|
3
3
|
export function flatten(src) {
|
|
4
4
|
return flattenWith((x) => (isNotStringAndIterable(x) ? x : undefined), src);
|
|
5
5
|
}
|
package/frequencies.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fn } from "@thi.ng/api";
|
|
2
|
-
import type { Reducer } from "./api";
|
|
2
|
+
import type { Reducer } from "./api.js";
|
|
3
3
|
export declare function frequencies<A>(): Reducer<Map<A, number>, A>;
|
|
4
4
|
export declare function frequencies<A>(xs: Iterable<A>): Map<A, number>;
|
|
5
5
|
export declare function frequencies<A, B>(key: Fn<A, B>): Reducer<Map<B, number>, A>;
|
package/frequencies.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { identity } from "@thi.ng/compose/identity";
|
|
2
|
-
import { count } from "./count";
|
|
3
|
-
import { groupByMap } from "./group-by-map";
|
|
4
|
-
import { $$reduce } from "./reduce";
|
|
2
|
+
import { count } from "./count.js";
|
|
3
|
+
import { groupByMap } from "./group-by-map.js";
|
|
4
|
+
import { $$reduce } from "./reduce.js";
|
|
5
5
|
export function frequencies(...args) {
|
|
6
6
|
return ($$reduce(frequencies, args) ||
|
|
7
7
|
groupByMap({ key: args[0] || identity, group: count() }));
|