@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.
Files changed (247) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +8 -7
  3. package/add.d.ts +1 -1
  4. package/add.js +1 -1
  5. package/api.d.ts +1 -1
  6. package/assoc-map.d.ts +1 -1
  7. package/assoc-map.js +1 -1
  8. package/assoc-obj.d.ts +1 -1
  9. package/assoc-obj.js +1 -1
  10. package/auto-obj.d.ts +1 -1
  11. package/auto-obj.js +1 -1
  12. package/benchmark.d.ts +1 -1
  13. package/benchmark.js +2 -2
  14. package/cat.d.ts +1 -1
  15. package/cat.js +2 -2
  16. package/choices.js +1 -1
  17. package/comp.d.ts +1 -1
  18. package/comp.js +1 -1
  19. package/compr.d.ts +1 -1
  20. package/conj.d.ts +1 -1
  21. package/conj.js +1 -1
  22. package/converge.d.ts +1 -1
  23. package/converge.js +3 -3
  24. package/convolve.d.ts +1 -1
  25. package/convolve.js +7 -7
  26. package/count.d.ts +1 -1
  27. package/count.js +1 -1
  28. package/dedupe.d.ts +1 -1
  29. package/dedupe.js +2 -2
  30. package/deep-transform.d.ts +1 -1
  31. package/delayed.d.ts +1 -1
  32. package/delayed.js +1 -1
  33. package/distinct.d.ts +1 -1
  34. package/distinct.js +2 -2
  35. package/div.d.ts +1 -1
  36. package/div.js +1 -1
  37. package/drop-nth.d.ts +1 -1
  38. package/drop-nth.js +2 -2
  39. package/drop-while.d.ts +1 -1
  40. package/drop-while.js +2 -2
  41. package/drop.d.ts +1 -1
  42. package/drop.js +2 -2
  43. package/dup.js +1 -1
  44. package/duplicate.d.ts +1 -1
  45. package/duplicate.js +3 -3
  46. package/ensure.d.ts +1 -1
  47. package/every.d.ts +1 -1
  48. package/every.js +2 -2
  49. package/extend-sides.js +1 -1
  50. package/fill.d.ts +1 -1
  51. package/fill.js +1 -1
  52. package/filter-fuzzy.d.ts +1 -1
  53. package/filter-fuzzy.js +2 -2
  54. package/filter.d.ts +1 -1
  55. package/filter.js +2 -2
  56. package/flatten-with.d.ts +1 -1
  57. package/flatten-with.js +3 -3
  58. package/flatten.d.ts +1 -1
  59. package/flatten.js +1 -1
  60. package/frequencies.d.ts +1 -1
  61. package/frequencies.js +3 -3
  62. package/group-binary.d.ts +1 -1
  63. package/group-binary.js +2 -2
  64. package/group-by-map.d.ts +1 -1
  65. package/group-by-map.js +2 -2
  66. package/group-by-obj.d.ts +1 -1
  67. package/group-by-obj.js +2 -2
  68. package/index.d.ts +145 -145
  69. package/index.js +145 -145
  70. package/indexed.d.ts +1 -1
  71. package/indexed.js +2 -2
  72. package/interleave.d.ts +1 -1
  73. package/interleave.js +3 -3
  74. package/internal/drain.d.ts +1 -1
  75. package/internal/drain.js +1 -1
  76. package/internal/group-opts.d.ts +1 -1
  77. package/internal/group-opts.js +1 -1
  78. package/internal/mathop.d.ts +1 -1
  79. package/internal/mathop.js +1 -1
  80. package/internal/sort-opts.d.ts +1 -1
  81. package/interpolate-hermite.d.ts +1 -1
  82. package/interpolate-hermite.js +1 -1
  83. package/interpolate-linear.d.ts +1 -1
  84. package/interpolate-linear.js +1 -1
  85. package/interpolate.d.ts +1 -1
  86. package/interpolate.js +6 -6
  87. package/interpose.d.ts +1 -1
  88. package/interpose.js +3 -3
  89. package/iterator.d.ts +1 -1
  90. package/iterator.js +3 -3
  91. package/juxtr.d.ts +1 -1
  92. package/juxtr.js +1 -1
  93. package/keep.d.ts +1 -1
  94. package/keep.js +2 -2
  95. package/key-permutations.js +6 -6
  96. package/key-selector.js +1 -1
  97. package/labeled.d.ts +1 -1
  98. package/labeled.js +2 -2
  99. package/last.d.ts +1 -1
  100. package/last.js +1 -1
  101. package/line.js +2 -2
  102. package/map-deep.d.ts +1 -1
  103. package/map-deep.js +3 -3
  104. package/map-indexed.d.ts +1 -1
  105. package/map-indexed.js +2 -2
  106. package/map-keys.d.ts +1 -1
  107. package/map-keys.js +2 -2
  108. package/map-nth.d.ts +1 -1
  109. package/map-nth.js +2 -2
  110. package/map-vals.d.ts +1 -1
  111. package/map-vals.js +2 -2
  112. package/map.d.ts +1 -1
  113. package/map.js +2 -2
  114. package/mapcat-indexed.d.ts +1 -1
  115. package/mapcat-indexed.js +4 -4
  116. package/mapcat.d.ts +1 -1
  117. package/mapcat.js +4 -4
  118. package/match-first.d.ts +1 -1
  119. package/match-first.js +4 -4
  120. package/match-last.d.ts +1 -1
  121. package/match-last.js +4 -4
  122. package/max-compare.d.ts +1 -1
  123. package/max-compare.js +1 -1
  124. package/max-mag.d.ts +1 -1
  125. package/max-mag.js +1 -1
  126. package/max.d.ts +1 -1
  127. package/max.js +1 -1
  128. package/mean.d.ts +1 -1
  129. package/mean.js +1 -1
  130. package/min-compare.d.ts +1 -1
  131. package/min-compare.js +1 -1
  132. package/min-mag.d.ts +1 -1
  133. package/min-mag.js +1 -1
  134. package/min-max.d.ts +1 -1
  135. package/min-max.js +3 -3
  136. package/min.d.ts +1 -1
  137. package/min.js +1 -1
  138. package/moving-average.d.ts +1 -1
  139. package/moving-average.js +2 -2
  140. package/moving-median.d.ts +1 -1
  141. package/moving-median.js +5 -5
  142. package/mul.d.ts +1 -1
  143. package/mul.js +1 -1
  144. package/multiplex-obj.d.ts +1 -1
  145. package/multiplex-obj.js +4 -4
  146. package/multiplex.d.ts +1 -1
  147. package/multiplex.js +2 -2
  148. package/noop.d.ts +1 -1
  149. package/norm-count.d.ts +1 -1
  150. package/norm-count.js +1 -1
  151. package/norm-frequencies-auto.d.ts +1 -1
  152. package/norm-frequencies-auto.js +2 -2
  153. package/norm-frequencies.d.ts +1 -1
  154. package/norm-frequencies.js +3 -3
  155. package/norm-range.js +1 -1
  156. package/package.json +14 -11
  157. package/pad-last.d.ts +1 -1
  158. package/pad-last.js +2 -2
  159. package/pad-sides.js +2 -2
  160. package/page.d.ts +1 -1
  161. package/page.js +4 -4
  162. package/palindrome.js +3 -3
  163. package/partition-by.d.ts +1 -1
  164. package/partition-by.js +2 -2
  165. package/partition-of.d.ts +1 -1
  166. package/partition-of.js +2 -2
  167. package/partition-sort.d.ts +1 -1
  168. package/partition-sort.js +5 -5
  169. package/partition-sync.d.ts +1 -1
  170. package/partition-sync.js +2 -2
  171. package/partition-time.d.ts +1 -1
  172. package/partition-time.js +2 -2
  173. package/partition-when.d.ts +1 -1
  174. package/partition-when.js +2 -2
  175. package/partition.d.ts +1 -1
  176. package/partition.js +1 -1
  177. package/peek.d.ts +1 -1
  178. package/peek.js +1 -1
  179. package/permutations.js +1 -1
  180. package/pluck.d.ts +1 -1
  181. package/pluck.js +2 -2
  182. package/push-copy.d.ts +1 -1
  183. package/push-copy.js +1 -1
  184. package/push-sort.d.ts +1 -1
  185. package/push.d.ts +1 -1
  186. package/push.js +1 -1
  187. package/range-nd.js +4 -4
  188. package/range.d.ts +2 -2
  189. package/range.js +1 -4
  190. package/range2d.js +1 -1
  191. package/range3d.js +1 -1
  192. package/reduce.d.ts +1 -1
  193. package/reduce.js +1 -1
  194. package/reduced.js +0 -1
  195. package/reductions.d.ts +1 -1
  196. package/reductions.js +2 -2
  197. package/rename.d.ts +1 -1
  198. package/rename.js +6 -6
  199. package/run.d.ts +1 -1
  200. package/run.js +1 -1
  201. package/sample.d.ts +1 -1
  202. package/sample.js +2 -2
  203. package/scan.d.ts +1 -1
  204. package/scan.js +2 -2
  205. package/select-keys.d.ts +1 -1
  206. package/select-keys.js +3 -3
  207. package/side-effect.d.ts +1 -1
  208. package/side-effect.js +1 -1
  209. package/sliding-window.d.ts +1 -1
  210. package/sliding-window.js +2 -2
  211. package/some.d.ts +1 -1
  212. package/some.js +2 -2
  213. package/step.d.ts +1 -1
  214. package/step.js +3 -3
  215. package/str.d.ts +1 -1
  216. package/str.js +1 -1
  217. package/stream-shuffle.d.ts +1 -1
  218. package/stream-shuffle.js +2 -2
  219. package/stream-sort.d.ts +1 -1
  220. package/stream-sort.js +3 -3
  221. package/struct.d.ts +1 -1
  222. package/struct.js +6 -6
  223. package/sub.d.ts +1 -1
  224. package/sub.js +1 -1
  225. package/swizzle.d.ts +1 -1
  226. package/swizzle.js +2 -2
  227. package/take-last.d.ts +1 -1
  228. package/take-last.js +2 -2
  229. package/take-nth.d.ts +1 -1
  230. package/take-nth.js +2 -2
  231. package/take-while.d.ts +1 -1
  232. package/take-while.js +3 -3
  233. package/take.d.ts +1 -1
  234. package/take.js +3 -3
  235. package/throttle-time.d.ts +1 -1
  236. package/throttle-time.js +2 -2
  237. package/throttle.d.ts +1 -1
  238. package/throttle.js +2 -2
  239. package/toggle.d.ts +1 -1
  240. package/toggle.js +1 -1
  241. package/trace.d.ts +1 -1
  242. package/trace.js +1 -1
  243. package/transduce.d.ts +1 -1
  244. package/transduce.js +3 -3
  245. package/tween.js +2 -2
  246. package/word-wrap.d.ts +1 -1
  247. 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://github.com/thi-ng/umbrella/blob/develop/packages/transducers/src/flatten.ts)
