@randajan/jet-core
Advanced tools
Comparing version 3.4.1 to 3.4.2
import { | ||
Pool_default | ||
} from "../chunk-OFY25BSF.js"; | ||
import { | ||
jet_default | ||
} from "../chunk-QIKZ225C.js"; | ||
// src/extra/RunPool.js | ||
var RunPool = class extends Pool_default { | ||
constructor(...items) { | ||
const _p = { with: [] }; | ||
super(...items); | ||
this.autoFilter(jet_default.isRunnable); | ||
Object.defineProperty(this, "_with", { get: (_) => _p.with, set: (v) => _p.with = Array.jet.to(v) }); | ||
} | ||
with(...args) { | ||
this._with = args; | ||
return this; | ||
} | ||
run(...args) { | ||
const first = !this._run; | ||
let r = this._run = []; | ||
for (const fce of this) { | ||
r.push(fce(...this._with, ...args)); | ||
if (r !== this._run) { | ||
break; | ||
} | ||
} | ||
r = this._run; | ||
if (first) { | ||
delete this._run; | ||
} | ||
return r; | ||
} | ||
fit(...args) { | ||
if (this._fit) { | ||
throw "RunPool.fit maximum call stack size exceeded"; | ||
} | ||
this._fit = true; | ||
const w = this._with; | ||
const result = jet_default.reducer( | ||
(next, i, ...a) => this[i] ? this[i](next, ...w, ...a) : a[0] | ||
)(...w, ...args); | ||
delete this._fit; | ||
return result; | ||
} | ||
}; | ||
var RunPool_default = jet_default.define("RunPool", RunPool, { | ||
copy: (x) => new RunPool(...x).autoFilter(x._autoFilter).autoSort(x._autoSort), | ||
keys: (x) => x.keys(), | ||
vals: (x) => x.values(), | ||
entries: (x) => x.entries() | ||
}); | ||
RunPool_default | ||
} from "../chunk-VQ3QXINC.js"; | ||
import "../chunk-OFY25BSF.js"; | ||
import "../chunk-QIKZ225C.js"; | ||
export { | ||
@@ -55,0 +7,0 @@ RunPool_default as default |
import { | ||
RunPool_default | ||
} from "./chunk-VQ3QXINC.js"; | ||
import { | ||
Pool_default | ||
} from "./chunk-OFY25BSF.js"; | ||
import { | ||
jet_default | ||
@@ -575,4 +581,6 @@ } from "./chunk-QIKZ225C.js"; | ||
Plex, | ||
Pool_default as Pool, | ||
Promise_default as Promise, | ||
RegExp_default as RegExp, | ||
RunPool_default as RunPool, | ||
Set_default as Set, | ||
@@ -579,0 +587,0 @@ String_default as String, |
{ | ||
"name": "@randajan/jet-core", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Ecosystem of types and related usefull tools.", | ||
@@ -5,0 +5,0 @@ "repository": "randajan/jet-core", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
159440
17
1622