From c04f3099036bfd10962bba6194b0eae1e9857161 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Fri, 10 Jan 2025 11:36:33 +0300 Subject: [PATCH] fix: make `spawnChunkStore` reducible --- src/main/ts/spawn.ts | 4 +++- target/cjs/index.cjs | 6 +++--- target/dts/spawn.d.ts | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/ts/spawn.ts b/src/main/ts/spawn.ts index 674ac16..6d20798 100644 --- a/src/main/ts/spawn.ts +++ b/src/main/ts/spawn.ts @@ -34,7 +34,9 @@ export type TPushable = { push(...args: T[]): number } export type TJoinable = { join(sep?: string): string } -export type TArrayLike = Iterable & TPushable & TJoinable & { length: number, [i: number]: T | undefined } +export type TReducible = { reduce(fn: (acc: U, cur: T, i: number, arr: T[]) => U, init: U): R } + +export type TArrayLike = Iterable & TPushable & TJoinable & TReducible &{ length: number, [i: number]: T | undefined } export type TSpawnStoreChunks = TArrayLike diff --git a/target/cjs/index.cjs b/target/cjs/index.cjs index 77854d2..d421d30 100644 --- a/target/cjs/index.cjs +++ b/target/cjs/index.cjs @@ -7,8 +7,8 @@ const { // src/main/ts/index.ts -var index_exports = {}; -__export(index_exports, { +var ts_exports = {}; +__export(ts_exports, { $: () => $, buildCmd: () => import_util5.buildCmd, defaults: () => import_spawn2.defaults, @@ -16,7 +16,7 @@ __export(index_exports, { invoke: () => import_spawn2.invoke, zurk: () => import_zurk5.zurk }); -module.exports = __toCommonJS(index_exports); +module.exports = __toCommonJS(ts_exports); var import_spawn2 = require("./spawn.cjs"); // src/main/ts/x.ts diff --git a/target/dts/spawn.d.ts b/target/dts/spawn.d.ts index ed1d9ba..59c520f 100644 --- a/target/dts/spawn.d.ts +++ b/target/dts/spawn.d.ts @@ -30,7 +30,10 @@ export type TPushable = { export type TJoinable = { join(sep?: string): string; }; -export type TArrayLike = Iterable & TPushable & TJoinable & { +export type TReducible = { + reduce(fn: (acc: U, cur: T, i: number, arr: T[]) => U, init: U): R; +}; +export type TArrayLike = Iterable & TPushable & TJoinable & TReducible & { length: number; [i: number]: T | undefined; };