98
- is _always_ treating strings as atomic values now, whereas before top-level
99
- strings would be split into individual characters.
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 NodeJS (v14.6+):
172
+ For Node.js REPL:
173
173
 
174
174
  ```text
175
- node --experimental-specifier-resolution=node --experimental-repl-await
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.68 KB
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 | [Demo](https://demo.thi.ng/umbrella/shader-ast-workers/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/shader-ast-workers) |
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
@@ -1,4 +1,4 @@
1
- import type { Reducer } from "./api";
1
+ import type { Reducer } from "./api.js";
2
2
  /**
3
3
  * Reducer to compute sum of values with given `init` value. Default: 0
4
4
  */
package/add.js CHANGED
@@ -1,4 +1,4 @@
1
- import { __mathop } from "./internal/mathop";
1
+ import { __mathop } from "./internal/mathop.js";
2
2
  export function add(...args) {
3
3
  return __mathop(add, (acc, x) => acc + x, 0, args);
4
4
  }
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
@@ -1,5 +1,5 @@
1
1
  import type { Pair } from "@thi.ng/api";
2
- import type { Reducer } from "./api";
2
+ import type { Reducer } from "./api.js";
3
3
  /**
4
4
  * Reducer accepting key-value pairs / tuples and transforming / adding
5
5
  * them to an ES6 Map.
package/assoc-map.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reduce, reducer } from "./reduce";
1
+ import { reduce, reducer } from "./reduce.js";
2
2
  export function assocMap(xs) {
3
3
  return xs
4
4
  ? reduce(assocMap(), xs)
package/assoc-obj.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { IObjectOf, Pair } from "@thi.ng/api";
2
- import type { Reducer } from "./api";
2
+ import type { Reducer } from "./api.js";
3
3
  /**
4
4
  * Reducer accepting key-value pairs / tuples and updating / adding them
5
5
  * to an object.
package/assoc-obj.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reduce, reducer } from "./reduce";
1
+ import { reduce, reducer } from "./reduce.js";
2
2
  export function assocObj(xs) {
3
3
  return xs
4
4
  ? reduce(assocObj(), xs)
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
@@ -1,4 +1,4 @@
1
- import { reduce, reducer } from "./reduce";
1
+ import { reduce, reducer } from "./reduce.js";
2
2
  export function autoObj(prefix, xs) {
3
3
  let id = 0;
4
4
  return xs
package/benchmark.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Transducer } from "./api";
1
+ import type { Transducer } from "./api.js";
2
2
  /**
3
3
  * Stateful transducer. Ignores the actual input values, but
4
4
  * produces time measurements since last value processed,
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
@@ -1,4 +1,4 @@
1
- import type { Transducer, TxLike } from "./api";
1
+ import type { Transducer, TxLike } from "./api.js";
2
2
  /**
3
3
  * Transducer composition. Returns new transducer which applies given
4
4
  * transducers in left-to-right order.
package/comp.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { comp as _comp } from "@thi.ng/compose/comp";
2
- import { ensureTransducer } from "./ensure";
2
+ import { ensureTransducer } from "./ensure.js";
3
3
  export function comp(...fns) {
4
4
  fns = fns.map(ensureTransducer);
5
5
  return _comp.apply(null, fns);
package/compr.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Reducer, ReductionFn } from "./api";
1
+ import type { Reducer, ReductionFn } from "./api.js";
2
2
  /**
3
3
  * Reducer composition helper, internally used by various transducers
4
4
  * during initialization. Takes existing reducer `rfn` (a 3-tuple) and a
package/conj.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Reducer } from "./api";
1
+ import type { Reducer } from "./api.js";
2
2
  /**
3
3
  * Reducer. Like {@link (push:1)}, but for ES6 Sets.
4
4
  */
package/conj.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reduce, reducer } from "./reduce";
1
+ import { reduce, reducer } from "./reduce.js";
2
2
  export function conj(xs) {
3
3
  return xs
4
4
  ? reduce(conj(), xs)
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
@@ -1,4 +1,4 @@
1
- import type { Reducer } from "./api";
1
+ import type { Reducer } from "./api.js";
2
2
  /**
3
3
  * Reducer which ignores incoming values and instead only counts them,
4
4
  * optionally using given `start` and `step` counter values.
package/count.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $$reduce, reducer } from "./reduce";
1
+ import { $$reduce, reducer } from "./reduce.js";
2
2
  export function count(...args) {
3
3
  const res = $$reduce(count, args);
4
4
  if (res !== undefined) {
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) => {
@@ -1,4 +1,4 @@
1
- import type { TransformSpec } from "./api";
1
+ import type { TransformSpec } from "./api.js";
2
2
  /**
3
3
  * Higher-order deep object transformer used by {@link (mapDeep:1)}.
4
4
  * Accepts a nested `spec` array reflecting same key structure as the
package/delayed.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Transducer } from "./api";
1
+ import type { Transducer } from "./api.js";
2
2
  /**
3
3
  * Yields transducer which wraps incoming values in promises, which each
4
4
  * resolve after specified delay time (in ms).
package/delayed.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { delayed as _delayed } from "@thi.ng/compose/delayed";
2
- import { map } from "./map";
2
+ import { map } from "./map.js";
3
3
  /**
4
4
  * Yields transducer which wraps incoming values in promises, which each
5
5
  * resolve after specified delay time (in ms).
package/distinct.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Fn, Fn0 } from "@thi.ng/api";
2
- import type { Transducer } from "./api";
2
+ import type { Transducer } from "./api.js";
3
3
  export interface DistinctOpts<T> {
4
4
  /**
5
5
  * Key extractor function.
package/distinct.js CHANGED
@@ -1,5 +1,5 @@
1
- import { compR } from "./compr";
2
- import { __iter } from "./iterator";
1
+ import { compR } from "./compr.js";
2
+ import { __iter } from "./iterator.js";
3
3
  export function distinct(...args) {
4
4
  return (__iter(distinct, args) ||
5
5
  ((rfn) => {
package/div.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Reducer } from "./api";
1
+ import type { Reducer } from "./api.js";
2
2
  /**
3
3
  * Reducer to compute successive division of values using given `init`
4
4
  * value.
package/div.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reduce, reducer } from "./reduce";
1
+ import { reduce, reducer } from "./reduce.js";
2
2
  export function div(init, xs) {
3
3
  return xs
4
4
  ? reduce(div(init), xs)
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
@@ -1,5 +1,5 @@
1
- import { compR } from "./compr";
2
- import { __iter } from "./iterator";
1
+ import { compR } from "./compr.js";
2
+ import { __iter } from "./iterator.js";
3
3
  export function dropWhile(...args) {
4
4
  return (__iter(dropWhile, args) ||
5
5
  ((rfn) => {
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
@@ -1,3 +1,3 @@
1
- import type { Transducer, TxLike } from "./api";
1
+ import type { Transducer, TxLike } from "./api.js";
2
2
  export declare const ensureTransducer: <A, B>(x: TxLike<A, B>) => Transducer<A, B>;
3
3
  //# sourceMappingURL=ensure.d.ts.map
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
@@ -1,5 +1,5 @@
1
1
  import { SEMAPHORE } from "@thi.ng/api/api";
2
- import { repeat } from "./repeat";
2
+ import { repeat } from "./repeat.js";
3
3
  /**
4
4
  * Yields iterator of given iterable which repeats the first and/or last
5
5
  * value(s) `numLeft`/`numRight` times (default: 1).
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
@@ -1,4 +1,4 @@
1
- import { $$reduce, reducer } from "./reduce";
1
+ import { $$reduce, reducer } from "./reduce.js";
2
2
  export function fill(...args) {
3
3
  const res = $$reduce(fill, args);
4
4
  if (res !== undefined) {
package/filter-fuzzy.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Fn, Predicate2 } from "@thi.ng/api";
2
- import type { Transducer } from "./api";
2
+ import type { Transducer } from "./api.js";
3
3
  export interface FilterFuzzyOpts<A, B> {
4
4
  /**
5
5
  * Key extractor function.
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
@@ -1,5 +1,5 @@
1
1
  import type { DeepArrayValue } from "@thi.ng/api";
2
- import type { Transducer } from "./api";
2
+ import type { Transducer } from "./api.js";
3
3
  /**
4
4
  * Transducer. Recursively flattens input iff it is iterable and NOT a
5
5
  * string.
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() }));