@thi.ng/transducers
Advanced tools
Comparing version 9.0.4 to 9.0.5
# Change Log | ||
- **Last updated**: 2024-04-25T19:44:55Z | ||
- **Last updated**: 2024-05-08T18:24:31Z | ||
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub) | ||
@@ -5,0 +5,0 @@ |
const consume = (src) => { | ||
for (let _ of src) | ||
; | ||
for (let _ of src) ; | ||
}; | ||
@@ -5,0 +4,0 @@ export { |
function* cycle(input, num = Infinity) { | ||
if (num < 1) | ||
return; | ||
if (num < 1) return; | ||
let cache = []; | ||
@@ -5,0 +4,0 @@ for (let i of input) { |
@@ -66,3 +66,3 @@ import type { TransformSpec } from "./api.js"; | ||
*/ | ||
export declare const deepTransform: (spec: TransformSpec) => (x: any) => any; | ||
export declare const deepTransform: (spec: TransformSpec) => ((x: any) => any); | ||
//# sourceMappingURL=deep-transform.d.ts.map |
@@ -5,4 +5,3 @@ import { __groupByOpts } from "./internal/group-opts.js"; | ||
const res = $$reduce(groupByMap, args); | ||
if (res !== void 0) | ||
return res; | ||
if (res !== void 0) return res; | ||
const opts = __groupByOpts(args[0]); | ||
@@ -9,0 +8,0 @@ const [init, complete, reduce] = opts.group; |
@@ -5,4 +5,3 @@ import { __groupByOpts } from "./internal/group-opts.js"; | ||
const res = $$reduce(groupByObj, args); | ||
if (res) | ||
return res; | ||
if (res) return res; | ||
const opts = __groupByOpts(args[0]); | ||
@@ -9,0 +8,0 @@ const [_init, complete, _reduce] = opts.group; |
@@ -8,4 +8,3 @@ import { comp } from "./comp.js"; | ||
const iter = __iter(movingMedian, args); | ||
if (iter) | ||
return iter; | ||
if (iter) return iter; | ||
const { key, compare } = __sortOpts(args[1]); | ||
@@ -12,0 +11,0 @@ const n = args[0]; |
import { $$reduce } from "./reduce.js"; | ||
function normCount(...args) { | ||
const res = $$reduce(normCount, args); | ||
if (res !== void 0) | ||
return res; | ||
if (res !== void 0) return res; | ||
const norm = args[0]; | ||
@@ -7,0 +6,0 @@ return [() => 0, (acc) => acc / norm, (acc) => acc + 1]; |
@@ -5,4 +5,3 @@ import { frequencies } from "./frequencies.js"; | ||
const res = $$reduce(normFrequenciesAuto, args); | ||
if (res !== void 0) | ||
return res; | ||
if (res !== void 0) return res; | ||
const [init, complete, reduce] = frequencies(...args); | ||
@@ -9,0 +8,0 @@ let norm = 0; |
{ | ||
"name": "@thi.ng/transducers", | ||
"version": "9.0.4", | ||
"version": "9.0.5", | ||
"description": "Lightweight transducer implementations for ES6 / TypeScript", | ||
@@ -43,16 +43,16 @@ "type": "module", | ||
"dependencies": { | ||
"@thi.ng/api": "^8.11.1", | ||
"@thi.ng/arrays": "^2.9.5", | ||
"@thi.ng/checks": "^3.6.3", | ||
"@thi.ng/compare": "^2.3.4", | ||
"@thi.ng/compose": "^3.0.3", | ||
"@thi.ng/errors": "^2.5.6", | ||
"@thi.ng/math": "^5.10.12", | ||
"@thi.ng/random": "^3.7.5" | ||
"@thi.ng/api": "^8.11.2", | ||
"@thi.ng/arrays": "^2.9.6", | ||
"@thi.ng/checks": "^3.6.4", | ||
"@thi.ng/compare": "^2.3.5", | ||
"@thi.ng/compose": "^3.0.4", | ||
"@thi.ng/errors": "^2.5.7", | ||
"@thi.ng/math": "^5.10.13", | ||
"@thi.ng/random": "^3.8.0" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.43.0", | ||
"esbuild": "^0.20.2", | ||
"typedoc": "^0.25.12", | ||
"typescript": "^5.4.3" | ||
"@microsoft/api-extractor": "^7.43.2", | ||
"esbuild": "^0.21.1", | ||
"typedoc": "^0.25.13", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -593,3 +593,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "aed3421c21044c005fbcb7cc37965ccf85a870d2\n" | ||
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n" | ||
} |
@@ -8,4 +8,3 @@ import { isArray } from "@thi.ng/checks/is-array"; | ||
const iter = __iter(partitionSync, args, iterator); | ||
if (iter) | ||
return iter; | ||
if (iter) return iter; | ||
const { | ||
@@ -81,4 +80,3 @@ key = identity, | ||
first = false; | ||
if (isReduced(acc)) | ||
break; | ||
if (isReduced(acc)) break; | ||
} | ||
@@ -112,7 +110,5 @@ } | ||
const requiredInputs = (required, curr) => { | ||
if (curr.size < required.size) | ||
return false; | ||
if (curr.size < required.size) return false; | ||
for (let id of required) { | ||
if (!curr.has(id)) | ||
return false; | ||
if (!curr.has(id)) return false; | ||
} | ||
@@ -119,0 +115,0 @@ return true; |
@@ -5,4 +5,3 @@ import { iterator, __iter } from "./iterator.js"; | ||
const iter = __iter(rechunk, args, iterator); | ||
if (iter) | ||
return iter; | ||
if (iter) return iter; | ||
return ([init, complete, reduce]) => { | ||
@@ -14,4 +13,3 @@ let buf = ""; | ||
(acc) => { | ||
if (buf) | ||
acc = reduce(acc, buf); | ||
if (buf) acc = reduce(acc, buf); | ||
return complete(acc); | ||
@@ -18,0 +16,0 @@ }, |
@@ -6,4 +6,3 @@ import { deref } from "@thi.ng/api/deref"; | ||
const iter = __iter(slidingWindow, args); | ||
if (iter) | ||
return iter; | ||
if (iter) return iter; | ||
const size = args[0]; | ||
@@ -10,0 +9,0 @@ const partial = args[1] !== false; |
@@ -5,4 +5,3 @@ import { $$reduce, reducer } from "./reduce.js"; | ||
const res = $$reduce(some, args); | ||
if (res !== void 0) | ||
return res; | ||
if (res !== void 0) return res; | ||
const pred = args[0]; | ||
@@ -9,0 +8,0 @@ return reducer( |
@@ -7,4 +7,3 @@ import { normRange } from "./norm-range.js"; | ||
let l = stops.length; | ||
if (l < 1) | ||
return; | ||
if (l < 1) return; | ||
if (l === 1) { | ||
@@ -26,4 +25,3 @@ yield* repeat(mix(init(stops[0][1], stops[0][1]), 0), num); | ||
if (t > end) { | ||
while (i < l && t > stops[i][0]) | ||
i++; | ||
while (i < l && t > stops[i][0]) i++; | ||
start = stops[i - 1][0]; | ||
@@ -30,0 +28,0 @@ end = stops[i][0]; |
Sorry, the diff of this file is too big to display
346774
1094
6576
- Removed@thi.ng/arrays@2.9.5(transitive)
- Removed@thi.ng/equiv@2.1.58(transitive)
Updated@thi.ng/api@^8.11.2
Updated@thi.ng/arrays@^2.9.6
Updated@thi.ng/checks@^3.6.4
Updated@thi.ng/compare@^2.3.5
Updated@thi.ng/compose@^3.0.4
Updated@thi.ng/errors@^2.5.7
Updated@thi.ng/math@^5.10.13
Updated@thi.ng/random@^3.8.0