@thi.ng/transducers 7.9.2 → 8.0.4

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 (326) hide show
  1. package/CHANGELOG.md +354 -420
  2. package/README.md +242 -219
  3. package/{rfn/add.d.ts → add.d.ts} +1 -1
  4. package/{rfn/add.js → add.js} +1 -1
  5. package/api.d.ts +1 -1
  6. package/{iter/as-iterable.d.ts → as-iterable.d.ts} +0 -0
  7. package/{iter/as-iterable.js → as-iterable.js} +0 -0
  8. package/{rfn/assoc-map.d.ts → assoc-map.d.ts} +1 -1
  9. package/{rfn/assoc-map.js → assoc-map.js} +1 -1
  10. package/{rfn/assoc-obj.d.ts → assoc-obj.d.ts} +1 -1
  11. package/{rfn/assoc-obj.js → assoc-obj.js} +1 -1
  12. package/{rfn/auto-obj.d.ts → auto-obj.d.ts} +1 -1
  13. package/{rfn/auto-obj.js → auto-obj.js} +1 -1
  14. package/{xform/benchmark.d.ts → benchmark.d.ts} +1 -1
  15. package/{xform/benchmark.js → benchmark.js} +3 -3
  16. package/{xform/cat.d.ts → cat.d.ts} +1 -1
  17. package/{xform/cat.js → cat.js} +2 -2
  18. package/{iter/choices.d.ts → choices.d.ts} +1 -1
  19. package/{iter/choices.js → choices.js} +4 -3
  20. package/{func/comp.d.ts → comp.d.ts} +1 -1
  21. package/{func/comp.js → comp.js} +2 -2
  22. package/{func/compr.d.ts → compr.d.ts} +1 -1
  23. package/{func/compr.js → compr.js} +0 -0
  24. package/{iter/concat.d.ts → concat.d.ts} +0 -0
  25. package/{iter/concat.js → concat.js} +1 -1
  26. package/{rfn/conj.d.ts → conj.d.ts} +1 -1
  27. package/{rfn/conj.js → conj.js} +1 -1
  28. package/{xform/converge.d.ts → converge.d.ts} +2 -2
  29. package/{xform/converge.js → converge.js} +5 -5
  30. package/{xform/convolve.d.ts → convolve.d.ts} +1 -1
  31. package/{xform/convolve.js → convolve.js} +8 -8
  32. package/{rfn/count.d.ts → count.d.ts} +1 -1
  33. package/{rfn/count.js → count.js} +1 -1
  34. package/{iter/curve.d.ts → curve.d.ts} +0 -0
  35. package/{iter/curve.js → curve.js} +0 -0
  36. package/{iter/cycle.d.ts → cycle.d.ts} +0 -0
  37. package/{iter/cycle.js → cycle.js} +0 -0
  38. package/{xform/dedupe.d.ts → dedupe.d.ts} +2 -2
  39. package/{xform/dedupe.js → dedupe.js} +4 -4
  40. package/{func/deep-transform.d.ts → deep-transform.d.ts} +2 -2
  41. package/{func/deep-transform.js → deep-transform.js} +3 -3
  42. package/{xform/delayed.d.ts → delayed.d.ts} +1 -1
  43. package/{xform/delayed.js → delayed.js} +2 -2
  44. package/{xform/distinct.d.ts → distinct.d.ts} +1 -1
  45. package/{xform/distinct.js → distinct.js} +3 -3
  46. package/{rfn/div.d.ts → div.d.ts} +1 -1
  47. package/{rfn/div.js → div.js} +1 -1
  48. package/{xform/drop-nth.d.ts → drop-nth.d.ts} +1 -1
  49. package/{xform/drop-nth.js → drop-nth.js} +4 -4
  50. package/{xform/drop-while.d.ts → drop-while.d.ts} +1 -1
  51. package/{xform/drop-while.js → drop-while.js} +3 -3
  52. package/{xform/drop.d.ts → drop.d.ts} +1 -1
  53. package/{xform/drop.js → drop.js} +3 -3
  54. package/{iter/dup.d.ts → dup.d.ts} +0 -0
  55. package/dup.js +11 -0
  56. package/{xform/duplicate.d.ts → duplicate.d.ts} +1 -1
  57. package/{xform/duplicate.js → duplicate.js} +4 -4
  58. package/ensure.d.ts +3 -0
  59. package/{internal/ensure.js → ensure.js} +1 -1
  60. package/{rfn/every.d.ts → every.d.ts} +1 -1
  61. package/{rfn/every.js → every.js} +2 -2
  62. package/{iter/extend-sides.d.ts → extend-sides.d.ts} +0 -0
  63. package/{iter/extend-sides.js → extend-sides.js} +2 -2
  64. package/{rfn/fill.d.ts → fill.d.ts} +1 -1
  65. package/{rfn/fill.js → fill.js} +1 -1
  66. package/{xform/filter-fuzzy.d.ts → filter-fuzzy.d.ts} +1 -1
  67. package/{xform/filter-fuzzy.js → filter-fuzzy.js} +4 -4
  68. package/{xform/filter.d.ts → filter.d.ts} +1 -1
  69. package/{xform/filter.js → filter.js} +3 -3
  70. package/{xform/flatten-with.d.ts → flatten-with.d.ts} +1 -1
  71. package/{xform/flatten-with.js → flatten-with.js} +5 -4
  72. package/{xform/flatten.d.ts → flatten.d.ts} +1 -1
  73. package/flatten.js +5 -0
  74. package/{rfn/frequencies.d.ts → frequencies.d.ts} +1 -1
  75. package/frequencies.js +8 -0
  76. package/{rfn/group-binary.d.ts → group-binary.d.ts} +1 -1
  77. package/{rfn/group-binary.js → group-binary.js} +3 -3
  78. package/{rfn/group-by-map.d.ts → group-by-map.d.ts} +1 -1
  79. package/{rfn/group-by-map.js → group-by-map.js} +2 -2
  80. package/{rfn/group-by-obj.d.ts → group-by-obj.d.ts} +1 -1
  81. package/{rfn/group-by-obj.js → group-by-obj.js} +2 -2
  82. package/index.d.ts +145 -144
  83. package/index.js +149 -144
  84. package/{xform/indexed.d.ts → indexed.d.ts} +1 -1
  85. package/{xform/indexed.js → indexed.js} +3 -3
  86. package/{xform/interleave.d.ts → interleave.d.ts} +1 -1
  87. package/{xform/interleave.js → interleave.js} +4 -4
  88. package/internal/drain.d.ts +1 -1
  89. package/internal/drain.js +1 -1
  90. package/internal/group-opts.d.ts +1 -1
  91. package/internal/group-opts.js +6 -3
  92. package/internal/mathop.d.ts +1 -1
  93. package/internal/mathop.js +1 -1
  94. package/internal/sort-opts.d.ts +1 -1
  95. package/internal/sort-opts.js +6 -3
  96. package/{xform/interpolate-hermite.d.ts → interpolate-hermite.d.ts} +1 -1
  97. package/{xform/interpolate-hermite.js → interpolate-hermite.js} +2 -2
  98. package/{xform/interpolate-linear.d.ts → interpolate-linear.d.ts} +1 -1
  99. package/{xform/interpolate-linear.js → interpolate-linear.js} +2 -2
  100. package/{xform/interpolate.d.ts → interpolate.d.ts} +1 -1
  101. package/interpolate.js +12 -0
  102. package/{xform/interpose.d.ts → interpose.d.ts} +1 -1
  103. package/{xform/interpose.js → interpose.js} +4 -4
  104. package/{iter/iterate.d.ts → iterate.d.ts} +0 -0
  105. package/{iter/iterate.js → iterate.js} +0 -0
  106. package/iterator.d.ts +3 -3
  107. package/iterator.js +6 -6
  108. package/{func/juxtr.d.ts → juxtr.d.ts} +1 -1
  109. package/{func/juxtr.js → juxtr.js} +1 -1
  110. package/{xform/keep.d.ts → keep.d.ts} +7 -1
  111. package/{xform/keep.js → keep.js} +4 -4
  112. package/{iter/key-permutations.d.ts → key-permutations.d.ts} +0 -0
  113. package/{iter/key-permutations.js → key-permutations.js} +6 -6
  114. package/{func/key-selector.d.ts → key-selector.d.ts} +0 -0
  115. package/{func/key-selector.js → key-selector.js} +1 -1
  116. package/{iter/keys.d.ts → keys.d.ts} +0 -0
  117. package/{iter/keys.js → keys.js} +0 -0
  118. package/{xform/labeled.d.ts → labeled.d.ts} +1 -1
  119. package/labeled.js +9 -0
  120. package/{rfn/last.d.ts → last.d.ts} +1 -1
  121. package/{rfn/last.js → last.js} +2 -2
  122. package/{iter/line.d.ts → line.d.ts} +0 -0
  123. package/{iter/line.js → line.js} +2 -2
  124. package/{func/lookup.d.ts → lookup.d.ts} +0 -0
  125. package/{func/lookup.js → lookup.js} +0 -0
  126. package/{xform/map-deep.d.ts → map-deep.d.ts} +1 -1
  127. package/map-deep.js +9 -0
  128. package/{xform/map-indexed.d.ts → map-indexed.d.ts} +1 -1
  129. package/{xform/map-indexed.js → map-indexed.js} +3 -3
  130. package/{xform/map-keys.d.ts → map-keys.d.ts} +1 -1
  131. package/{xform/map-keys.js → map-keys.js} +3 -3
  132. package/{xform/map-nth.d.ts → map-nth.d.ts} +1 -1
  133. package/{xform/map-nth.js → map-nth.js} +3 -3
  134. package/{xform/map-vals.d.ts → map-vals.d.ts} +1 -1
  135. package/{xform/map-vals.js → map-vals.js} +3 -3
  136. package/{xform/map.d.ts → map.d.ts} +1 -1
  137. package/{xform/map.js → map.js} +3 -3
  138. package/{xform/mapcat-indexed.d.ts → mapcat-indexed.d.ts} +1 -1
  139. package/mapcat-indexed.js +8 -0
  140. package/{xform/mapcat.d.ts → mapcat.d.ts} +1 -1
  141. package/mapcat.js +8 -0
  142. package/{xform/match-first.d.ts → match-first.d.ts} +1 -1
  143. package/match-first.js +10 -0
  144. package/{xform/match-last.d.ts → match-last.d.ts} +1 -1
  145. package/match-last.js +10 -0
  146. package/{rfn/max-compare.d.ts → max-compare.d.ts} +1 -1
  147. package/{rfn/max-compare.js → max-compare.js} +2 -2
  148. package/{rfn/max-mag.d.ts → max-mag.d.ts} +1 -1
  149. package/{rfn/max-mag.js → max-mag.js} +1 -1
  150. package/{rfn/max.d.ts → max.d.ts} +1 -1
  151. package/{rfn/max.js → max.js} +1 -1
  152. package/{rfn/mean.d.ts → mean.d.ts} +1 -1
  153. package/{rfn/mean.js → mean.js} +1 -1
  154. package/{rfn/min-compare.d.ts → min-compare.d.ts} +1 -1
  155. package/{rfn/min-compare.js → min-compare.js} +2 -2
  156. package/{rfn/min-mag.d.ts → min-mag.d.ts} +1 -1
  157. package/{rfn/min-mag.js → min-mag.js} +1 -1
  158. package/{rfn/min-max.d.ts → min-max.d.ts} +1 -1
  159. package/{rfn/min-max.js → min-max.js} +3 -3
  160. package/{rfn/min.d.ts → min.d.ts} +1 -1
  161. package/{rfn/min.js → min.js} +1 -1
  162. package/{xform/moving-average.d.ts → moving-average.d.ts} +1 -1
  163. package/{xform/moving-average.js → moving-average.js} +4 -4
  164. package/{xform/moving-median.d.ts → moving-median.d.ts} +1 -1
  165. package/{xform/moving-median.js → moving-median.js} +6 -6
  166. package/{rfn/mul.d.ts → mul.d.ts} +1 -1
  167. package/{rfn/mul.js → mul.js} +1 -1
  168. package/{xform/multiplex-obj.d.ts → multiplex-obj.d.ts} +1 -1
  169. package/{xform/multiplex-obj.js → multiplex-obj.js} +5 -5
  170. package/{xform/multiplex.d.ts → multiplex.d.ts} +1 -1
  171. package/multiplex.js +6 -0
  172. package/{xform/noop.d.ts → noop.d.ts} +1 -1
  173. package/{xform/noop.js → noop.js} +0 -0
  174. package/{rfn/norm-count.d.ts → norm-count.d.ts} +1 -1
  175. package/{rfn/norm-count.js → norm-count.js} +1 -1
  176. package/{rfn/norm-frequencies-auto.d.ts → norm-frequencies-auto.d.ts} +1 -1
  177. package/{rfn/norm-frequencies-auto.js → norm-frequencies-auto.js} +2 -2
  178. package/{rfn/norm-frequencies.d.ts → norm-frequencies.d.ts} +1 -1
  179. package/{rfn/norm-frequencies.js → norm-frequencies.js} +4 -4
  180. package/{iter/norm-range.d.ts → norm-range.d.ts} +0 -0
  181. package/{iter/norm-range.js → norm-range.js} +1 -1
  182. package/package.json +470 -34
  183. package/{xform/pad-last.d.ts → pad-last.d.ts} +1 -1
  184. package/{xform/pad-last.js → pad-last.js} +3 -3
  185. package/{iter/pad-sides.d.ts → pad-sides.d.ts} +0 -0
  186. package/{iter/pad-sides.js → pad-sides.js} +2 -2
  187. package/{xform/page.d.ts → page.d.ts} +1 -1
  188. package/page.js +8 -0
  189. package/{iter/pairs.d.ts → pairs.d.ts} +0 -0
  190. package/{iter/pairs.js → pairs.js} +0 -0
  191. package/{iter/palindrome.d.ts → palindrome.d.ts} +0 -0
  192. package/palindrome.js +13 -0
  193. package/{xform/partition-by.d.ts → partition-by.d.ts} +2 -2
  194. package/{xform/partition-by.js → partition-by.js} +4 -4
  195. package/{xform/partition-of.d.ts → partition-of.d.ts} +1 -1
  196. package/{xform/partition-of.js → partition-of.js} +3 -3
  197. package/{xform/partition-sort.d.ts → partition-sort.d.ts} +1 -1
  198. package/partition-sort.js +13 -0
  199. package/{xform/partition-sync.d.ts → partition-sync.d.ts} +1 -1
  200. package/{xform/partition-sync.js → partition-sync.js} +15 -8
  201. package/{xform/partition-time.d.ts → partition-time.d.ts} +1 -1
  202. package/{xform/partition-time.js → partition-time.js} +3 -3
  203. package/{xform/partition-when.d.ts → partition-when.d.ts} +1 -1
  204. package/{xform/partition-when.js → partition-when.js} +3 -3
  205. package/{xform/partition.d.ts → partition.d.ts} +1 -1
  206. package/{xform/partition.js → partition.js} +2 -2
  207. package/{xform/peek.d.ts → peek.d.ts} +1 -1
  208. package/peek.js +5 -0
  209. package/{iter/permutations.d.ts → permutations.d.ts} +0 -0
  210. package/{iter/permutations.js → permutations.js} +3 -3
  211. package/{xform/pluck.d.ts → pluck.d.ts} +1 -1
  212. package/pluck.js +8 -0
  213. package/push-copy.d.ts +3 -0
  214. package/{rfn/push-copy.js → push-copy.js} +1 -1
  215. package/{rfn/push-sort.d.ts → push-sort.d.ts} +1 -1
  216. package/{rfn/push-sort.js → push-sort.js} +1 -1
  217. package/{rfn/push.d.ts → push.d.ts} +1 -1
  218. package/{rfn/push.js → push.js} +1 -1
  219. package/{iter/range-nd.d.ts → range-nd.d.ts} +0 -0
  220. package/{iter/range-nd.js → range-nd.js} +4 -4
  221. package/{iter/range.d.ts → range.d.ts} +2 -2
  222. package/{iter/range.js → range.js} +1 -1
  223. package/{iter/range2d.d.ts → range2d.d.ts} +0 -0
  224. package/{iter/range2d.js → range2d.js} +2 -2
  225. package/{iter/range3d.d.ts → range3d.d.ts} +0 -0
  226. package/{iter/range3d.js → range3d.js} +2 -2
  227. package/reduce.d.ts +1 -1
  228. package/reduce.js +5 -3
  229. package/{rfn/reductions.d.ts → reductions.d.ts} +1 -1
  230. package/{rfn/reductions.js → reductions.js} +2 -2
  231. package/{xform/rename.d.ts → rename.d.ts} +1 -1
  232. package/{xform/rename.js → rename.js} +8 -8
  233. package/renamer.d.ts +9 -0
  234. package/{func/renamer.js → renamer.js} +6 -0
  235. package/{iter/repeat.d.ts → repeat.d.ts} +0 -0
  236. package/{iter/repeat.js → repeat.js} +0 -0
  237. package/{iter/repeatedly.d.ts → repeatedly.d.ts} +0 -0
  238. package/{iter/repeatedly.js → repeatedly.js} +0 -0
  239. package/{iter/reverse.d.ts → reverse.d.ts} +0 -0
  240. package/{iter/reverse.js → reverse.js} +1 -1
  241. package/run.d.ts +2 -2
  242. package/run.js +2 -2
  243. package/{xform/sample.d.ts → sample.d.ts} +2 -2
  244. package/{xform/sample.js → sample.js} +4 -4
  245. package/{xform/scan.d.ts → scan.d.ts} +1 -1
  246. package/{xform/scan.js → scan.js} +3 -3
  247. package/{xform/select-keys.d.ts → select-keys.d.ts} +1 -1
  248. package/select-keys.js +9 -0
  249. package/{xform/side-effect.d.ts → side-effect.d.ts} +1 -1
  250. package/{xform/side-effect.js → side-effect.js} +1 -1
  251. package/{xform/sliding-window.d.ts → sliding-window.d.ts} +2 -2
  252. package/{xform/sliding-window.js → sliding-window.js} +4 -4
  253. package/{rfn/some.d.ts → some.d.ts} +1 -1
  254. package/{rfn/some.js → some.js} +2 -2
  255. package/{iter/sorted-keys.d.ts → sorted-keys.d.ts} +0 -0
  256. package/{iter/sorted-keys.js → sorted-keys.js} +1 -1
  257. package/step.d.ts +1 -1
  258. package/step.js +3 -3
  259. package/{rfn/str.d.ts → str.d.ts} +1 -1
  260. package/{rfn/str.js → str.js} +1 -1
  261. package/{xform/stream-shuffle.d.ts → stream-shuffle.d.ts} +1 -1
  262. package/{xform/stream-shuffle.js → stream-shuffle.js} +4 -4
  263. package/{xform/stream-sort.d.ts → stream-sort.d.ts} +1 -1
  264. package/{xform/stream-sort.js → stream-sort.js} +5 -5
  265. package/{xform/struct.d.ts → struct.d.ts} +1 -1
  266. package/{xform/struct.js → struct.js} +7 -7
  267. package/{rfn/sub.d.ts → sub.d.ts} +1 -1
  268. package/{rfn/sub.js → sub.js} +1 -1
  269. package/{xform/swizzle.d.ts → swizzle.d.ts} +1 -1
  270. package/swizzle.js +9 -0
  271. package/{iter/symmetric.d.ts → symmetric.d.ts} +0 -0
  272. package/{iter/symmetric.js → symmetric.js} +0 -0
  273. package/{xform/take-last.d.ts → take-last.d.ts} +1 -1
  274. package/{xform/take-last.js → take-last.js} +3 -3
  275. package/{xform/take-nth.d.ts → take-nth.d.ts} +1 -1
  276. package/{xform/take-nth.js → take-nth.js} +4 -4
  277. package/{xform/take-while.d.ts → take-while.d.ts} +1 -1
  278. package/{xform/take-while.js → take-while.js} +4 -4
  279. package/{xform/take.d.ts → take.d.ts} +1 -1
  280. package/{xform/take.js → take.js} +4 -4
  281. package/{xform/throttle-time.d.ts → throttle-time.d.ts} +1 -1
  282. package/{xform/throttle-time.js → throttle-time.js} +3 -3
  283. package/{xform/throttle.d.ts → throttle.d.ts} +1 -1
  284. package/{xform/throttle.js → throttle.js} +3 -3
  285. package/{xform/toggle.d.ts → toggle.d.ts} +1 -1
  286. package/{xform/toggle.js → toggle.js} +2 -2
  287. package/trace.d.ts +3 -0
  288. package/{xform/trace.js → trace.js} +1 -1
  289. package/transduce.d.ts +1 -1
  290. package/transduce.js +4 -4
  291. package/{iter/tween.d.ts → tween.d.ts} +0 -0
  292. package/{iter/tween.js → tween.js} +2 -2
  293. package/{iter/vals.d.ts → vals.d.ts} +0 -0
  294. package/{iter/vals.js → vals.js} +0 -0
  295. package/{xform/word-wrap.d.ts → word-wrap.d.ts} +1 -1
  296. package/{xform/word-wrap.js → word-wrap.js} +8 -4
  297. package/{iter/wrap-sides.d.ts → wrap-sides.d.ts} +0 -0
  298. package/{iter/wrap-sides.js → wrap-sides.js} +3 -3
  299. package/{iter/zip.d.ts → zip.d.ts} +0 -0
  300. package/{iter/zip.js → zip.js} +0 -0
  301. package/func/renamer.d.ts +0 -3
  302. package/internal/ensure.d.ts +0 -3
  303. package/iter/dup.js +0 -10
  304. package/iter/palindrome.js +0 -12
  305. package/lib/index.js +0 -2228
  306. package/lib/index.js.map +0 -1
  307. package/lib/index.umd.js +0 -1
  308. package/lib/index.umd.js.map +0 -1
  309. package/rfn/frequencies.js +0 -8
  310. package/rfn/push-copy.d.ts +0 -3
  311. package/xform/flatten.js +0 -5
  312. package/xform/interpolate.js +0 -13
  313. package/xform/labeled.js +0 -8
  314. package/xform/map-deep.js +0 -9
  315. package/xform/mapcat-indexed.js +0 -8
  316. package/xform/mapcat.js +0 -8
  317. package/xform/match-first.js +0 -10
  318. package/xform/match-last.js +0 -10
  319. package/xform/multiplex.js +0 -6
  320. package/xform/page.js +0 -8
  321. package/xform/partition-sort.js +0 -13
  322. package/xform/peek.js +0 -5
  323. package/xform/pluck.js +0 -8
  324. package/xform/select-keys.js +0 -9
  325. package/xform/swizzle.js +0 -9
  326. package/xform/trace.d.ts +0 -3
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thi.ng/transducers",
3
- "version": "7.9.2",
3
+ "version": "8.0.4",
4
4
  "description": "Lightweight transducer implementations for ES6 / TypeScript",
