npm-check-updates 21.0.2 → 22.0.0
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/README.md +30 -11
- package/build/chunks/_stub_typescript-Wx0CrVhR.cjs +1 -0
- package/build/chunks/_stub_typescript-gMx00gpr.js +19 -0
- package/build/chunks/chunk-BAUY9lu4.cjs +1 -0
- package/build/chunks/chunk-Njdj7H0c.js +29 -0
- package/build/chunks/p-map-Le4OxzRU.cjs +3 -0
- package/build/chunks/{p-map-iLLJQmmj.cjs.map → p-map-Le4OxzRU.cjs.map} +1 -1
- package/build/chunks/p-map-OzxwbPLg.js +84 -0
- package/build/chunks/{p-map-DaKUJ_MH.js.map → p-map-OzxwbPLg.js.map} +1 -1
- package/build/cli.cjs +1 -1
- package/build/cli.js +3 -3
- package/build/index.cjs +392 -376
- package/build/index.cjs.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +19003 -17588
- package/build/index.js.map +1 -1
- package/package.json +15 -14
- package/build/chunks/p-map-DaKUJ_MH.js +0 -109
- package/build/chunks/p-map-iLLJQmmj.cjs +0 -3
package/README.md
CHANGED
|
@@ -215,7 +215,7 @@ Options that take no arguments can be negated by prefixing them with `--no-`, e.
|
|
|
215
215
|
</tr>
|
|
216
216
|
<tr>
|
|
217
217
|
<td>--configFileName <s></td>
|
|
218
|
-
<td>Config file name. (default: .ncurc.{json,yml,js,cjs})</td>
|
|
218
|
+
<td>Config file name. (default: .ncurc or .ncurc.{json,yaml,yml,js,mjs,cjs})</td>
|
|
219
219
|
</tr>
|
|
220
220
|
<tr>
|
|
221
221
|
<td>--configFilePath <path></td>
|
|
@@ -430,7 +430,7 @@ The value can be a plain number (days) or a string with a unit suffix:
|
|
|
430
430
|
--cooldown 12h 12 hours
|
|
431
431
|
--cooldown 30m 30 minutes
|
|
432
432
|
|
|
433
|
-
|
|
433
|
+
With the default `--target latest`, if the latest dist-tag version is within the cooldown window, ncu falls back to the greatest version that passes the cooldown threshold. To instead skip the package entirely (strict behaviour), use `--target "@latest"`.
|
|
434
434
|
|
|
435
435
|
Example:
|
|
436
436
|
|
|
@@ -452,11 +452,22 @@ With default target (latest):
|
|
|
452
452
|
$ ncu --cooldown 5
|
|
453
453
|
```
|
|
454
454
|
|
|
455
|
+
Falls back to 1.2.0 because:
|
|
456
|
+
|
|
457
|
+
- Latest version (1.3.0) is only 4 days old (within 5-day cooldown)
|
|
458
|
+
- 1.2.0 is the greatest version that is at least 5 days old
|
|
459
|
+
|
|
460
|
+
With `@latest` strict target:
|
|
461
|
+
|
|
462
|
+
```js
|
|
463
|
+
$ ncu --cooldown 5 --target @latest
|
|
464
|
+
```
|
|
465
|
+
|
|
455
466
|
No update will be suggested because:
|
|
456
467
|
|
|
457
|
-
- Latest version (1.3.0) is only 4 days old
|
|
468
|
+
- Latest version (1.3.0) is only 4 days old
|
|
458
469
|
- Cooldown requires versions to be at least 5 days old
|
|
459
|
-
-
|
|
470
|
+
- `@latest` is strict: no fallback to older versions
|
|
460
471
|
|
|
461
472
|
With `@beta`/`@tag` target:
|
|
462
473
|
|
|
@@ -483,10 +494,6 @@ Each target will select the best version that is at least 5 days old:
|
|
|
483
494
|
minor → 1.2.0 (highest minor version outside cooldown)
|
|
484
495
|
patch → 1.1.1 (highest patch version outside cooldown)
|
|
485
496
|
|
|
486
|
-
Note for latest/tag targets:
|
|
487
|
-
|
|
488
|
-
> :warning: For packages that update frequently (e.g. daily releases), using a long cooldown period (7+ days) with the default `--target latest` or `--target @tag` may prevent all updates since new versions will be published before older ones meet the cooldown requirement. Please consider this when setting your cooldown period.
|
|
489
|
-
|
|
490
497
|
You can also provide a custom function in your .ncurc.js file or when importing npm-check-updates as a module.
|
|
491
498
|
|
|
492
499
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
@@ -869,7 +876,7 @@ Determines the version to upgrade to. (default: "latest")
|
|
|
869
876
|
|
|
870
877
|
<table>
|
|
871
878
|
<tr><td>greatest</td><td>Upgrade to the highest version number published, regardless of release date or tag. Includes prereleases.</td></tr>
|
|
872
|
-
<tr><td>latest</td><td>Upgrade to whatever the package's "latest"
|
|
879
|
+
<tr><td>latest</td><td>Upgrade to whatever the package's "latest" dist-tag points to. When used with --cooldown, falls back to the greatest version that passes the cooldown threshold if the latest is too recent. Use --target "@latest" for strict behaviour that skips the package instead. Excludes prereleases unless --pre is specified.</td></tr>
|
|
873
880
|
<tr><td>minor</td><td>Upgrade to the highest minor version without bumping the major version.</td></tr>
|
|
874
881
|
<tr><td>newest</td><td>Upgrade to the version with the most recent publish date, even if there are other version numbers that are higher. Includes prereleases.</td></tr>
|
|
875
882
|
<tr><td>patch</td><td>Upgrade to the highest patch version without bumping the minor or major versions.</td></tr>
|
|
@@ -902,9 +909,21 @@ target: (name, semver) => {
|
|
|
902
909
|
|
|
903
910
|
## Config File
|
|
904
911
|
|
|
905
|
-
Add a `.ncurc.{json,yml,js,cjs}` file to your project directory to specify configuration information.
|
|
912
|
+
Add a `.ncurc` or `.ncurc.{json,yaml,yml,js,mjs,cjs}` file to your project directory to specify configuration information.
|
|
913
|
+
|
|
914
|
+
`.ncurc` without an extension can be in **JSON or YAML** format. For example:
|
|
915
|
+
|
|
916
|
+
**.ncurc:**
|
|
917
|
+
|
|
918
|
+
```yaml
|
|
919
|
+
upgrade: true
|
|
920
|
+
filter: svelte
|
|
921
|
+
reject:
|
|
922
|
+
- '@types/estree'
|
|
923
|
+
- ts-node
|
|
924
|
+
```
|
|
906
925
|
|
|
907
|
-
|
|
926
|
+
**.ncurc.json:**
|
|
908
927
|
|
|
909
928
|
```json
|
|
910
929
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=require("./chunk-BAUY9lu4.cjs");var n=t.__exportAll({createProgram:()=>r,default:()=>i,version:()=>e});function r(){throw new Error("TypeScript loader is not available in this build")}var e,i,u=t.__esmMin((()=>{e="0.0.0-stub",i={version:e,createProgram:r}}));Object.defineProperty(exports,"_stub_typescript_exports",{enumerable:!0,get:function(){return n}});Object.defineProperty(exports,"init__stub_typescript",{enumerable:!0,get:function(){return u}});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { n as a, r as s } from "./chunk-Njdj7H0c.js";
|
|
2
|
+
var o = /* @__PURE__ */ s({
|
|
3
|
+
createProgram: () => t,
|
|
4
|
+
default: () => e,
|
|
5
|
+
version: () => r
|
|
6
|
+
});
|
|
7
|
+
function t() {
|
|
8
|
+
throw new Error("TypeScript loader is not available in this build");
|
|
9
|
+
}
|
|
10
|
+
var r, e, _ = a((() => {
|
|
11
|
+
r = "0.0.0-stub", e = {
|
|
12
|
+
version: r,
|
|
13
|
+
createProgram: t
|
|
14
|
+
};
|
|
15
|
+
}));
|
|
16
|
+
export {
|
|
17
|
+
_ as n,
|
|
18
|
+
o as t
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.create,u=Object.defineProperty,O=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,f=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,P=(e,r)=>()=>(e&&(r=e(e=0)),r),g=(e,r)=>()=>(r||(e((r={exports:{}}).exports,r),e=null),r.exports),s=(e,r)=>{let t={};for(var o in e)u(t,o,{get:e[o],enumerable:!0});return r||u(t,Symbol.toStringTag,{value:"Module"}),t},p=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(var a=v(r),_=0,c=a.length,n;_<c;_++)n=a[_],!l.call(e,n)&&n!==t&&u(e,n,{get:(b=>r[b]).bind(null,n),enumerable:!(o=O(r,n))||o.enumerable});return e},j=(e,r,t)=>(t=e!=null?i(f(e)):{},p(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e)),y=e=>l.call(e,"module.exports")?e["module.exports"]:p(u({},"__esModule",{value:!0}),e);Object.defineProperty(exports,"__commonJSMin",{enumerable:!0,get:function(){return g}});Object.defineProperty(exports,"__esmMin",{enumerable:!0,get:function(){return P}});Object.defineProperty(exports,"__exportAll",{enumerable:!0,get:function(){return s}});Object.defineProperty(exports,"__toCommonJS",{enumerable:!0,get:function(){return y}});Object.defineProperty(exports,"__toESM",{enumerable:!0,get:function(){return j}});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire as c } from "node:module";
|
|
2
|
+
var i = Object.create, _ = Object.defineProperty, O = Object.getOwnPropertyDescriptor, b = Object.getOwnPropertyNames, P = Object.getPrototypeOf, u = Object.prototype.hasOwnProperty, f = (e, r) => () => (e && (r = e(e = 0)), r), j = (e, r) => () => (r || (e((r = { exports: {} }).exports, r), e = null), r.exports), x = (e, r) => {
|
|
3
|
+
let t = {};
|
|
4
|
+
for (var o in e)
|
|
5
|
+
_(t, o, {
|
|
6
|
+
get: e[o],
|
|
7
|
+
enumerable: !0
|
|
8
|
+
});
|
|
9
|
+
return r || _(t, Symbol.toStringTag, { value: "Module" }), t;
|
|
10
|
+
}, n = (e, r, t, o) => {
|
|
11
|
+
if (r && typeof r == "object" || typeof r == "function")
|
|
12
|
+
for (var p = b(r), l = 0, s = p.length, a; l < s; l++)
|
|
13
|
+
a = p[l], !u.call(e, a) && a !== t && _(e, a, {
|
|
14
|
+
get: ((v) => r[v]).bind(null, a),
|
|
15
|
+
enumerable: !(o = O(r, a)) || o.enumerable
|
|
16
|
+
});
|
|
17
|
+
return e;
|
|
18
|
+
}, w = (e, r, t) => (t = e != null ? i(P(e)) : {}, n(r || !e || !e.__esModule ? _(t, "default", {
|
|
19
|
+
value: e,
|
|
20
|
+
enumerable: !0
|
|
21
|
+
}) : t, e)), M = (e) => u.call(e, "module.exports") ? e["module.exports"] : n(_({}, "__esModule", { value: !0 }), e), S = /* @__PURE__ */ c(import.meta.url);
|
|
22
|
+
export {
|
|
23
|
+
M as a,
|
|
24
|
+
S as i,
|
|
25
|
+
f as n,
|
|
26
|
+
w as o,
|
|
27
|
+
x as r,
|
|
28
|
+
j as t
|
|
29
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const S=require("./chunk-BAUY9lu4.cjs");var T=S.__exportAll({default:()=>g,pMapSkip:()=>f});async function g(n,m,{concurrency:o=Number.POSITIVE_INFINITY,stopOnError:b=!0,signal:i}={}){return new Promise((E,M)=>{if(n[Symbol.iterator]===void 0&&n[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof n})`);if(typeof m!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(o)&&o>=1||o===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${o}\` (${typeof o})`);const c=[],l=[],d=new Map;let I=!1,s=!1,v=!1,p=0,w=0;const k=n[Symbol.iterator]===void 0?n[Symbol.asyncIterator]():n[Symbol.iterator](),_=()=>{a(i.reason)},x=()=>{i?.removeEventListener("abort",_)},h=e=>{E(e),x()},a=e=>{I=!0,s=!0,M(e),x()};i&&(i.aborted&&a(i.reason),i.addEventListener("abort",_,{once:!0}));const y=async()=>{if(s)return;const e=await k.next(),u=w;if(w++,e.done){if(v=!0,p===0&&!s){if(!b&&l.length>0){a(new AggregateError(l));return}if(s=!0,d.size===0){h(c);return}const t=[];for(const[r,N]of c.entries())d.get(r)!==f&&t.push(N);h(t)}return}p++,(async()=>{try{const t=await e.value;if(s)return;const r=await m(t,u);r===f&&d.set(u,r),c[u]=r,p--,await y()}catch(t){if(b)a(t);else{l.push(t),p--;try{await y()}catch(r){a(r)}}}})()};(async()=>{for(let e=0;e<o;e++){try{await y()}catch(u){a(u);break}if(v||I)break}})()})}var f,P=S.__esmMin((()=>{f=Symbol("skip")}));Object.defineProperty(exports,"init_p_map",{enumerable:!0,get:function(){return P}});Object.defineProperty(exports,"pMap",{enumerable:!0,get:function(){return g}});Object.defineProperty(exports,"p_map_exports",{enumerable:!0,get:function(){return T}});
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=p-map-Le4OxzRU.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-map-iLLJQmmj.cjs","names":[],"sources":["../../node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet pendingPromisesCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpendingPromisesCount++;\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\tpendingPromisesCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n"],"x_google_ignoreList":[0],"mappings":"0yBAAA,eAA8B,EAC7B,EACA,EACA,CACC,YAAA,EAAc,OAAO,kBACrB,YAAA,EAAc,GACd,OAAA,CAAA,EACG,CAAA,EACH,CACD,OAAO,IAAI,QAAA,CAAS,EAAU,IAAY,CACzC,GAAI,EAAS,OAAO,QAAA,IAAc,QAAa,EAAS,OAAO,aAAA,IAAmB,OACjF,MAAM,IAAI,UAAU,8EAA8E,OAAO,CAAA,GAAS,EAGnH,GAAI,OAAO,GAAW,WACrB,MAAM,IAAI,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AE/B,GAAI,EACH,OAGD,MAAM,EAAQ,MAAM,EAAO,EAAS,CAAA,EAGhC,IAAU,GACb,EAAkB,IAAI,EAAO,CAAA,EAG9B,EAAO,CAAA,EAAS,EAEhB,IACA,MAAM,EAAA,QACE,EAAO,CACf,GAAI,EACH,EAAO,CAAA,MACD,CACN,EAAO,KAAK,CAAA,EACZ,IAMA,GAAI,CACH,MAAM,EAAA,QACE,EAAO,CACf,EAAO,CAAA,WAaX,SAAY,CACZ,QAAS,EAAQ,EAAG,EAAQ,EAAa,IAAS,CACjD,GAAI,CAEH,MAAM,EAAA,QACE,EAAO,CACf,EAAO,CAAA,EACP,MAGD,GAAI,GAAkB,EACrB,6BAiHQ,EAAW,OAAO,MAAA"}
|
|
1
|
+
{"version":3,"file":"p-map-Le4OxzRU.cjs","names":[],"sources":["../../node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet pendingPromisesCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpendingPromisesCount++;\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\tpendingPromisesCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t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C,EAAY,CACxC,GAAI,CAAC,GAAe,EAAO,OAAS,EAAG,CACtC,EAAO,IAAI,eAAe,CAAA,CAAO,EACjC,OAKD,GAFA,EAAa,GAET,EAAkB,OAAS,EAAG,CACjC,EAAQ,CAAA,EACR,OAGD,MAAM,EAAa,CAAA,EAGnB,SAAW,CAAC,EAAO,CAAA,IAAU,EAAO,QAAA,EAC/B,EAAkB,IAAI,CAAA,IAAW,GAIrC,EAAW,KAAK,CAAA,EAGjB,EAAQ,CAAA,EAGT,OAGD,KAGC,SAAY,CACZ,GAAI,CACH,MAAM,EAAU,MAAM,EAAS,MAE/B,GAAI,EACH,OAGD,MAAM,EAAQ,MAAM,EAAO,EAAS,CAAA,EAGhC,IAAU,GACb,EAAkB,IAAI,EAAO,CAAA,EAG9B,EAAO,CAAA,EAAS,EAEhB,IACA,MAAM,EAAA,QACE,EAAO,CACf,GAAI,EACH,EAAO,CAAA,MACD,CACN,EAAO,KAAK,CAAA,EACZ,IAMA,GAAI,CACH,MAAM,EAAA,QACE,EAAO,CACf,EAAO,CAAA,WAaX,SAAY,CACZ,QAAS,EAAQ,EAAG,EAAQ,EAAa,IAAS,CACjD,GAAI,CAEH,MAAM,EAAA,QACE,EAAO,CACf,EAAO,CAAA,EACP,MAGD,GAAI,GAAkB,EACrB,sCAiHQ,EAAW,OAAO,MAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { n as T, r as g } from "./chunk-Njdj7H0c.js";
|
|
2
|
+
var L = /* @__PURE__ */ g({
|
|
3
|
+
default: () => k,
|
|
4
|
+
pMapSkip: () => u
|
|
5
|
+
});
|
|
6
|
+
async function k(o, y, { concurrency: n = Number.POSITIVE_INFINITY, stopOnError: m = !0, signal: a } = {}) {
|
|
7
|
+
return new Promise((_, E) => {
|
|
8
|
+
if (o[Symbol.iterator] === void 0 && o[Symbol.asyncIterator] === void 0) throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof o})`);
|
|
9
|
+
if (typeof y != "function") throw new TypeError("Mapper function is required");
|
|
10
|
+
if (!(Number.isSafeInteger(n) && n >= 1 || n === Number.POSITIVE_INFINITY)) throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);
|
|
11
|
+
const c = [], l = [], d = /* @__PURE__ */ new Map();
|
|
12
|
+
let v = !1, i = !1, w = !1, f = 0, b = 0;
|
|
13
|
+
const M = o[Symbol.iterator] === void 0 ? o[Symbol.asyncIterator]() : o[Symbol.iterator](), x = () => {
|
|
14
|
+
s(a.reason);
|
|
15
|
+
}, S = () => {
|
|
16
|
+
a?.removeEventListener("abort", x);
|
|
17
|
+
}, h = (e) => {
|
|
18
|
+
_(e), S();
|
|
19
|
+
}, s = (e) => {
|
|
20
|
+
v = !0, i = !0, E(e), S();
|
|
21
|
+
};
|
|
22
|
+
a && (a.aborted && s(a.reason), a.addEventListener("abort", x, { once: !0 }));
|
|
23
|
+
const I = async () => {
|
|
24
|
+
if (i) return;
|
|
25
|
+
const e = await M.next(), p = b;
|
|
26
|
+
if (b++, e.done) {
|
|
27
|
+
if (w = !0, f === 0 && !i) {
|
|
28
|
+
if (!m && l.length > 0) {
|
|
29
|
+
s(new AggregateError(l));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (i = !0, d.size === 0) {
|
|
33
|
+
h(c);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const t = [];
|
|
37
|
+
for (const [r, N] of c.entries())
|
|
38
|
+
d.get(r) !== u && t.push(N);
|
|
39
|
+
h(t);
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
f++, (async () => {
|
|
44
|
+
try {
|
|
45
|
+
const t = await e.value;
|
|
46
|
+
if (i) return;
|
|
47
|
+
const r = await y(t, p);
|
|
48
|
+
r === u && d.set(p, r), c[p] = r, f--, await I();
|
|
49
|
+
} catch (t) {
|
|
50
|
+
if (m) s(t);
|
|
51
|
+
else {
|
|
52
|
+
l.push(t), f--;
|
|
53
|
+
try {
|
|
54
|
+
await I();
|
|
55
|
+
} catch (r) {
|
|
56
|
+
s(r);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
};
|
|
62
|
+
(async () => {
|
|
63
|
+
for (let e = 0; e < n; e++) {
|
|
64
|
+
try {
|
|
65
|
+
await I();
|
|
66
|
+
} catch (p) {
|
|
67
|
+
s(p);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
if (w || v) break;
|
|
71
|
+
}
|
|
72
|
+
})();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
var u, P = T((() => {
|
|
76
|
+
u = /* @__PURE__ */ Symbol("skip");
|
|
77
|
+
}));
|
|
78
|
+
export {
|
|
79
|
+
k as n,
|
|
80
|
+
L as r,
|
|
81
|
+
P as t
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=p-map-OzxwbPLg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-map-DaKUJ_MH.js","names":[],"sources":["../../node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet pendingPromisesCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpendingPromisesCount++;\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\tpendingPromisesCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,eAA8B,EAC7B,GACA,GACA,EACC,aAAA,IAAc,OAAO,mBACrB,aAAA,IAAc,IACd,QAAA,EAAA,IACG,CAAA,GACH;AACD,SAAO,IAAI,QAAA,CAAS,GAAU,MAAY;AACzC,QAAI,EAAS,OAAO,QAAA,MAAc,UAAa,EAAS,OAAO,aAAA,MAAmB,OACjF,OAAM,IAAI,UAAU,8EAA8E,OAAO,CAAA,GAAS;AAGnH,QAAI,OAAO,KAAW,WACrB,OAAM,IAAI,UAAU,6BAAA;AAGrB,QAAI,EAAG,OAAO,cAAc,CAAA,KAAgB,KAAe,KAAM,MAAgB,OAAO,mBACvF,OAAM,IAAI,UAAU,kFAAkF,CAAA,OAAkB,OAAO,CAAA,GAAY;AAG5I,UAAM,IAAS,CAAA,GACT,IAAS,CAAA,GACT,IAAoB,oBAAI,IAAA;AAC9B,QAAI,IAAa,IACb,IAAa,IACb,IAAiB,IACjB,IAAiB,GACjB,IAAe;AACnB,UAAM,IAAW,EAAS,OAAO,QAAA,MAAc,SAAY,EAAS,OAAO,aAAA,EAAA,IAAmB,EAAS,OAAO,QAAA,EAAA,GAExG,IAAA,MAAuB;AAC5B,MAAA,EAAO,EAAO,MAAA;AAAA,OAGT,IAAA,MAAgB;AACrB,MAAA,GAAQ,oBAAoB,SAAS,CAAA;AAAA,OAGhC,IAAA,CAAU,MAAS;AACxB,MAAA,EAAS,CAAA,GACT,EAAA;AAAA,OAGK,IAAA,CAAS,MAAU;AACxB,MAAA,IAAa,IACb,IAAa,IACb,E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kB,EACrB;AAAA;;;;;AAiHQ,EAAA,IAAW,uBAAO,MAAA"}
|
|
1
|
+
{"version":3,"file":"p-map-OzxwbPLg.js","names":[],"sources":["../../node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet pendingPromisesCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tpendingPromisesCount++;\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\tpendingPromisesCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tpendingPromisesCount--;\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAAA,eAA8B,EAC7B,GACA,GACA,EACC,aAAA,IAAc,OAAO,mBACrB,aAAA,IAAc,IACd,QAAA,EAAA,IACG,CAAA,GACH;AACD,SAAO,IAAI,QAAA,CAAS,GAAU,MAAY;AACzC,QAAI,EAAS,OAAO,QAAA,MAAc,UAAa,EAAS,OAAO,aAAA,MAAmB,OACjF,OAAM,IAAI,UAAU,8EAA8E,OAAO,CAAA,GAAS;AAGnH,QAAI,OAAO,KAAW,WACrB,OAAM,IAAI,UAAU,6BAAA;AAGrB,Q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jB,UAAA,EAAQ,CAAA;AAAA;AAGT;AAAA;AAGD,MAAA,MAGC,YAAY;AACZ,YAAI;AACH,gBAAM,IAAU,MAAM,EAAS;AAE/B,cAAI,EACH;AAGD,gBAAM,IAAQ,MAAM,EAAO,GAAS,CAAA;AAGpC,UAAI,MAAU,KACb,EAAkB,IAAI,GAAO,CAAA,GAG9B,EAAO,CAAA,IAAS,GAEhB,KACA,MAAM,EAAA;AAAA,iBACE,GAAO;AACf,cAAI,EACH,CAAA,EAAO,CAAA;AAAA,eACD;AACN,YAAA,EAAO,KAAK,CAAA,GACZ;AAMA,gBAAI;AACH,oBAAM,EAAA;AAAA,qBACE,GAAO;AACf,cAAA,EAAO,CAAA;AAAA;;;;;AAaZ,KAAC,YAAY;AACZ,eAAS,IAAQ,GAAG,IAAQ,GAAa,KAAS;AACjD,YAAI;AAEH,gBAAM,EAAA;AAAA,iBACE,GAAO;AACf,UAAA,EAAO,CAAA;AACP;AAAA;AAGD,YAAI,KAAkB,EACrB;AAAA;;;;;AAiHQ,EAAA,IAAW,uBAAO,MAAA"}
|
package/build/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./chunks/
|
|
2
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./chunks/chunk-BAUY9lu4.cjs"),W=require("./index.cjs");let Fe=require("path");Fe=T.__toESM(Fe,1);let Ge=require("os");Ge=T.__toESM(Ge,1);let $=require("node:process");$=T.__toESM($,1);let ge=require("node:os");ge=T.__toESM(ge,1);let V=require("node:path");V=T.__toESM(V,1);let Gt=require("node:url"),X=require("node:util"),j=require("node:fs");j=T.__toESM(j,1);let Er=require("node:child_process");var Te=T.__commonJSMin((e=>{var r=class extends Error{constructor(l,i,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=l,this.nestedError=void 0}},n=class extends r{constructor(l){super(1,"commander.invalidArgument",l),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=r,e.InvalidArgumentError=n})),st=T.__commonJSMin((e=>{var{InvalidArgumentError:r}=Te(),n=class{constructor(i,o){switch(this.description=o||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(i,o){return o===this.defaultValue||!Array.isArray(o)?[i]:(o.push(i),o)}default(i,o){return this.defaultValue=i,this.defaultValueDescription=o,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(o,D)=>{if(!this.argChoices.includes(o))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(o,D):o},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function l(i){const o=i.name()+(i.variadic===!0?"...":"");return i.required?"<"+o+">":"["+o+"]"}e.Argument=n,e.humanReadableArgName=l})),Jt=T.__commonJSMin((e=>{var{humanReadableArgName:r}=st(),n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(i){this.helpWidth=this.helpWidth??i.helpWidth??80}visibleCommands(i){const o=i.commands.filter(s=>!s._hidden),D=i._getHelpCommand();return D&&!D._hidden&&o.push(D),this.sortSubcommands&&o.sort((s,u)=>s.name().localeCompare(u.name())),o}compareOptions(i,o){const D=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return D(i).localeCompare(D(o))}visibleOptions(i){const o=i.options.filter(s=>!s.hidden),D=i._getHelpOption();if(D&&!D.hidden){const s=D.short&&i._findOption(D.short),u=D.long&&i._findOption(D.long);!s&&!u?o.push(D):D.long&&!u?o.push(i.createOption(D.long,D.description)):D.short&&!s&&o.push(i.createOption(D.short,D.description))}return this.sortOptions&&o.sort(this.compareOptions),o}visibleGlobalOptions(i){if(!this.showGlobalOptions)return[];const o=[];for(let D=i.parent;D;D=D.parent){const s=D.options.filter(u=>!u.hidden);o.push(...s)}return this.sortOptions&&o.sort(this.compareOptions),o}visibleArguments(i){return i._argsDescription&&i.registeredArguments.forEach(o=>{o.description=o.description||i._argsDescription[o.name()]||""}),i.registeredArguments.find(o=>o.description)?i.registeredArguments:[]}subcommandTerm(i){const o=i.registeredArguments.map(D=>r(D)).join(" ");return i._name+(i._aliases[0]?"|"+i._aliases[0]:"")+(i.options.length?" [options]":"")+(o?" "+o:"")}optionTerm(i){return i.flags}argumentTerm(i){return i.name()}longestSubcommandTermLength(i,o){return o.visibleCommands(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleSubcommandTerm(o.subcommandTerm(s)))),0)}longestOptionTermLength(i,o){return o.visibleOptions(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleOptionTerm(o.optionTerm(s)))),0)}longestGlobalOptionTermLength(i,o){return o.visibleGlobalOptions(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleOptionTerm(o.optionTerm(s)))),0)}longestArgumentTermLength(i,o){return o.visibleArguments(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleArgumentTerm(o.argumentTerm(s)))),0)}commandUsage(i){let o=i._name;i._aliases[0]&&(o=o+"|"+i._aliases[0]);let D="";for(let s=i.parent;s;s=s.parent)D=s.name()+" "+D;return D+o+" "+i.usage()}commandDescription(i){return i.description()}subcommandDescription(i){return i.summary()||i.description()}optionDescription(i){const o=[];if(i.argChoices&&o.push(`choices: ${i.argChoices.map(D=>JSON.stringify(D)).join(", ")}`),i.defaultValue!==void 0&&(i.required||i.optional||i.isBoolean()&&typeof i.defaultValue=="boolean")&&o.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),i.presetArg!==void 0&&i.optional&&o.push(`preset: ${JSON.stringify(i.presetArg)}`),i.envVar!==void 0&&o.push(`env: ${i.envVar}`),o.length>0){const D=`(${o.join(", ")})`;return i.description?`${i.description} ${D}`:D}return i.description}argumentDescription(i){const o=[];if(i.argChoices&&o.push(`choices: ${i.argChoices.map(D=>JSON.stringify(D)).join(", ")}`),i.defaultValue!==void 0&&o.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),o.length>0){const D=`(${o.join(", ")})`;return i.description?`${i.description} ${D}`:D}return i.description}formatItemList(i,o,D){return o.length===0?[]:[D.styleTitle(i),...o,""]}groupItems(i,o,D){const s=new Map;return i.forEach(u=>{const c=D(u);s.has(c)||s.set(c,[])}),o.forEach(u=>{const c=D(u);s.has(c)||s.set(c,[]),s.get(c).push(u)}),s}formatHelp(i,o){const D=o.padWidth(i,o),s=o.helpWidth??80;function u(F,g){return o.formatItem(F,D,g,o)}let c=[`${o.styleTitle("Usage:")} ${o.styleUsage(o.commandUsage(i))}`,""];const m=o.commandDescription(i);m.length>0&&(c=c.concat([o.boxWrap(o.styleCommandDescription(m),s),""]));const h=o.visibleArguments(i).map(F=>u(o.styleArgumentTerm(o.argumentTerm(F)),o.styleArgumentDescription(o.argumentDescription(F))));if(c=c.concat(this.formatItemList("Arguments:",h,o)),this.groupItems(i.options,o.visibleOptions(i),F=>F.helpGroupHeading??"Options:").forEach((F,g)=>{const E=F.map(v=>u(o.styleOptionTerm(o.optionTerm(v)),o.styleOptionDescription(o.optionDescription(v))));c=c.concat(this.formatItemList(g,E,o))}),o.showGlobalOptions){const F=o.visibleGlobalOptions(i).map(g=>u(o.styleOptionTerm(o.optionTerm(g)),o.styleOptionDescription(o.optionDescription(g))));c=c.concat(this.formatItemList("Global Options:",F,o))}return this.groupItems(i.commands,o.visibleCommands(i),F=>F.helpGroup()||"Commands:").forEach((F,g)=>{const E=F.map(v=>u(o.styleSubcommandTerm(o.subcommandTerm(v)),o.styleSubcommandDescription(o.subcommandDescription(v))));c=c.concat(this.formatItemList(g,E,o))}),c.join(`
|
|
3
3
|
`)}displayWidth(i){return l(i).length}styleTitle(i){return i}styleUsage(i){return i.split(" ").map(o=>o==="[options]"?this.styleOptionText(o):o==="[command]"?this.styleSubcommandText(o):o[0]==="["||o[0]==="<"?this.styleArgumentText(o):this.styleCommandText(o)).join(" ")}styleCommandDescription(i){return this.styleDescriptionText(i)}styleOptionDescription(i){return this.styleDescriptionText(i)}styleSubcommandDescription(i){return this.styleDescriptionText(i)}styleArgumentDescription(i){return this.styleDescriptionText(i)}styleDescriptionText(i){return i}styleOptionTerm(i){return this.styleOptionText(i)}styleSubcommandTerm(i){return i.split(" ").map(o=>o==="[options]"?this.styleOptionText(o):o[0]==="["||o[0]==="<"?this.styleArgumentText(o):this.styleSubcommandText(o)).join(" ")}styleArgumentTerm(i){return this.styleArgumentText(i)}styleOptionText(i){return i}styleArgumentText(i){return i}styleSubcommandText(i){return i}styleCommandText(i){return i}padWidth(i,o){return Math.max(o.longestOptionTermLength(i,o),o.longestGlobalOptionTermLength(i,o),o.longestSubcommandTermLength(i,o),o.longestArgumentTermLength(i,o))}preformatted(i){return/\n[^\S\r\n]/.test(i)}formatItem(i,o,D,s){const c=" ".repeat(2);if(!D)return c+i;const m=i.padEnd(o+i.length-s.displayWidth(i)),h=2,F=(this.helpWidth??80)-o-h-2;let g;return F<this.minWidthToWrap||s.preformatted(D)?g=D:g=s.boxWrap(D,F).replace(/\n/g,`
|
|
4
4
|
`+" ".repeat(o+h)),c+m+" ".repeat(h)+g.replace(/\n/g,`
|
|
5
5
|
${c}`)}boxWrap(i,o){if(o<this.minWidthToWrap)return i;const D=i.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,u=[];return D.forEach(c=>{const m=c.match(s);if(m===null){u.push("");return}let h=[m.shift()],F=this.displayWidth(h[0]);m.forEach(g=>{const E=this.displayWidth(g);if(F+E<=o){h.push(g),F+=E;return}u.push(h.join(""));const v=g.trimStart();h=[v],F=this.displayWidth(v)}),u.push(h.join(""))}),u.join(`
|
package/build/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as wr,
|
|
2
|
+
import { a as wr, i as M, n as Br, o as oe, r as Or, t as k } from "./chunks/chunk-Njdj7H0c.js";
|
|
3
3
|
import Sr, { a as xr, c as vt, d as Tr, f as ge, i as _t, l as Rr, n as $r, o as Pr, r as Ue, s as Nr, t as Ir, u as ne } from "./index.js";
|
|
4
4
|
import Pe from "path";
|
|
5
5
|
import kr from "os";
|
|
@@ -5389,7 +5389,7 @@ var zn = /* @__PURE__ */ Or({
|
|
|
5389
5389
|
round: () => st,
|
|
5390
5390
|
single: () => nt,
|
|
5391
5391
|
singleDouble: () => at
|
|
5392
|
-
}), nt, it, st, ot, at, Dt, lt, ct, Er, Xn =
|
|
5392
|
+
}), nt, it, st, ot, at, Dt, lt, ct, Er, Xn = Br((() => {
|
|
5393
5393
|
nt = {
|
|
5394
5394
|
topLeft: "┌",
|
|
5395
5395
|
top: "─",
|
|
@@ -5473,7 +5473,7 @@ var zn = /* @__PURE__ */ Or({
|
|
|
5473
5473
|
arrow: ct
|
|
5474
5474
|
};
|
|
5475
5475
|
})), Qn = /* @__PURE__ */ k(((e, r) => {
|
|
5476
|
-
var n = (Xn(),
|
|
5476
|
+
var n = (Xn(), wr(zn).default);
|
|
5477
5477
|
r.exports = n, r.exports.default = n;
|
|
5478
5478
|
})), Zn = /* @__PURE__ */ oe(Qn(), 1), ei = /[\p{Lu}]/u, ti = /[\p{Ll}]/u, jt = /^[\p{Lu}](?![\p{Lu}])/gu, Cr = /([\p{Alpha}\p{N}_]|$)/u, Et = /[_.\- ]+/, ri = new RegExp("^" + Et.source), Lt = new RegExp(Et.source + Cr.source, "gu"), Mt = new RegExp("\\d+" + Cr.source, "gu"), ui = (e, r, n, l) => {
|
|
5479
5479
|
let i = !1, s = !1, D = !1, o = !1;
|