@voidzero-dev/vite-plus-test 0.0.0-0bfcc90f.20260209-0731
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.
- package/LICENSE.md +691 -0
- package/browser/context.d.ts +4 -0
- package/browser/context.js +20 -0
- package/config.d.ts +3 -0
- package/coverage.d.ts +1 -0
- package/dist/@vitest/browser/client/.vite/manifest.json +24 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +57 -0
- package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
- package/dist/@vitest/browser/client/__vitest__/bg.png +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
- package/dist/@vitest/browser/client/__vitest__/favicon.svg +5 -0
- package/dist/@vitest/browser/client/__vitest__/index.html +32 -0
- package/dist/@vitest/browser/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
- package/dist/@vitest/browser/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
- package/dist/@vitest/browser/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
- package/dist/@vitest/browser/client/error-catcher.js +82 -0
- package/dist/@vitest/browser/client/esm-client-injector.js +67 -0
- package/dist/@vitest/browser/client/favicon.svg +5 -0
- package/dist/@vitest/browser/client/orchestrator.html +35 -0
- package/dist/@vitest/browser/client/tester/tester.html +13 -0
- package/dist/@vitest/browser/client.js +456 -0
- package/dist/@vitest/browser/context.d.ts +792 -0
- package/dist/@vitest/browser/context.js +541 -0
- package/dist/@vitest/browser/expect-element.js +32 -0
- package/dist/@vitest/browser/index-D6m36C6U.js +11 -0
- package/dist/@vitest/browser/index.d.ts +73 -0
- package/dist/@vitest/browser/index.js +3513 -0
- package/dist/@vitest/browser/jest-dom.d.ts +724 -0
- package/dist/@vitest/browser/locators.d.ts +354 -0
- package/dist/@vitest/browser/locators.js +1 -0
- package/dist/@vitest/browser/matchers.d.ts +29 -0
- package/dist/@vitest/browser/shared/screenshotMatcher/types.d.ts +22 -0
- package/dist/@vitest/browser/state.js +280 -0
- package/dist/@vitest/browser/types.d.ts +69 -0
- package/dist/@vitest/browser-playwright/context.d.ts +1 -0
- package/dist/@vitest/browser-playwright/index.d.ts +106 -0
- package/dist/@vitest/browser-playwright/index.js +1111 -0
- package/dist/@vitest/browser-playwright/locators.js +114 -0
- package/dist/@vitest/browser-preview/context.d.ts +1 -0
- package/dist/@vitest/browser-preview/index.d.ts +19 -0
- package/dist/@vitest/browser-preview/index.js +148 -0
- package/dist/@vitest/browser-preview/locators.js +79 -0
- package/dist/@vitest/browser-webdriverio/context.d.ts +1 -0
- package/dist/@vitest/browser-webdriverio/index.d.ts +63 -0
- package/dist/@vitest/browser-webdriverio/index.js +600 -0
- package/dist/@vitest/browser-webdriverio/locators.js +163 -0
- package/dist/@vitest/expect/index.d.ts +807 -0
- package/dist/@vitest/expect/index.js +1875 -0
- package/dist/@vitest/mocker/auto-register.d.ts +2 -0
- package/dist/@vitest/mocker/auto-register.js +9 -0
- package/dist/@vitest/mocker/automock.d.ts +12 -0
- package/dist/@vitest/mocker/automock.js +1 -0
- package/dist/@vitest/mocker/browser.d.ts +53 -0
- package/dist/@vitest/mocker/browser.js +91 -0
- package/dist/@vitest/mocker/chunk-automock.js +354 -0
- package/dist/@vitest/mocker/chunk-interceptor-native.js +15 -0
- package/dist/@vitest/mocker/chunk-mocker.js +521 -0
- package/dist/@vitest/mocker/chunk-pathe.M-eThtNZ.js +174 -0
- package/dist/@vitest/mocker/chunk-registry.js +185 -0
- package/dist/@vitest/mocker/chunk-utils.js +16 -0
- package/dist/@vitest/mocker/index.d-C-sLYZi-.d.ts +25 -0
- package/dist/@vitest/mocker/index.d.ts +2 -0
- package/dist/@vitest/mocker/index.js +185 -0
- package/dist/@vitest/mocker/mocker.d-TnKRhz7N.d.ts +81 -0
- package/dist/@vitest/mocker/node.d.ts +800 -0
- package/dist/@vitest/mocker/node.js +966 -0
- package/dist/@vitest/mocker/redirect.d.ts +3 -0
- package/dist/@vitest/mocker/redirect.js +79 -0
- package/dist/@vitest/mocker/register.d.ts +9 -0
- package/dist/@vitest/mocker/register.js +41 -0
- package/dist/@vitest/mocker/types.d-B8CCKmHt.d.ts +107 -0
- package/dist/@vitest/pretty-format/index.d.ts +124 -0
- package/dist/@vitest/pretty-format/index.js +1022 -0
- package/dist/@vitest/runner/chunk-tasks.js +340 -0
- package/dist/@vitest/runner/index.d.ts +180 -0
- package/dist/@vitest/runner/index.js +2114 -0
- package/dist/@vitest/runner/tasks.d-C7UxawJ9.d.ts +834 -0
- package/dist/@vitest/runner/types.d.ts +183 -0
- package/dist/@vitest/runner/types.js +1 -0
- package/dist/@vitest/runner/utils.d.ts +45 -0
- package/dist/@vitest/runner/utils.js +5 -0
- package/dist/@vitest/snapshot/environment.d-DHdQ1Csl.d.ts +22 -0
- package/dist/@vitest/snapshot/environment.d.ts +16 -0
- package/dist/@vitest/snapshot/environment.js +40 -0
- package/dist/@vitest/snapshot/index.d.ts +130 -0
- package/dist/@vitest/snapshot/index.js +1437 -0
- package/dist/@vitest/snapshot/manager.d.ts +18 -0
- package/dist/@vitest/snapshot/manager.js +73 -0
- package/dist/@vitest/snapshot/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
- package/dist/@vitest/spy/index.d.ts +384 -0
- package/dist/@vitest/spy/index.js +433 -0
- package/dist/@vitest/utils/chunk-_commonjsHelpers.js +5 -0
- package/dist/@vitest/utils/chunk-pathe.M-eThtNZ.js +156 -0
- package/dist/@vitest/utils/constants.d.ts +21 -0
- package/dist/@vitest/utils/constants.js +49 -0
- package/dist/@vitest/utils/diff.d.ts +93 -0
- package/dist/@vitest/utils/diff.js +2199 -0
- package/dist/@vitest/utils/display.d.ts +29 -0
- package/dist/@vitest/utils/display.js +742 -0
- package/dist/@vitest/utils/error.d.ts +7 -0
- package/dist/@vitest/utils/error.js +42 -0
- package/dist/@vitest/utils/helpers.d.ts +73 -0
- package/dist/@vitest/utils/helpers.js +295 -0
- package/dist/@vitest/utils/highlight.d.ts +9 -0
- package/dist/@vitest/utils/highlight.js +538 -0
- package/dist/@vitest/utils/index.d.ts +5 -0
- package/dist/@vitest/utils/index.js +1 -0
- package/dist/@vitest/utils/offset.d.ts +5 -0
- package/dist/@vitest/utils/offset.js +32 -0
- package/dist/@vitest/utils/resolver.d.ts +7 -0
- package/dist/@vitest/utils/resolver.js +71 -0
- package/dist/@vitest/utils/serialize.d.ts +3 -0
- package/dist/@vitest/utils/serialize.js +118 -0
- package/dist/@vitest/utils/source-map.d.ts +55 -0
- package/dist/@vitest/utils/source-map.js +478 -0
- package/dist/@vitest/utils/timers.d.ts +33 -0
- package/dist/@vitest/utils/timers.js +49 -0
- package/dist/@vitest/utils/types.d-BCElaP-c.d.ts +53 -0
- package/dist/@vitest/utils/types.d.ts +34 -0
- package/dist/@vitest/utils/types.js +1 -0
- package/dist/browser-compat.js +3 -0
- package/dist/browser.d.ts +46 -0
- package/dist/browser.js +20 -0
- package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
- package/dist/chunks/base.CJ0Y4ePK.js +165 -0
- package/dist/chunks/benchmark.B3N2zMcH.js +40 -0
- package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +24 -0
- package/dist/chunks/browser.d.ChKACdzH.d.ts +59 -0
- package/dist/chunks/cac.DVeoLl0M.js +1409 -0
- package/dist/chunks/cli-api.B7PN_QUv.js +13672 -0
- package/dist/chunks/config.d.Cy95HiCx.d.ts +210 -0
- package/dist/chunks/console.Cf-YriPC.js +146 -0
- package/dist/chunks/constants.D_Q9UYh-.js +36 -0
- package/dist/chunks/coverage.AVPTjMgw.js +3292 -0
- package/dist/chunks/coverage.D_JHT54q.js +25 -0
- package/dist/chunks/coverage.d.BZtK59WP.d.ts +37 -0
- package/dist/chunks/creator.DAmOKTvJ.js +673 -0
- package/dist/chunks/date.Bq6ZW5rf.js +73 -0
- package/dist/chunks/defaults.BOqNVLsY.js +74 -0
- package/dist/chunks/env.D4Lgay0q.js +8 -0
- package/dist/chunks/environment.d.CrsxCzP1.d.ts +29 -0
- package/dist/chunks/evaluatedModules.Dg1zASAC.js +17 -0
- package/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts +7 -0
- package/dist/chunks/git.Bm2pzPAa.js +71 -0
- package/dist/chunks/global.d.B15mdLcR.d.ts +99 -0
- package/dist/chunks/globals.DOayXfHP.js +30 -0
- package/dist/chunks/index.6Qv1eEA6.js +109 -0
- package/dist/chunks/index.C5r1PdPD.js +231 -0
- package/dist/chunks/index.Chj8NDwU.js +206 -0
- package/dist/chunks/index.CyBMJtT7.js +727 -0
- package/dist/chunks/index.D3XRDfWc.js +213 -0
- package/dist/chunks/index.D4KonVSU.js +6343 -0
- package/dist/chunks/index.M8mOzt4Y.js +3839 -0
- package/dist/chunks/index.Z5E_ObnR.js +37 -0
- package/dist/chunks/init-forks._y3TW739.js +41 -0
- package/dist/chunks/init-threads.DBO2kn-p.js +18 -0
- package/dist/chunks/init.B6MLFIaN.js +334 -0
- package/dist/chunks/inspector.CvyFGlXm.js +53 -0
- package/dist/chunks/modules.BJuCwlRJ.js +36 -0
- package/dist/chunks/node.Ce0vMQM7.js +14 -0
- package/dist/chunks/plugin.d.CtqpEehP.d.ts +38 -0
- package/dist/chunks/reporters.d.CWXNI2jG.d.ts +3271 -0
- package/dist/chunks/rpc.BoxB0q7B.js +76 -0
- package/dist/chunks/rpc.d.RH3apGEf.d.ts +64 -0
- package/dist/chunks/setup-common.Cm-kSBVi.js +60 -0
- package/dist/chunks/startModuleRunner.DEj0jb3e.js +861 -0
- package/dist/chunks/suite.d.BJWk38HB.d.ts +10 -0
- package/dist/chunks/test.B8ej_ZHS.js +254 -0
- package/dist/chunks/traces.CCmnQaNT.js +217 -0
- package/dist/chunks/traces.d.402V_yFI.d.ts +18 -0
- package/dist/chunks/utils.DvEY5TfP.js +52 -0
- package/dist/chunks/vi.2VT5v0um.js +3919 -0
- package/dist/chunks/vm.D3epNOPZ.js +744 -0
- package/dist/chunks/worker.d.Dyxm8DEL.d.ts +255 -0
- package/dist/cli.js +28 -0
- package/dist/client/.vite/manifest.json +24 -0
- package/dist/client/__vitest__/assets/index-BUCFJtth.js +57 -0
- package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +1 -0
- package/dist/client/__vitest__/bg.png +0 -0
- package/dist/client/__vitest__/favicon.ico +0 -0
- package/dist/client/__vitest__/favicon.svg +5 -0
- package/dist/client/__vitest__/index.html +32 -0
- package/dist/client/__vitest_browser__/orchestrator-S_3e_uzt.js +345 -0
- package/dist/client/__vitest_browser__/tester-k74mgIRa.js +2171 -0
- package/dist/client/__vitest_browser__/utils-uxqdqUz8.js +223 -0
- package/dist/client/error-catcher.js +82 -0
- package/dist/client/esm-client-injector.js +67 -0
- package/dist/client/favicon.svg +5 -0
- package/dist/client/orchestrator.html +35 -0
- package/dist/client/tester/tester.html +13 -0
- package/dist/client.js +456 -0
- package/dist/config.cjs +94 -0
- package/dist/config.d.ts +104 -0
- package/dist/config.js +15 -0
- package/dist/context.js +541 -0
- package/dist/coverage.d.ts +118 -0
- package/dist/coverage.js +23 -0
- package/dist/dummy.js +2 -0
- package/dist/environments.d.ts +22 -0
- package/dist/environments.js +3 -0
- package/dist/expect-element.js +27 -0
- package/dist/index-D6m36C6U.js +6 -0
- package/dist/index-node.js +7 -0
- package/dist/index.d.ts +510 -0
- package/dist/index.js +19 -0
- package/dist/locators.d.ts +354 -0
- package/dist/locators.js +1 -0
- package/dist/mocker.d.ts +1 -0
- package/dist/mocker.js +1 -0
- package/dist/module-evaluator.d.ts +124 -0
- package/dist/module-evaluator.js +343 -0
- package/dist/module-runner-stub.js +44 -0
- package/dist/module-runner.js +17 -0
- package/dist/node.d.ts +251 -0
- package/dist/node.js +98 -0
- package/dist/path.js +7 -0
- package/dist/plugins/browser-client.mjs +2 -0
- package/dist/plugins/browser-context.mjs +2 -0
- package/dist/plugins/browser-locators.mjs +2 -0
- package/dist/plugins/browser-playwright.mjs +2 -0
- package/dist/plugins/browser-preview.mjs +2 -0
- package/dist/plugins/browser-webdriverio.mjs +2 -0
- package/dist/plugins/browser.mjs +2 -0
- package/dist/plugins/expect.mjs +2 -0
- package/dist/plugins/mocker-automock.mjs +2 -0
- package/dist/plugins/mocker-browser.mjs +2 -0
- package/dist/plugins/mocker-node.mjs +2 -0
- package/dist/plugins/mocker-redirect.mjs +2 -0
- package/dist/plugins/mocker-register.mjs +2 -0
- package/dist/plugins/mocker.mjs +2 -0
- package/dist/plugins/pretty-format.mjs +2 -0
- package/dist/plugins/runner-types.mjs +2 -0
- package/dist/plugins/runner-utils.mjs +2 -0
- package/dist/plugins/runner.mjs +2 -0
- package/dist/plugins/snapshot-environment.mjs +2 -0
- package/dist/plugins/snapshot-manager.mjs +2 -0
- package/dist/plugins/snapshot.mjs +2 -0
- package/dist/plugins/spy.mjs +2 -0
- package/dist/plugins/utils-constants.mjs +2 -0
- package/dist/plugins/utils-diff.mjs +2 -0
- package/dist/plugins/utils-display.mjs +2 -0
- package/dist/plugins/utils-error.mjs +2 -0
- package/dist/plugins/utils-helpers.mjs +2 -0
- package/dist/plugins/utils-highlight.mjs +2 -0
- package/dist/plugins/utils-offset.mjs +2 -0
- package/dist/plugins/utils-resolver.mjs +2 -0
- package/dist/plugins/utils-serialize.mjs +2 -0
- package/dist/plugins/utils-source-map.mjs +2 -0
- package/dist/plugins/utils-timers.mjs +2 -0
- package/dist/plugins/utils.mjs +2 -0
- package/dist/reporters.d.ts +27 -0
- package/dist/reporters.js +24 -0
- package/dist/runners.d.ts +50 -0
- package/dist/runners.js +19 -0
- package/dist/shared/screenshotMatcher/types.d.ts +22 -0
- package/dist/snapshot.d.ts +9 -0
- package/dist/snapshot.js +4 -0
- package/dist/spy.js +1 -0
- package/dist/state.js +280 -0
- package/dist/suite.d.ts +5 -0
- package/dist/suite.js +6 -0
- package/dist/types.d.ts +69 -0
- package/dist/vendor/chai.d.mts +1 -0
- package/dist/vendor/chai.mjs +3577 -0
- package/dist/vendor/es-module-lexer.d.mts +193 -0
- package/dist/vendor/es-module-lexer.mjs +79 -0
- package/dist/vendor/estree-walker.d.mts +583 -0
- package/dist/vendor/estree-walker.mjs +339 -0
- package/dist/vendor/expect-type.d.mts +1574 -0
- package/dist/vendor/expect-type.mjs +214 -0
- package/dist/vendor/magic-string.d.mts +261 -0
- package/dist/vendor/magic-string.mjs +1700 -0
- package/dist/vendor/obug.d.mts +56 -0
- package/dist/vendor/obug.mjs +276 -0
- package/dist/vendor/pathe.d.mts +46 -0
- package/dist/vendor/pathe.mjs +496 -0
- package/dist/vendor/picomatch.d.mts +1 -0
- package/dist/vendor/picomatch.mjs +1855 -0
- package/dist/vendor/shared-3g9mwCWP.mjs +31 -0
- package/dist/vendor/std-env.d.mts +88 -0
- package/dist/vendor/std-env.mjs +159 -0
- package/dist/vendor/tinybench.d.mts +317 -0
- package/dist/vendor/tinybench.mjs +504 -0
- package/dist/vendor/tinyexec.d.mts +72 -0
- package/dist/vendor/tinyexec.mjs +637 -0
- package/dist/vendor/tinyglobby.d.mts +157 -0
- package/dist/vendor/tinyglobby.mjs +832 -0
- package/dist/vendor/tinyrainbow.d.mts +60 -0
- package/dist/vendor/tinyrainbow.mjs +93 -0
- package/dist/vendor/vitest_browser.mjs +2 -0
- package/dist/vendor/vitest_internal_browser.mjs +2 -0
- package/dist/vendor/vitest_runner.mjs +2 -0
- package/dist/vendor/vitest_runners.mjs +2 -0
- package/dist/worker.d.ts +32 -0
- package/dist/worker.js +48 -0
- package/dist/workers/forks.js +54 -0
- package/dist/workers/runVmTests.js +95 -0
- package/dist/workers/threads.js +55 -0
- package/dist/workers/vmForks.js +36 -0
- package/dist/workers/vmThreads.js +37 -0
- package/environments.d.ts +1 -0
- package/globals.d.ts +20 -0
- package/import-meta.d.ts +5 -0
- package/importMeta.d.ts +4 -0
- package/index.cjs +5 -0
- package/index.d.cts +1 -0
- package/jsdom.d.ts +6 -0
- package/mocker.d.ts +1 -0
- package/node.d.ts +1 -0
- package/optional-types.d.ts +7 -0
- package/package.json +335 -0
- package/reporters.d.ts +1 -0
- package/runners.d.ts +1 -0
- package/snapshot.d.ts +1 -0
- package/suite.d.ts +1 -0
- package/suppress-warnings.cjs +21 -0
- package/vitest.mjs +2 -0
- package/worker.d.ts +1 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js
|
|
2
|
+
var $ = Object.defineProperty;
|
|
3
|
+
var C = (s) => {
|
|
4
|
+
throw TypeError(s);
|
|
5
|
+
};
|
|
6
|
+
var D = (s, n, t) => n in s ? $(s, n, {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
configurable: !0,
|
|
9
|
+
writable: !0,
|
|
10
|
+
value: t
|
|
11
|
+
}) : s[n] = t;
|
|
12
|
+
var O = (s, n, t) => D(s, typeof n != "symbol" ? n + "" : n, t), q = (s, n, t) => n.has(s) || C("Cannot " + t);
|
|
13
|
+
var d = (s, n, t) => (q(s, n, "read from private field"), t ? t.call(s) : n.get(s)), k = (s, n, t) => n.has(s) ? C("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(s) : n.set(s, t), f = (s, n, t, e) => (q(s, n, "write to private field"), e ? e.call(s, t) : n.set(s, t), t);
|
|
14
|
+
var F = (s, n, t, e) => ({
|
|
15
|
+
set _(r) {
|
|
16
|
+
f(s, n, r, t);
|
|
17
|
+
},
|
|
18
|
+
get _() {
|
|
19
|
+
return d(s, n, e);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var M = class {
|
|
23
|
+
constructor(n) {
|
|
24
|
+
O(this, "value");
|
|
25
|
+
O(this, "next");
|
|
26
|
+
this.value = n;
|
|
27
|
+
}
|
|
28
|
+
}, m, w, E, g = class {
|
|
29
|
+
constructor() {
|
|
30
|
+
k(this, m);
|
|
31
|
+
k(this, w);
|
|
32
|
+
k(this, E);
|
|
33
|
+
this.clear();
|
|
34
|
+
}
|
|
35
|
+
enqueue(n) {
|
|
36
|
+
let t = new M(n);
|
|
37
|
+
d(this, m) ? (d(this, w).next = t, f(this, w, t)) : (f(this, m, t), f(this, w, t)), F(this, E)._++;
|
|
38
|
+
}
|
|
39
|
+
dequeue() {
|
|
40
|
+
let n = d(this, m);
|
|
41
|
+
if (n) return f(this, m, d(this, m).next), F(this, E)._--, n.value;
|
|
42
|
+
}
|
|
43
|
+
clear() {
|
|
44
|
+
f(this, m, void 0), f(this, w, void 0), f(this, E, 0);
|
|
45
|
+
}
|
|
46
|
+
get size() {
|
|
47
|
+
return d(this, E);
|
|
48
|
+
}
|
|
49
|
+
*[Symbol.iterator]() {
|
|
50
|
+
let n = d(this, m);
|
|
51
|
+
for (; n;) yield n.value, n = n.next;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
m = new WeakMap(), w = new WeakMap(), E = new WeakMap();
|
|
55
|
+
function y(s) {
|
|
56
|
+
if (!((Number.isInteger(s) || s === Number.POSITIVE_INFINITY) && s > 0)) throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
57
|
+
let n = new g(), t = 0, e = () => {
|
|
58
|
+
t--, n.size > 0 && n.dequeue()();
|
|
59
|
+
}, r = async (h, p, a) => {
|
|
60
|
+
t++;
|
|
61
|
+
let l = (async () => h(...a))();
|
|
62
|
+
p(l);
|
|
63
|
+
try {
|
|
64
|
+
await l;
|
|
65
|
+
} catch (T) {}
|
|
66
|
+
e();
|
|
67
|
+
}, i = (h, p, a) => {
|
|
68
|
+
n.enqueue(r.bind(void 0, h, p, a)), (async () => (await Promise.resolve(), t < s && n.size > 0 && n.dequeue()()))();
|
|
69
|
+
}, c = (h, ...p) => new Promise((a) => {
|
|
70
|
+
i(h, a, p);
|
|
71
|
+
});
|
|
72
|
+
return Object.defineProperties(c, {
|
|
73
|
+
activeCount: { get: () => t },
|
|
74
|
+
pendingCount: { get: () => n.size },
|
|
75
|
+
clearQueue: { value: () => {
|
|
76
|
+
n.clear();
|
|
77
|
+
} }
|
|
78
|
+
}), c;
|
|
79
|
+
}
|
|
80
|
+
function o(s, n = null) {
|
|
81
|
+
let t = new Event(s);
|
|
82
|
+
return n && Object.defineProperty(t, "task", {
|
|
83
|
+
value: n,
|
|
84
|
+
enumerable: !0,
|
|
85
|
+
writable: !1,
|
|
86
|
+
configurable: !1
|
|
87
|
+
}), t;
|
|
88
|
+
}
|
|
89
|
+
var G = {
|
|
90
|
+
1: 12.71,
|
|
91
|
+
2: 4.303,
|
|
92
|
+
3: 3.182,
|
|
93
|
+
4: 2.776,
|
|
94
|
+
5: 2.571,
|
|
95
|
+
6: 2.447,
|
|
96
|
+
7: 2.365,
|
|
97
|
+
8: 2.306,
|
|
98
|
+
9: 2.262,
|
|
99
|
+
10: 2.228,
|
|
100
|
+
11: 2.201,
|
|
101
|
+
12: 2.179,
|
|
102
|
+
13: 2.16,
|
|
103
|
+
14: 2.145,
|
|
104
|
+
15: 2.131,
|
|
105
|
+
16: 2.12,
|
|
106
|
+
17: 2.11,
|
|
107
|
+
18: 2.101,
|
|
108
|
+
19: 2.093,
|
|
109
|
+
20: 2.086,
|
|
110
|
+
21: 2.08,
|
|
111
|
+
22: 2.074,
|
|
112
|
+
23: 2.069,
|
|
113
|
+
24: 2.064,
|
|
114
|
+
25: 2.06,
|
|
115
|
+
26: 2.056,
|
|
116
|
+
27: 2.052,
|
|
117
|
+
28: 2.048,
|
|
118
|
+
29: 2.045,
|
|
119
|
+
30: 2.042,
|
|
120
|
+
31: 2.0399,
|
|
121
|
+
32: 2.0378,
|
|
122
|
+
33: 2.0357,
|
|
123
|
+
34: 2.0336,
|
|
124
|
+
35: 2.0315,
|
|
125
|
+
36: 2.0294,
|
|
126
|
+
37: 2.0273,
|
|
127
|
+
38: 2.0252,
|
|
128
|
+
39: 2.0231,
|
|
129
|
+
40: 2.021,
|
|
130
|
+
41: 2.0198,
|
|
131
|
+
42: 2.0186,
|
|
132
|
+
43: 2.0174,
|
|
133
|
+
44: 2.0162,
|
|
134
|
+
45: 2.015,
|
|
135
|
+
46: 2.0138,
|
|
136
|
+
47: 2.0126,
|
|
137
|
+
48: 2.0114,
|
|
138
|
+
49: 2.0102,
|
|
139
|
+
50: 2.009,
|
|
140
|
+
51: 2.0081,
|
|
141
|
+
52: 2.0072,
|
|
142
|
+
53: 2.0063,
|
|
143
|
+
54: 2.0054,
|
|
144
|
+
55: 2.0045,
|
|
145
|
+
56: 2.0036,
|
|
146
|
+
57: 2.0027,
|
|
147
|
+
58: 2.0018,
|
|
148
|
+
59: 2.0009,
|
|
149
|
+
60: 2,
|
|
150
|
+
61: 1.9995,
|
|
151
|
+
62: 1.999,
|
|
152
|
+
63: 1.9985,
|
|
153
|
+
64: 1.998,
|
|
154
|
+
65: 1.9975,
|
|
155
|
+
66: 1.997,
|
|
156
|
+
67: 1.9965,
|
|
157
|
+
68: 1.996,
|
|
158
|
+
69: 1.9955,
|
|
159
|
+
70: 1.995,
|
|
160
|
+
71: 1.9945,
|
|
161
|
+
72: 1.994,
|
|
162
|
+
73: 1.9935,
|
|
163
|
+
74: 1.993,
|
|
164
|
+
75: 1.9925,
|
|
165
|
+
76: 1.992,
|
|
166
|
+
77: 1.9915,
|
|
167
|
+
78: 1.991,
|
|
168
|
+
79: 1.9905,
|
|
169
|
+
80: 1.99,
|
|
170
|
+
81: 1.9897,
|
|
171
|
+
82: 1.9894,
|
|
172
|
+
83: 1.9891,
|
|
173
|
+
84: 1.9888,
|
|
174
|
+
85: 1.9885,
|
|
175
|
+
86: 1.9882,
|
|
176
|
+
87: 1.9879,
|
|
177
|
+
88: 1.9876,
|
|
178
|
+
89: 1.9873,
|
|
179
|
+
90: 1.987,
|
|
180
|
+
91: 1.9867,
|
|
181
|
+
92: 1.9864,
|
|
182
|
+
93: 1.9861,
|
|
183
|
+
94: 1.9858,
|
|
184
|
+
95: 1.9855,
|
|
185
|
+
96: 1.9852,
|
|
186
|
+
97: 1.9849,
|
|
187
|
+
98: 1.9846,
|
|
188
|
+
99: 1.9843,
|
|
189
|
+
100: 1.984,
|
|
190
|
+
101: 1.9838,
|
|
191
|
+
102: 1.9836,
|
|
192
|
+
103: 1.9834,
|
|
193
|
+
104: 1.9832,
|
|
194
|
+
105: 1.983,
|
|
195
|
+
106: 1.9828,
|
|
196
|
+
107: 1.9826,
|
|
197
|
+
108: 1.9824,
|
|
198
|
+
109: 1.9822,
|
|
199
|
+
110: 1.982,
|
|
200
|
+
111: 1.9818,
|
|
201
|
+
112: 1.9816,
|
|
202
|
+
113: 1.9814,
|
|
203
|
+
114: 1.9812,
|
|
204
|
+
115: 1.9819,
|
|
205
|
+
116: 1.9808,
|
|
206
|
+
117: 1.9806,
|
|
207
|
+
118: 1.9804,
|
|
208
|
+
119: 1.9802,
|
|
209
|
+
120: 1.98,
|
|
210
|
+
infinity: 1.96
|
|
211
|
+
}, N = G;
|
|
212
|
+
var J = (s) => s / 1e6, U = () => J(Number(process.hrtime.bigint())), B = () => performance.now();
|
|
213
|
+
function W(s) {
|
|
214
|
+
return s !== null && typeof s == "object" && typeof s.then == "function";
|
|
215
|
+
}
|
|
216
|
+
var S = (s, n) => s.reduce((e, r) => e + (r - n) ** 2, 0) / (s.length - 1) || 0, X = (async () => {}).constructor, Z = (s) => s.constructor === X, z = async (s) => {
|
|
217
|
+
if (Z(s.fn)) return !0;
|
|
218
|
+
try {
|
|
219
|
+
if (s.opts.beforeEach != null) try {
|
|
220
|
+
await s.opts.beforeEach.call(s);
|
|
221
|
+
} catch (e) {}
|
|
222
|
+
let n = s.fn(), t = W(n);
|
|
223
|
+
if (t) try {
|
|
224
|
+
await n;
|
|
225
|
+
} catch (e) {}
|
|
226
|
+
if (s.opts.afterEach != null) try {
|
|
227
|
+
await s.opts.afterEach.call(s);
|
|
228
|
+
} catch (e) {}
|
|
229
|
+
return t;
|
|
230
|
+
} catch (n) {
|
|
231
|
+
return !1;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var b = class extends EventTarget {
|
|
235
|
+
constructor(t, e, r, i = {}) {
|
|
236
|
+
super();
|
|
237
|
+
this.runs = 0;
|
|
238
|
+
this.bench = t, this.name = e, this.fn = r, this.opts = i;
|
|
239
|
+
}
|
|
240
|
+
async loop(t, e) {
|
|
241
|
+
var T;
|
|
242
|
+
let r = this.bench.concurrency === "task", { threshold: i } = this.bench, c = 0, h = [];
|
|
243
|
+
if (this.opts.beforeAll != null) try {
|
|
244
|
+
await this.opts.beforeAll.call(this);
|
|
245
|
+
} catch (u) {
|
|
246
|
+
return { error: u };
|
|
247
|
+
}
|
|
248
|
+
let p = await z(this), a = async () => {
|
|
249
|
+
this.opts.beforeEach != null && await this.opts.beforeEach.call(this);
|
|
250
|
+
let u = 0;
|
|
251
|
+
if (p) {
|
|
252
|
+
let v = this.bench.now();
|
|
253
|
+
await this.fn.call(this), u = this.bench.now() - v;
|
|
254
|
+
} else {
|
|
255
|
+
let v = this.bench.now();
|
|
256
|
+
this.fn.call(this), u = this.bench.now() - v;
|
|
257
|
+
}
|
|
258
|
+
h.push(u), c += u, this.opts.afterEach != null && await this.opts.afterEach.call(this);
|
|
259
|
+
}, l = y(i);
|
|
260
|
+
try {
|
|
261
|
+
let u = [];
|
|
262
|
+
for (; (c < t || h.length + l.activeCount + l.pendingCount < e) && !((T = this.bench.signal) != null && T.aborted);) r ? u.push(l(a)) : await a();
|
|
263
|
+
u.length && await Promise.all(u);
|
|
264
|
+
} catch (u) {
|
|
265
|
+
return { error: u };
|
|
266
|
+
}
|
|
267
|
+
if (this.opts.afterAll != null) try {
|
|
268
|
+
await this.opts.afterAll.call(this);
|
|
269
|
+
} catch (u) {
|
|
270
|
+
return { error: u };
|
|
271
|
+
}
|
|
272
|
+
return { samples: h };
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* run the current task and write the results in `Task.result` object
|
|
276
|
+
*/
|
|
277
|
+
async run() {
|
|
278
|
+
var r, i;
|
|
279
|
+
if ((r = this.result) != null && r.error) return this;
|
|
280
|
+
this.dispatchEvent(o("start", this)), await this.bench.setup(this, "run");
|
|
281
|
+
let { samples: t, error: e } = await this.loop(this.bench.time, this.bench.iterations);
|
|
282
|
+
if (this.bench.teardown(this, "run"), t) {
|
|
283
|
+
let c = t.reduce((L, A) => L + A, 0);
|
|
284
|
+
this.runs = t.length, t.sort((L, A) => L - A);
|
|
285
|
+
let h = c / this.runs, p = 1e3 / h, a = t.length, l = a - 1, T = t[0], u = t[l], v = c / t.length || 0, P = S(t, v), R = Math.sqrt(P), I = R / Math.sqrt(a), _ = N[String(Math.round(l) || 1)] || N.infinity, K = I * _, j = K / v * 100, H = t[Math.ceil(a * .75) - 1], V = t[Math.ceil(a * .99) - 1], Q = t[Math.ceil(a * .995) - 1], Y = t[Math.ceil(a * .999) - 1];
|
|
286
|
+
if ((i = this.bench.signal) != null && i.aborted) return this;
|
|
287
|
+
this.setResult({
|
|
288
|
+
totalTime: c,
|
|
289
|
+
min: T,
|
|
290
|
+
max: u,
|
|
291
|
+
hz: p,
|
|
292
|
+
period: h,
|
|
293
|
+
samples: t,
|
|
294
|
+
mean: v,
|
|
295
|
+
variance: P,
|
|
296
|
+
sd: R,
|
|
297
|
+
sem: I,
|
|
298
|
+
df: l,
|
|
299
|
+
critical: _,
|
|
300
|
+
moe: K,
|
|
301
|
+
rme: j,
|
|
302
|
+
p75: H,
|
|
303
|
+
p99: V,
|
|
304
|
+
p995: Q,
|
|
305
|
+
p999: Y
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
if (e) {
|
|
309
|
+
if (this.setResult({ error: e }), this.bench.throws) throw e;
|
|
310
|
+
this.dispatchEvent(o("error", this)), this.bench.dispatchEvent(o("error", this));
|
|
311
|
+
}
|
|
312
|
+
return this.dispatchEvent(o("cycle", this)), this.bench.dispatchEvent(o("cycle", this)), this.dispatchEvent(o("complete", this)), this;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* warmup the current task
|
|
316
|
+
*/
|
|
317
|
+
async warmup() {
|
|
318
|
+
var e;
|
|
319
|
+
if ((e = this.result) != null && e.error) return;
|
|
320
|
+
this.dispatchEvent(o("warmup", this)), await this.bench.setup(this, "warmup");
|
|
321
|
+
let { error: t } = await this.loop(this.bench.warmupTime, this.bench.warmupIterations);
|
|
322
|
+
if (this.bench.teardown(this, "warmup"), t && (this.setResult({ error: t }), this.bench.throws)) throw t;
|
|
323
|
+
}
|
|
324
|
+
addEventListener(t, e, r) {
|
|
325
|
+
super.addEventListener(t, e, r);
|
|
326
|
+
}
|
|
327
|
+
removeEventListener(t, e, r) {
|
|
328
|
+
super.removeEventListener(t, e, r);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* change the result object values
|
|
332
|
+
*/
|
|
333
|
+
setResult(t) {
|
|
334
|
+
this.result = {
|
|
335
|
+
...this.result,
|
|
336
|
+
...t
|
|
337
|
+
}, Object.freeze(this.result);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* reset the task to make the `Task.runs` a zero-value and remove the `Task.result`
|
|
341
|
+
* object
|
|
342
|
+
*/
|
|
343
|
+
reset() {
|
|
344
|
+
this.dispatchEvent(o("reset", this)), this.runs = 0, this.result = void 0;
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
var x = class extends EventTarget {
|
|
348
|
+
constructor(t = {}) {
|
|
349
|
+
var e, r, i, c, h, p, a, l;
|
|
350
|
+
super();
|
|
351
|
+
this._tasks = /* @__PURE__ */ new Map();
|
|
352
|
+
this._todos = /* @__PURE__ */ new Map();
|
|
353
|
+
/**
|
|
354
|
+
* Executes tasks concurrently based on the specified concurrency mode.
|
|
355
|
+
*
|
|
356
|
+
* - When `mode` is set to `null` (default), concurrency is disabled.
|
|
357
|
+
* - When `mode` is set to 'task', each task's iterations (calls of a task function) run concurrently.
|
|
358
|
+
* - When `mode` is set to 'bench', different tasks within the bench run concurrently.
|
|
359
|
+
*/
|
|
360
|
+
this.concurrency = null;
|
|
361
|
+
/**
|
|
362
|
+
* The maximum number of concurrent tasks to run. Defaults to Infinity.
|
|
363
|
+
*/
|
|
364
|
+
this.threshold = 1 / 0;
|
|
365
|
+
this.warmupTime = 100;
|
|
366
|
+
this.warmupIterations = 5;
|
|
367
|
+
this.time = 500;
|
|
368
|
+
this.iterations = 10;
|
|
369
|
+
this.now = B;
|
|
370
|
+
this.now = (e = t.now) != null ? e : this.now, this.warmupTime = (r = t.warmupTime) != null ? r : this.warmupTime, this.warmupIterations = (i = t.warmupIterations) != null ? i : this.warmupIterations, this.time = (c = t.time) != null ? c : this.time, this.iterations = (h = t.iterations) != null ? h : this.iterations, this.signal = t.signal, this.throws = (p = t.throws) != null ? p : !1, this.setup = (a = t.setup) != null ? a : () => {}, this.teardown = (l = t.teardown) != null ? l : () => {}, this.signal && this.signal.addEventListener("abort", () => {
|
|
371
|
+
this.dispatchEvent(o("abort"));
|
|
372
|
+
}, { once: !0 });
|
|
373
|
+
}
|
|
374
|
+
runTask(t) {
|
|
375
|
+
var e;
|
|
376
|
+
return (e = this.signal) != null && e.aborted ? t : t.run();
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* run the added tasks that were registered using the
|
|
380
|
+
* {@link add} method.
|
|
381
|
+
* Note: This method does not do any warmup. Call {@link warmup} for that.
|
|
382
|
+
*/
|
|
383
|
+
async run() {
|
|
384
|
+
if (this.concurrency === "bench") return this.runConcurrently(this.threshold, this.concurrency);
|
|
385
|
+
this.dispatchEvent(o("start"));
|
|
386
|
+
let t = [];
|
|
387
|
+
for (let e of [...this._tasks.values()]) t.push(await this.runTask(e));
|
|
388
|
+
return this.dispatchEvent(o("complete")), t;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* See Bench.{@link concurrency}
|
|
392
|
+
*/
|
|
393
|
+
async runConcurrently(t = 1 / 0, e = "bench") {
|
|
394
|
+
if (this.threshold = t, this.concurrency = e, e === "task") return this.run();
|
|
395
|
+
this.dispatchEvent(o("start"));
|
|
396
|
+
let r = y(t), i = [];
|
|
397
|
+
for (let h of [...this._tasks.values()]) i.push(r(() => this.runTask(h)));
|
|
398
|
+
let c = await Promise.all(i);
|
|
399
|
+
return this.dispatchEvent(o("complete")), c;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* warmup the benchmark tasks.
|
|
403
|
+
* This is not run by default by the {@link run} method.
|
|
404
|
+
*/
|
|
405
|
+
async warmup() {
|
|
406
|
+
if (this.concurrency === "bench") {
|
|
407
|
+
await this.warmupConcurrently(this.threshold, this.concurrency);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
this.dispatchEvent(o("warmup"));
|
|
411
|
+
for (let [, t] of this._tasks) await t.warmup();
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* warmup the benchmark tasks concurrently.
|
|
415
|
+
* This is not run by default by the {@link runConcurrently} method.
|
|
416
|
+
*/
|
|
417
|
+
async warmupConcurrently(t = 1 / 0, e = "bench") {
|
|
418
|
+
if (this.threshold = t, this.concurrency = e, e === "task") {
|
|
419
|
+
await this.warmup();
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
this.dispatchEvent(o("warmup"));
|
|
423
|
+
let r = y(t), i = [];
|
|
424
|
+
for (let [, c] of this._tasks) i.push(r(() => c.warmup()));
|
|
425
|
+
await Promise.all(i);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* reset each task and remove its result
|
|
429
|
+
*/
|
|
430
|
+
reset() {
|
|
431
|
+
this.dispatchEvent(o("reset")), this._tasks.forEach((t) => {
|
|
432
|
+
t.reset();
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* add a benchmark task to the task map
|
|
437
|
+
*/
|
|
438
|
+
add(t, e, r = {}) {
|
|
439
|
+
let i = new b(this, t, e, r);
|
|
440
|
+
return this._tasks.set(t, i), this.dispatchEvent(o("add", i)), this;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* add a benchmark todo to the todo map
|
|
444
|
+
*/
|
|
445
|
+
todo(t, e = () => {}, r = {}) {
|
|
446
|
+
let i = new b(this, t, e, r);
|
|
447
|
+
return this._todos.set(t, i), this.dispatchEvent(o("todo", i)), this;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* remove a benchmark task from the task map
|
|
451
|
+
*/
|
|
452
|
+
remove(t) {
|
|
453
|
+
let e = this.getTask(t);
|
|
454
|
+
return e && (this.dispatchEvent(o("remove", e)), this._tasks.delete(t)), this;
|
|
455
|
+
}
|
|
456
|
+
addEventListener(t, e, r) {
|
|
457
|
+
super.addEventListener(t, e, r);
|
|
458
|
+
}
|
|
459
|
+
removeEventListener(t, e, r) {
|
|
460
|
+
super.removeEventListener(t, e, r);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* table of the tasks results
|
|
464
|
+
*/
|
|
465
|
+
table(t) {
|
|
466
|
+
return this.tasks.map((e) => {
|
|
467
|
+
if (e.result) {
|
|
468
|
+
if (e.result.error) throw e.result.error;
|
|
469
|
+
return (t == null ? void 0 : t(e)) || {
|
|
470
|
+
"Task Name": e.name,
|
|
471
|
+
"ops/sec": e.result.error ? "NaN" : parseInt(e.result.hz.toString(), 10).toLocaleString(),
|
|
472
|
+
"Average Time (ns)": e.result.error ? "NaN" : e.result.mean * 1e3 * 1e3,
|
|
473
|
+
Margin: e.result.error ? "NaN" : `\xB1${e.result.rme.toFixed(2)}%`,
|
|
474
|
+
Samples: e.result.error ? "NaN" : e.result.samples.length
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
return null;
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* (getter) tasks results as an array
|
|
482
|
+
*/
|
|
483
|
+
get results() {
|
|
484
|
+
return [...this._tasks.values()].map((t) => t.result);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* (getter) tasks as an array
|
|
488
|
+
*/
|
|
489
|
+
get tasks() {
|
|
490
|
+
return [...this._tasks.values()];
|
|
491
|
+
}
|
|
492
|
+
get todos() {
|
|
493
|
+
return [...this._todos.values()];
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* get a task based on the task name
|
|
497
|
+
*/
|
|
498
|
+
getTask(t) {
|
|
499
|
+
return this._tasks.get(t);
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
//#endregion
|
|
504
|
+
export { x as Bench, b as Task, U as hrtimeNow, B as now };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import { ChildProcess, SpawnOptions } from "node:child_process";
|
|
3
|
+
import { Readable } from "node:stream";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.d.ts
|
|
6
|
+
//#region src/non-zero-exit-error.d.ts
|
|
7
|
+
declare class NonZeroExitError extends Error {
|
|
8
|
+
readonly result: Result;
|
|
9
|
+
readonly output?: Output;
|
|
10
|
+
get exitCode(): number | undefined;
|
|
11
|
+
constructor(result: Result, output?: Output);
|
|
12
|
+
} //#endregion
|
|
13
|
+
//#region src/main.d.ts
|
|
14
|
+
interface Output {
|
|
15
|
+
stderr: string;
|
|
16
|
+
stdout: string;
|
|
17
|
+
exitCode: number | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface PipeOptions extends Options {}
|
|
20
|
+
type KillSignal = Parameters<ChildProcess['kill']>[0];
|
|
21
|
+
interface OutputApi extends AsyncIterable<string> {
|
|
22
|
+
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
|
|
23
|
+
process: ChildProcess | undefined;
|
|
24
|
+
kill(signal?: KillSignal): boolean;
|
|
25
|
+
get pid(): number | undefined;
|
|
26
|
+
get aborted(): boolean;
|
|
27
|
+
get killed(): boolean;
|
|
28
|
+
get exitCode(): number | undefined;
|
|
29
|
+
}
|
|
30
|
+
type Result = PromiseLike<Output> & OutputApi;
|
|
31
|
+
interface Options {
|
|
32
|
+
signal: AbortSignal;
|
|
33
|
+
nodeOptions: SpawnOptions;
|
|
34
|
+
timeout: number;
|
|
35
|
+
persist: boolean;
|
|
36
|
+
stdin: ExecProcess;
|
|
37
|
+
throwOnError: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface TinyExec {
|
|
40
|
+
(command: string, args?: string[], options?: Partial<Options>): Result;
|
|
41
|
+
}
|
|
42
|
+
declare class ExecProcess implements Result {
|
|
43
|
+
protected _process?: ChildProcess;
|
|
44
|
+
protected _aborted: boolean;
|
|
45
|
+
protected _options: Partial<Options>;
|
|
46
|
+
protected _command: string;
|
|
47
|
+
protected _args: string[];
|
|
48
|
+
protected _resolveClose?: () => void;
|
|
49
|
+
protected _processClosed: Promise<void>;
|
|
50
|
+
protected _thrownError?: Error;
|
|
51
|
+
get process(): ChildProcess | undefined;
|
|
52
|
+
get pid(): number | undefined;
|
|
53
|
+
get exitCode(): number | undefined;
|
|
54
|
+
constructor(command: string, args?: string[], options?: Partial<Options>);
|
|
55
|
+
kill(signal?: KillSignal): boolean;
|
|
56
|
+
get aborted(): boolean;
|
|
57
|
+
get killed(): boolean;
|
|
58
|
+
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
|
|
59
|
+
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
60
|
+
protected _waitForOutput(): Promise<Output>;
|
|
61
|
+
then<TResult1 = Output, TResult2 = never>(onfulfilled?: ((value: Output) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
62
|
+
protected _streamOut?: Readable;
|
|
63
|
+
protected _streamErr?: Readable;
|
|
64
|
+
spawn(): void;
|
|
65
|
+
protected _resetState(): void;
|
|
66
|
+
protected _onError: (err: Error) => void;
|
|
67
|
+
protected _onClose: () => void;
|
|
68
|
+
}
|
|
69
|
+
declare const x: TinyExec;
|
|
70
|
+
declare const exec: TinyExec; //#endregion
|
|
71
|
+
//#endregion
|
|
72
|
+
export { ExecProcess, KillSignal, NonZeroExitError, Options, Output, OutputApi, PipeOptions, Result, TinyExec, exec, x };
|