5
+ "type": "module",
5
6
  "module": "./index.js",
6
- "main": "./lib/index.js",
7
- "umd:main": "./lib/index.umd.js",
8
7
  "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
@@ -24,39 +24,28 @@
24
24
  "author": "Karsten Schmidt <k+npm@thi.ng>",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
- "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
28
- "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
29
- "build:es6": "tsc --declaration",
30
- "build:test": "rimraf build && tsc -p test/tsconfig.json",
31
- "build:check": "tsc --isolatedModules --noEmit",
32
- "test": "mocha test",
33
- "cover": "nyc mocha test && nyc report --reporter=lcov",
34
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib func internal iter rfn xform",
35
- "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
36
- "doc": "typedoc --excludePrivate --out doc --theme ../../tools/doc/typedoc-theme src/index.ts",
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf *.js *.d.ts *.map doc internal",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
37
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
38
- "pub": "yarn build:release && yarn publish --access public"
31
+ "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
+ "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
+ "pub": "yarn build && yarn publish --access public",
34
+ "test": "testament test"
39
35
  },
40
36
  "dependencies": {
41
- "@thi.ng/api": "^7.2.0",
42
- "@thi.ng/arrays": "^1.0.3",
43
- "@thi.ng/checks": "^2.9.11",
44
- "@thi.ng/compare": "^1.3.34",
45
- "@thi.ng/compose": "^1.4.36",
46
- "@thi.ng/errors": "^1.3.4",
47
- "@thi.ng/math": "^4.0.6",
48
- "@thi.ng/random": "^2.4.8"
37
+ "@thi.ng/api": "^8.0.4",
38
+ "@thi.ng/arrays": "^2.0.4",
39
+ "@thi.ng/checks": "^3.0.4",
40
+ "@thi.ng/compare": "^2.0.4",
41
+ "@thi.ng/compose": "^2.0.4",
42
+ "@thi.ng/errors": "^2.0.4",
43
+ "@thi.ng/math": "^5.0.4",
44
+ "@thi.ng/random": "^3.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "@thi.ng/testament": "^0.1.4"
49
48
  },
50
- "files": [
51
- "*.js",
52
- "*.d.ts",
53
- "lib",
54
- "func",
55
- "internal",
56
- "iter",
57
- "rfn",
58
- "xform"
59
- ],
60
49
  "keywords": [
61
50
  "2d",
62
51
  "3d",
@@ -96,7 +85,454 @@
96
85
  "publishConfig": {
97
86
  "access": "public"
98
87
  },
99
- "sideEffects": false,
88
+ "engines": {
89
+ "node": ">=12.7"
90
+ },
91
+ "files": [
92
+ "*.js",
93
+ "*.d.ts",
94
+ "internal"
95
+ ],
96
+ "exports": {
97
+ ".": {
98
+ "import": "./index.js"
99
+ },
100
+ "./add": {
101
+ "import": "./add.js"
102
+ },
103
+ "./api": {
104
+ "import": "./api.js"
105
+ },
106
+ "./as-iterable": {
107
+ "import": "./as-iterable.js"
108
+ },
109
+ "./assoc-map": {
110
+ "import": "./assoc-map.js"
111
+ },
112
+ "./assoc-obj": {
113
+ "import": "./assoc-obj.js"
114
+ },
115
+ "./auto-obj": {
116
+ "import": "./auto-obj.js"
117
+ },
118
+ "./benchmark": {
119
+ "import": "./benchmark.js"
120
+ },
121
+ "./cat": {
122
+ "import": "./cat.js"
123
+ },
124
+ "./choices": {
125
+ "import": "./choices.js"
126
+ },
127
+ "./comp": {
128
+ "import": "./comp.js"
129
+ },
130
+ "./compr": {
131
+ "import": "./compr.js"
132
+ },
133
+ "./concat": {
134
+ "import": "./concat.js"
135
+ },
136
+ "./conj": {
137
+ "import": "./conj.js"
138
+ },
139
+ "./converge": {
140
+ "import": "./converge.js"
141
+ },
142
+ "./convolve": {
143
+ "import": "./convolve.js"
144
+ },
145
+ "./count": {
146
+ "import": "./count.js"
147
+ },
148
+ "./curve": {
149
+ "import": "./curve.js"
150
+ },
151
+ "./cycle": {
152
+ "import": "./cycle.js"
153
+ },
154
+ "./dedupe": {
155
+ "import": "./dedupe.js"
156
+ },
157
+ "./deep-transform": {
158
+ "import": "./deep-transform.js"
159
+ },
160
+ "./delayed": {
161
+ "import": "./delayed.js"
162
+ },
163
+ "./distinct": {
164
+ "import": "./distinct.js"
165
+ },
166
+ "./div": {
167
+ "import": "./div.js"
168
+ },
169
+ "./drop-nth": {
170
+ "import": "./drop-nth.js"
171
+ },
172
+ "./drop-while": {
173
+ "import": "./drop-while.js"
174
+ },
175
+ "./drop": {
176
+ "import": "./drop.js"
177
+ },
178
+ "./dup": {
179
+ "import": "./dup.js"
180
+ },
181
+ "./duplicate": {
182
+ "import": "./duplicate.js"
183
+ },
184
+ "./ensure": {
185
+ "import": "./ensure.js"
186
+ },
187
+ "./every": {
188
+ "import": "./every.js"
189
+ },
190
+ "./extend-sides": {
191
+ "import": "./extend-sides.js"
192
+ },
193
+ "./fill": {
194
+ "import": "./fill.js"
195
+ },
196
+ "./filter-fuzzy": {
197
+ "import": "./filter-fuzzy.js"
198
+ },
199
+ "./filter": {
200
+ "import": "./filter.js"
201
+ },
202
+ "./flatten-with": {
203
+ "import": "./flatten-with.js"
204
+ },
205
+ "./flatten": {
206
+ "import": "./flatten.js"
207
+ },
208
+ "./frequencies": {
209
+ "import": "./frequencies.js"
210
+ },
211
+ "./group-binary": {
212
+ "import": "./group-binary.js"
213
+ },
214
+ "./group-by-map": {
215
+ "import": "./group-by-map.js"
216
+ },
217
+ "./group-by-obj": {
218
+ "import": "./group-by-obj.js"
219
+ },
220
+ "./indexed": {
221
+ "import": "./indexed.js"
222
+ },
223
+ "./interleave": {
224
+ "import": "./interleave.js"
225
+ },
226
+ "./interpolate-hermite": {
227
+ "import": "./interpolate-hermite.js"
228
+ },
229
+ "./interpolate-linear": {
230
+ "import": "./interpolate-linear.js"
231
+ },
232
+ "./interpolate": {
233
+ "import": "./interpolate.js"
234
+ },
235
+ "./interpose": {
236
+ "import": "./interpose.js"
237
+ },
238
+ "./iterate": {
239
+ "import": "./iterate.js"
240
+ },
241
+ "./iterator": {
242
+ "import": "./iterator.js"
243
+ },
244
+ "./juxtr": {
245
+ "import": "./juxtr.js"
246
+ },
247
+ "./keep": {
248
+ "import": "./keep.js"
249
+ },
250
+ "./key-permutations": {
251
+ "import": "./key-permutations.js"
252
+ },
253
+ "./key-selector": {
254
+ "import": "./key-selector.js"
255
+ },
256
+ "./keys": {
257
+ "import": "./keys.js"
258
+ },
259
+ "./labeled": {
260
+ "import": "./labeled.js"
261
+ },
262
+ "./last": {
263
+ "import": "./last.js"
264
+ },
265
+ "./line": {
266
+ "import": "./line.js"
267
+ },
268
+ "./lookup": {
269
+ "import": "./lookup.js"
270
+ },
271
+ "./map-deep": {
272
+ "import": "./map-deep.js"
273
+ },
274
+ "./map-indexed": {
275
+ "import": "./map-indexed.js"
276
+ },
277
+ "./map-keys": {
278
+ "import": "./map-keys.js"
279
+ },
280
+ "./map-nth": {
281
+ "import": "./map-nth.js"
282
+ },
283
+ "./map-vals": {
284
+ "import": "./map-vals.js"
285
+ },
286
+ "./map": {
287
+ "import": "./map.js"
288
+ },
289
+ "./mapcat-indexed": {
290
+ "import": "./mapcat-indexed.js"
291
+ },
292
+ "./mapcat": {
293
+ "import": "./mapcat.js"
294
+ },
295
+ "./match-first": {
296
+ "import": "./match-first.js"
297
+ },
298
+ "./match-last": {
299
+ "import": "./match-last.js"
300
+ },
301
+ "./max-compare": {
302
+ "import": "./max-compare.js"
303
+ },
304
+ "./max-mag": {
305
+ "import": "./max-mag.js"
306
+ },
307
+ "./max": {
308
+ "import": "./max.js"
309
+ },
310
+ "./mean": {
311
+ "import": "./mean.js"
312
+ },
313
+ "./min-compare": {
314
+ "import": "./min-compare.js"
315
+ },
316
+ "./min-mag": {
317
+ "import": "./min-mag.js"
318
+ },
319
+ "./min-max": {
320
+ "import": "./min-max.js"
321
+ },
322
+ "./min": {
323
+ "import": "./min.js"
324
+ },
325
+ "./moving-average": {
326
+ "import": "./moving-average.js"
327
+ },
328
+ "./moving-median": {
329
+ "import": "./moving-median.js"
330
+ },
331
+ "./mul": {
332
+ "import": "./mul.js"
333
+ },
334
+ "./multiplex-obj": {
335
+ "import": "./multiplex-obj.js"
336
+ },
337
+ "./multiplex": {
338
+ "import": "./multiplex.js"
339
+ },
340
+ "./noop": {
341
+ "import": "./noop.js"
342
+ },
343
+ "./norm-count": {
344
+ "import": "./norm-count.js"
345
+ },
346
+ "./norm-frequencies-auto": {
347
+ "import": "./norm-frequencies-auto.js"
348
+ },
349
+ "./norm-frequencies": {
350
+ "import": "./norm-frequencies.js"
351
+ },
352
+ "./norm-range": {
353
+ "import": "./norm-range.js"
354
+ },
355
+ "./pad-last": {
356
+ "import": "./pad-last.js"
357
+ },
358
+ "./pad-sides": {
359
+ "import": "./pad-sides.js"
360
+ },
361
+ "./page": {
362
+ "import": "./page.js"
363
+ },
364
+ "./pairs": {
365
+ "import": "./pairs.js"
366
+ },
367
+ "./palindrome": {
368
+ "import": "./palindrome.js"
369
+ },
370
+ "./partition-by": {
371
+ "import": "./partition-by.js"
372
+ },
373
+ "./partition-of": {
374
+ "import": "./partition-of.js"
375
+ },
376
+ "./partition-sort": {
377
+ "import": "./partition-sort.js"
378
+ },
379
+ "./partition-sync": {
380
+ "import": "./partition-sync.js"
381
+ },
382
+ "./partition-time": {
383
+ "import": "./partition-time.js"
384
+ },
385
+ "./partition-when": {
386
+ "import": "./partition-when.js"
387
+ },
388
+ "./partition": {
389
+ "import": "./partition.js"
390
+ },
391
+ "./peek": {
392
+ "import": "./peek.js"
393
+ },
394
+ "./permutations": {
395
+ "import": "./permutations.js"
396
+ },
397
+ "./pluck": {
398
+ "import": "./pluck.js"
399
+ },
400
+ "./push-copy": {
401
+ "import": "./push-copy.js"
402
+ },
403
+ "./push-sort": {
404
+ "import": "./push-sort.js"
405
+ },
406
+ "./push": {
407
+ "import": "./push.js"
408
+ },
409
+ "./range-nd": {
410
+ "import": "./range-nd.js"
411
+ },
412
+ "./range": {
413
+ "import": "./range.js"
414
+ },
415
+ "./range2d": {
416
+ "import": "./range2d.js"
417
+ },
418
+ "./range3d": {
419
+ "import": "./range3d.js"
420
+ },
421
+ "./reduce": {
422
+ "import": "./reduce.js"
423
+ },
424
+ "./reduced": {
425
+ "import": "./reduced.js"
426
+ },
427
+ "./reductions": {
428
+ "import": "./reductions.js"
429
+ },
430
+ "./rename": {
431
+ "import": "./rename.js"
432
+ },
433
+ "./renamer": {
434
+ "import": "./renamer.js"
435
+ },
436
+ "./repeat": {
437
+ "import": "./repeat.js"
438
+ },
439
+ "./repeatedly": {
440
+ "import": "./repeatedly.js"
441
+ },
442
+ "./reverse": {
443
+ "import": "./reverse.js"
444
+ },
445
+ "./run": {
446
+ "import": "./run.js"
447
+ },
448
+ "./sample": {
449
+ "import": "./sample.js"
450
+ },
451
+ "./scan": {
452
+ "import": "./scan.js"
453
+ },
454
+ "./select-keys": {
455
+ "import": "./select-keys.js"
456
+ },
457
+ "./side-effect": {
458
+ "import": "./side-effect.js"
459
+ },
460
+ "./sliding-window": {
461
+ "import": "./sliding-window.js"
462
+ },
463
+ "./some": {
464
+ "import": "./some.js"
465
+ },
466
+ "./sorted-keys": {
467
+ "import": "./sorted-keys.js"
468
+ },
469
+ "./step": {
470
+ "import": "./step.js"
471
+ },
472
+ "./str": {
473
+ "import": "./str.js"
474
+ },
475
+ "./stream-shuffle": {
476
+ "import": "./stream-shuffle.js"
477
+ },
478
+ "./stream-sort": {
479
+ "import": "./stream-sort.js"
480
+ },
481
+ "./struct": {
482
+ "import": "./struct.js"
483
+ },
484
+ "./sub": {
485
+ "import": "./sub.js"
486
+ },
487
+ "./swizzle": {
488
+ "import": "./swizzle.js"
489
+ },
490
+ "./symmetric": {
491
+ "import": "./symmetric.js"
492
+ },
493
+ "./take-last": {
494
+ "import": "./take-last.js"
495
+ },
496
+ "./take-nth": {
497
+ "import": "./take-nth.js"
498
+ },
499
+ "./take-while": {
500
+ "import": "./take-while.js"
501
+ },
502
+ "./take": {
503
+ "import": "./take.js"
504
+ },
505
+ "./throttle-time": {
506
+ "import": "./throttle-time.js"
507
+ },
508
+ "./throttle": {
509
+ "import": "./throttle.js"
510
+ },
511
+ "./toggle": {
512
+ "import": "./toggle.js"
513
+ },
514
+ "./trace": {
515
+ "import": "./trace.js"
516
+ },
517
+ "./transduce": {
518
+ "import": "./transduce.js"
519
+ },
520
+ "./tween": {
521
+ "import": "./tween.js"
522
+ },
523
+ "./vals": {
524
+ "import": "./vals.js"
525
+ },
526
+ "./word-wrap": {
527
+ "import": "./word-wrap.js"
528
+ },
529
+ "./wrap-sides": {
530
+ "import": "./wrap-sides.js"
531
+ },
532
+ "./zip": {
533
+ "import": "./zip.js"
534
+ }
535
+ },
100
536
  "thi.ng": {
101
537
  "blog": [
102
538
  {
@@ -123,5 +559,5 @@
123
559
  ],
124
560
  "year": 2016
125
561
  },
126
- "gitHead": "d971cb3f9b215a95483f78f1a8614015e331146f"
562
+ "gitHead": "9ff00a103f76cc4917ef3f244132e218f2300a05"
127
563
  }
@@ -1,4 +1,4 @@
1
- import type { Transducer } from "../api";
1
+ import type { Transducer } from "./api.js";
2
2
  /**
3
3
  * Ensures the total number of transformed values will be multiples of
4
4
  * `n`.
@@ -1,6 +1,6 @@
1
- import { isIterable } from "@thi.ng/checks";
2
- import { iterator } from "../iterator";
3
- import { isReduced } from "../reduced";
1
+ import { isIterable } from "@thi.ng/checks/is-iterable";
2
+ import { iterator } from "./iterator.js";
3
+ import { isReduced } from "./reduced.js";
4
4
  export function padLast(n, fill, src) {
5
5
  return isIterable(src)
6
6
  ? iterator(padLast(n, fill), src)
File without changes
@@ -1,5 +1,5 @@
1
- import { concat } from "./concat";
2
- import { repeat } from "./repeat";
1
+ import { concat } from "./concat.js";
2
+ import { repeat } from "./repeat.js";
3
3
  /**
4
4
  * Returns iterator of `src` padded with value `x`, repeated
5
5
  * `numLeft`/`numRight` times (default: 1). By default both sides are
@@ -1,4 +1,4 @@
1
- import type { Transducer } from "../api";
1
+ import type { Transducer } from "./api.js";
2
2
  /**
3
3
  * Pagination helper. Returns transducer which extracts only items for
4
4
  * given page number (and page length, default 10).
package/page.js ADDED
@@ -0,0 +1,8 @@
1
+ import { comp } from "./comp.js";
2
+ import { drop } from "./drop.js";
3
+ import { __iter } from "./iterator.js";
4
+ import { take } from "./take.js";
5
+ export function page(...args) {
6
+ return (__iter(page, args) ||
7
+ comp(drop(args[0] * (args[1] || 10)), take(args[1] || 10)));
8
+ }
File without changes
File without changes
File without changes
package/palindrome.js ADDED
@@ -0,0 +1,13 @@
1
+ import { ensureArray } from "@thi.ng/arrays/ensure-array";
2
+ import { isArray } from "@thi.ng/checks/is-array";
3
+ import { isString } from "@thi.ng/checks/is-string";
4
+ import { concat } from "./concat.js";
5
+ import { reverse } from "./reverse.js";
6
+ import { str } from "./str.js";
7
+ export function palindrome(x) {
8
+ return isString(x)
9
+ ? str("", concat([x], reverse(x)))
10
+ : isArray(x)
11
+ ? x.concat(x.slice().reverse())
12
+ : ((x = ensureArray(x)), concat(x, reverse(x)));
13
+ }
@@ -1,5 +1,5 @@
1
- import { Fn } from "@thi.ng/api";
2
- import type { Transducer } from "../api";
1
+ import type { Fn } from "@thi.ng/api";
2
+ import type { Transducer } from "./api.js";
3
3
  /**
4
4
  * Transducer. Applies given `fn` to each incoming value and collects
5
5
  * values until the return value of the `fn` has changed. Once this
@@ -1,8 +1,8 @@
1
- import { SEMAPHORE } from "@thi.ng/api";
2
- import { $iter, iterator } from "../iterator";
3
- import { isReduced } from "../reduced";
1
+ import { SEMAPHORE } from "@thi.ng/api/api";
2
+ import { __iter, iterator } from "./iterator.js";
3
+ import { isReduced } from "./reduced.js";
4
4
  export function partitionBy(...args) {
5
- return ($iter(partitionBy, args, iterator) ||
5
+ return (__iter(partitionBy, args, iterator) ||
6
6
  (([init, complete, reduce]) => {
7
7
  const fn = args[0];
8
8
  const f = args[1] === true ? fn() : fn;
@@ -1,4 +1,4 @@
1
- import type { Transducer } from "../api";
1
+ import type { Transducer } from "./api.js";
2
2
  /**
3
3
  * Transducer. Yields cyclic sequence of user defined variable sized
4
4
  * chunks. The last partition emitted is allowed to be incomplete.
@@ -1,6 +1,6 @@
1
- import { isIterable } from "@thi.ng/checks";
2
- import { iterator } from "../iterator";
3
- import { partitionBy } from "./partition-by";
1
+ import { isIterable } from "@thi.ng/checks/is-iterable";
2
+ import { iterator } from "./iterator.js";
3
+ import { partitionBy } from "./partition-by.js";
4
4
  export function partitionOf(sizes, src) {
5
5
  return isIterable(src)
6
6
  ? iterator(partitionOf(sizes), src)
@@ -1,4 +1,4 @@
1
- import type { SortOpts, Transducer } from "../api";
1
+ import type { SortOpts, Transducer } from "./api.js";
2
2
  /**
3
3
  * Transducer. Composition of {@link (partition:1)} and
4
4
  * {@link (mapcat:1)} which yields a **partially** sorted sequence of
@@ -0,0 +1,13 @@
1
+ import { comp } from "./comp.js";
2
+ import { __sortOpts } from "./internal/sort-opts.js";
3
+ import { __iter, iterator } from "./iterator.js";
4
+ import { mapcat } from "./mapcat.js";
5
+ import { partition } from "./partition.js";
6
+ export function partitionSort(...args) {
7
+ const iter = __iter(partitionSort, args, iterator);
8
+ if (iter) {
9
+ return iter;
10
+ }
11
+ const { key, compare } = __sortOpts(args[1]);
12
+ return comp(partition(args[0], true), mapcat((window) => window.slice().sort((a, b) => compare(key(a), key(b)))));
13
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Fn, IObjectOf } from "@thi.ng/api";
2
- import type { Transducer } from "../api";
2
+ import type { Transducer } from "./api.js";
3
3
  export interface PartitionSync<T> extends Transducer<T, IObjectOf<T>> {
4
4
  /**
5
5
  * Returns set of currently required input IDs.