@socketsecurity/cli 0.14.23 → 0.14.25

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/dist/vendor.js CHANGED
@@ -1,39 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var require$$1 = require('node:path');
4
- var require$$8$1 = require('node:url');
5
- var require$$0 = require('node:module');
6
- var require$$2 = require('@yarnpkg/extensions');
7
- var require$$3 = require('fast-sort');
8
- var require$$4 = require('fs-extra');
9
- var require$$5 = require('pacote');
10
- var require$$6 = require('picomatch');
11
- var require$$14 = require('semver');
12
- var require$$8 = require('which');
13
- var require$$10 = require('browserslist');
14
- var require$$0$1 = require('node:process');
15
- var require$$1$1 = require('node:os');
16
- var require$$2$1 = require('node:tty');
17
- var require$$0$2 = require('node:fs');
18
- var require$$0$3 = require('node:util');
19
- var require$$2$2 = require('signal-exit');
20
- var require$$3$1 = require('cli-spinners');
21
- var require$$2$3 = require('emoji-regex');
3
+ var require$$1$1 = require('node:path');
4
+ var require$$8 = require('node:url');
5
+ var require$$0 = require('node:process');
6
+ var require$$1 = require('node:os');
7
+ var require$$2 = require('node:tty');
8
+ var require$$0$1 = require('node:fs');
9
+ var require$$0$2 = require('node:util');
10
+ var require$$2$1 = require('signal-exit');
11
+ var require$$3 = require('cli-spinners');
12
+ var require$$2$2 = require('emoji-regex');
22
13
  var require$$1$2 = require('supports-hyperlinks');
23
- var require$$1$4 = require('node:fs/promises');
24
- var require$$1$3 = require('@npmcli/package-json');
25
- var require$$2$4 = require('cacache');
26
- var require$$4$1 = require('libnpmpack');
27
- var require$$5$1 = require('make-fetch-happen');
28
- var require$$6$1 = require('normalize-package-data');
29
- var require$$7 = require('npm-package-arg');
30
- var require$$8$2 = require('packageurl-js');
31
- var require$$11 = require('spdx-correct');
32
- var require$$12 = require('spdx-expression-parse');
33
- var require$$13 = require('validate-npm-package-name');
34
- var require$$0$4 = require('prettier');
35
- var require$$2$6 = require('node:buffer');
36
- var require$$2$5 = require('node:child_process');
14
+ var require$$1$3 = require('node:fs/promises');
15
+ var require$$2$4 = require('node:buffer');
16
+ var require$$2$3 = require('node:child_process');
37
17
 
38
18
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
39
19
  var interopRequireWildcard = {};
@@ -97,582 +77,6 @@ function _interopRequireDefault(e) {
97
77
  };
98
78
  }
99
79
 
100
- function envAsBoolean$1(value) {
101
- return typeof value === 'string' ? value === '1' || value.toLowerCase() === 'true' : !!value;
102
- }
103
- function envAsString$1(value) {
104
- if (typeof value === 'string') {
105
- return value;
106
- }
107
- if (value === null || value === undefined) {
108
- return '';
109
- }
110
- return String(value);
111
- }
112
- var env$1 = {
113
- envAsBoolean: envAsBoolean$1,
114
- envAsString: envAsString$1
115
- };
116
-
117
- const Module = require$$0;
118
- // Available in Node v22.8.0.
119
- // https://nodejs.org/docs/latest/api/module.html#moduleenablecompilecachecachedir
120
- if (typeof Module.enableCompileCache === 'function') {
121
- Module.enableCompileCache();
122
- }
123
- const path$2 = require$$1;
124
- const {
125
- packageExtensions: yarnPkgExts
126
- } = require$$2;
127
- const {
128
- createNewSortInstance
129
- } = require$$3;
130
- const fs$1 = require$$4;
131
- const pacote$1 = require$$5;
132
- const picomatch = require$$6;
133
- const semver$1 = require$$14;
134
- const which = require$$8;
135
- const {
136
- envAsBoolean,
137
- envAsString
138
- } = env$1;
139
- const {
140
- sync: whichSync
141
- } = which;
142
- const UNDEFINED_LAZY_VALUE = {};
143
- const {
144
- __defineGetter__
145
- } = Object.prototype;
146
- const {
147
- execPath
148
- } = process;
149
- const {
150
- constructor: PacoteFetcherBase
151
- } = Reflect.getPrototypeOf(pacote$1.RegistryFetcher.prototype);
152
- const packumentCache$1 = new Map();
153
- const pacoteCachePath$1 = new PacoteFetcherBase(/*dummy package spec*/'x', {}).cache;
154
- function createLazyGetter(getter) {
155
- let lazyValue = UNDEFINED_LAZY_VALUE;
156
- return () => {
157
- if (lazyValue === UNDEFINED_LAZY_VALUE) {
158
- lazyValue = getter();
159
- }
160
- return lazyValue;
161
- };
162
- }
163
- function defineLazyGetter(object, propKey, getter) {
164
- __defineGetter__.call(object, propKey, createLazyGetter(getter));
165
- return object;
166
- }
167
- function defineLazyGetters(object, getterObj) {
168
- const keys = Reflect.ownKeys(getterObj);
169
- for (let i = 0, {
170
- length
171
- } = keys; i < length; i += 1) {
172
- const key = keys[i];
173
- defineLazyGetter(object, key, createLazyGetter(getterObj[key]));
174
- }
175
- return object;
176
- }
177
- const COLUMN_LIMIT = 80;
178
- const EMPTY_FILE = '/* empty */\n';
179
- const ENV$1 = Object.freeze({
180
- __proto__: null,
181
- // CI is always set to "true" in a GitHub action.
182
- // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
183
- CI: envAsBoolean(process.env.CI),
184
- // .github/workflows/provenance.yml defines this.
185
- NODE_AUTH_TOKEN: envAsString(process.env.NODE_AUTH_TOKEN),
186
- // PRE_COMMIT is set to "1" by our "test-pre-commit" script run by the
187
- // .husky/pre-commit hook.
188
- PRE_COMMIT: envAsBoolean(process.env.PRE_COMMIT)
189
- });
190
- const ESLINT_CONFIG_JS = 'eslint.config.js';
191
- const ESNEXT = 'esnext';
192
- const LICENSE = 'LICENSE';
193
- const LICENSE_GLOB = 'LICEN[CS]E{[.-]*,}';
194
- const LICENSE_GLOB_RECURSIVE = `**/${LICENSE_GLOB}`;
195
- const LICENSE_ORIGINAL = `${LICENSE}.original`;
196
- const LICENSE_ORIGINAL_GLOB = '*.original{.*,}';
197
- const LICENSE_ORIGINAL_GLOB_RECURSIVE = `**/${LICENSE_ORIGINAL_GLOB}`;
198
- const LOOP_SENTINEL$2 = 1_000_000;
199
- const MIT$1 = 'MIT';
200
- const NODE_MODULES = 'node_modules';
201
- const NODE_MODULES_GLOB_RECURSIVE = `**/${NODE_MODULES}`;
202
- const NODE_WORKSPACES = 'node_workspaces';
203
- const NODE_VERSION = process.versions.node;
204
- const NPM_ORG = 'socketregistry';
205
- const OVERRIDES = 'overrides';
206
- const PACKAGE_DEFAULT_SOCKET_CATEGORIES$1 = Object.freeze(['cleanup']);
207
- const PACKAGE_DEFAULT_VERSION = '1.0.0';
208
- const PACKAGE_JSON$1 = 'package.json';
209
- const PACKAGE_LOCK = 'package-lock.json';
210
- const PACKAGE_SCOPE$1 = `@${NPM_ORG}`;
211
- const README_GLOB = 'README{.*,}';
212
- const README_GLOB_RECURSIVE = `**/${README_GLOB}`;
213
- const README_MD = 'README.md';
214
- const REGISTRY_SCOPE_DELIMITER$1 = '__';
215
- const REGISTRY_WORKSPACE = 'registry';
216
- const REPO_ORG$1 = 'SocketDev';
217
- const REPO_NAME$1 = 'socket-registry';
218
- const TEMPLATE_CJS = 'cjs';
219
- const TEMPLATE_CJS_BROWSER = 'cjs-browser';
220
- const TEMPLATE_CJS_ESM = 'cjs-esm';
221
- const TEMPLATE_ES_SHIM_CONSTRUCTOR = 'es-shim-constructor';
222
- const TEMPLATE_ES_SHIM_PROTOTYPE_METHOD = 'es-shim-prototype-method';
223
- const TEMPLATE_ES_SHIM_STATIC_METHOD = 'es-shim-static-method';
224
- const TSCONFIG_JSON = 'tsconfig.json';
225
- const UNLICENCED$1 = 'UNLICENCED';
226
- const UNLICENSED$1 = 'UNLICENSED';
227
- const WIN_32 = process.platform === 'win32';
228
- const {
229
- compare: localeCompare$2
230
- } = new Intl.Collator();
231
- const naturalSort$1 = createNewSortInstance({
232
- comparer: new Intl.Collator(undefined, {
233
- numeric: true,
234
- sensitivity: 'base'
235
- }).compare
236
- });
237
- const innerReadDirNames = function innerReadDirNames(dirents, options) {
238
- const {
239
- includeEmpty,
240
- sort
241
- } = {
242
- __proto__: null,
243
- sort: true,
244
- includeEmpty: false,
245
- ...options
246
- };
247
- const names = dirents.filter(d => d.isDirectory() && (includeEmpty || !isDirEmptySync(path$2.join(d.parentPath, d.name)))).map(d => d.name);
248
- return sort ? names.sort(localeCompare$2) : names;
249
- };
250
- const matcherCache = new Map();
251
- const getGlobMatcher = function getGlobMatcher(glob, options) {
252
- const patterns = Array.isArray(glob) ? glob : [glob];
253
- const key = JSON.stringify({
254
- patterns,
255
- options
256
- });
257
- let matcher = matcherCache.get(key);
258
- if (matcher) {
259
- return matcher;
260
- }
261
- matcher = picomatch(patterns, {
262
- dot: true,
263
- nocase: true,
264
- ...options
265
- });
266
- matcherCache.set(key, matcher);
267
- return matcher;
268
- };
269
- const isDirEmptySync = function isDirEmptySync(dirname) {
270
- try {
271
- const files = fs$1.readdirSync(dirname);
272
- const {
273
- length
274
- } = files;
275
- if (length === 0) {
276
- return true;
277
- }
278
- // Lazily access constants.ignoreGlobs.
279
- const matcher = getGlobMatcher(constants$4.ignoreGlobs, {
280
- cwd: dirname
281
- });
282
- let ignoredCount = 0;
283
- for (let i = 0; i < length; i += 1) {
284
- if (matcher(files[i])) {
285
- ignoredCount += 1;
286
- }
287
- }
288
- return ignoredCount === length;
289
- } catch (e) {
290
- return e?.code === 'ENOENT';
291
- }
292
- };
293
- const readDirNamesSync = function readDirNamesSync(dirname, options) {
294
- try {
295
- return innerReadDirNames(fs$1.readdirSync(dirname, {
296
- withFileTypes: true
297
- }), options);
298
- } catch {}
299
- return [];
300
- };
301
- const kInternalsSymbol$1 = Symbol('@socketregistry.constants.internals');
302
- const internals = Object.freeze({
303
- __proto__: null,
304
- createLazyGetter,
305
- defineLazyGetter,
306
- defineLazyGetters,
307
- getGlobMatcher,
308
- innerReadDirNames,
309
- isDirEmptySync,
310
- localeCompare: localeCompare$2,
311
- naturalSort: naturalSort$1,
312
- readDirNamesSync
313
- });
314
- const LAZY_PACKAGE_DEFAULT_NODE_RANGE = () =>
315
- // Lazily access constants.maintainedNodeVersions.
316
- `>=${constants$4.maintainedNodeVersions.previous}`;
317
- const lazyMaintainedNodeVersions = () => {
318
- // Under the hood browserlist uses the node-releases package which is out of date:
319
- // https://github.com/chicoxyzzy/node-releases/issues/37
320
- // So we maintain a manual version list for now.
321
- // https://nodejs.org/en/about/previous-releases#looking-for-latest-release-of-a-version-branch
322
- const manualPrev = '18.20.4';
323
- const manualCurr = '20.18.0';
324
- const manualNext = '22.10.0';
325
-
326
- // Defer loading browserslist until needed.
327
- const browserslist = require$$10;
328
- const query = naturalSort$1(browserslist('maintained node versions')
329
- // Trim value, e.g. 'node 22.5.0' to '22.5.0'.
330
- .map(s => s.slice(5 /*'node '.length*/))).asc();
331
- const queryPrev = query.at(0) ?? manualPrev;
332
- const queryCurr = query.at(1) ?? manualCurr;
333
- const queryNext = query.at(2) ?? manualNext;
334
- const previous = semver$1.maxSatisfying([queryPrev, manualPrev], `^${semver$1.major(queryPrev)}`);
335
- const current = semver$1.maxSatisfying([queryCurr, manualCurr], `^${semver$1.major(queryCurr)}`);
336
- const next = semver$1.maxSatisfying([queryNext, manualNext], `^${semver$1.major(queryNext)}`);
337
- return Object.freeze(Object.assign([previous, current, next], {
338
- previous,
339
- current,
340
- next
341
- }));
342
- };
343
- const lazyNpmExecPath = () => whichSync('npm');
344
- const copyLeftLicenses$1 = new Set(['AGPL-3.0-or-later', 'AGPL-3.0', 'AGPL-3.0-only', 'AGPL-1.0-or-later', 'AGPL-1.0', 'AGPL-1.0-only', 'CC-BY-SA-4.0', 'CC-BY-SA-3.0', 'CC-BY-SA-2.0', 'CC-BY-SA-1.0', 'EPL-2.0', 'EPL-1.0', 'EUPL-1.2', 'EUPL-1.1', 'GPL-3.0-or-later', 'GPL-3.0', 'GPL-3.0-only', 'GPL-2.0-or-later', 'GPL-2.0', 'GPL-2.0-only', 'GPL-1.0-or-later', 'GPL-1.0', 'GPL-1.0-only']);
345
- const ignoreGlobs = Object.freeze([
346
- // Most of these ignored files can be included specifically if included in the
347
- // files globs. Exceptions to this are:
348
- // https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files
349
- // These can not be included.
350
- '.git', '.npmrc', '**/node_modules', '**/package-lock.json', '**/pnpm-lock.ya?ml', '**/yarn.lock',
351
- // Inline .gitignore from the socket-registry repository root.
352
- '.env', '.eslintcache', '.nvm', '.tap', '.tapci.yaml', '.vscode', 'npm-debug.log', '*.tsbuildinfo', '**/.DS_Store', '**/._.DS_Store', '**/Thumbs.db']);
353
- const lifecycleScriptNames = new Set(['dependencies', 'prepublishOnly', ...['install', 'pack', 'prepare', 'publish', 'restart', 'start', 'stop', 'version'].map(n => [`pre${n}`, n, `post${n}`])].flat());
354
- const parseArgsConfig = Object.freeze({
355
- __proto__: null,
356
- options: {
357
- __proto__: null,
358
- force: {
359
- __proto__: null,
360
- type: 'boolean',
361
- short: 'f'
362
- },
363
- quiet: {
364
- __proto__: null,
365
- type: 'boolean'
366
- }
367
- },
368
- strict: false
369
- });
370
- const packageExtensions$1 = Object.freeze([...yarnPkgExts, ['@yarnpkg/extensions@>=1.1.0', {
371
- // Properties with undefined values are omitted when saved as JSON.
372
- peerDependencies: undefined
373
- }], ['abab@>=2.0.0', {
374
- devDependencies: {
375
- // Lower the Webpack from v4.x to one supported by abab's peers.
376
- webpack: '^3.12.0'
377
- }
378
- }], ['is-generator-function@>=1.0.7', {
379
- scripts: {
380
- // Make the script a silent no-op.
381
- 'test:uglified': ''
382
- }
383
- }]].sort((a, b) => localeCompare$2(a[0].slice(0, a[0].lastIndexOf('@')), b[0].slice(0, b[0].lastIndexOf('@')))));
384
- const skipTestsByEcosystem = Object.freeze({
385
- __proto__: null,
386
- npm: new Set([
387
- // @hyrious/bun.lockb has no unit tests.
388
- // https://github.com/hyrious/bun.lockb/tree/v0.0.4
389
- '@hyrious/bun.lockb', 'hyrious__bun.lockb',
390
- // Our array-flatten override supports v1, v2, and v3 APIs, so we handle
391
- // testing ourselves.
392
- 'array-flatten',
393
- // date tests fail for some Node versions and platforms, but pass in CI
394
- // Win32 environments for the time being.
395
- // https://github.com/es-shims/Date/issues/3
396
- // https://github.com/es-shims/Date/tree/v2.0.5
397
- ...(ENV$1.WIN_32 ? [] : ['date']),
398
- // es6-object-assign has no unit tests.
399
- // https://github.com/rubennorte/es6-object-assign/tree/v1.1.0
400
- 'es6-object-assign',
401
- // harmony-reflect has known failures in its package and requires running
402
- // tests in browser.
403
- // https://github.com/tvcutsem/harmony-reflect/tree/v1.6.2/test
404
- 'harmony-reflect',
405
- // is-regex tests don't account for `is-regex` backed by
406
- // `require('node:util/types).isRegExp` which triggers no proxy traps and
407
- // assumes instead that the "getOwnPropertyDescriptor" trap will be triggered
408
- // by `Object.getOwnPropertyDescriptor(value, 'lastIndex')`.
409
- // https://github.com/inspect-js/is-regex/issues/35
410
- // https://github.com/inspect-js/is-regex/blob/v1.1.4/test/index.js
411
- 'is-regex',
412
- // safer-buffer tests assume Buffer.alloc, Buffer.allocUnsafe, and
413
- // Buffer.allocUnsafeSlow throw for a size of 2 * (1 << 30), i.e. 2147483648,
414
- // which is no longer the case.
415
- // https://github.com/ChALkeR/safer-buffer/issues/16
416
- // https://github.com/ChALkeR/safer-buffer/blob/v2.1.2/tests.js
417
- 'safer-buffer'])
418
- });
419
- const tsLibsAvailable = new Set([
420
- // Defined in priority order.
421
- 'esnext', 'es2024', 'es2023', 'dom', 'webworker', 'es2022', 'es2021', 'es2020', 'es2019', 'es2018', 'es2017', 'es2016', 'es2015', 'es6', 'es5', 'decorators', 'scripthost']);
422
- const tsTypesAvailable = new Set(['node']);
423
- const win32EnsureTestsByEcosystem = Object.freeze({
424
- __proto__: null,
425
- npm: new Set(['date'])
426
- });
427
- const constants$4 = Object.freeze(defineLazyGetters({
428
- __proto__: null,
429
- [kInternalsSymbol$1]: internals,
430
- COLUMN_LIMIT,
431
- EMPTY_FILE,
432
- ENV: ENV$1,
433
- ESLINT_CONFIG_JS,
434
- ESNEXT,
435
- LICENSE,
436
- LICENSE_GLOB,
437
- LICENSE_GLOB_RECURSIVE,
438
- LICENSE_ORIGINAL,
439
- LICENSE_ORIGINAL_GLOB,
440
- LICENSE_ORIGINAL_GLOB_RECURSIVE,
441
- LOOP_SENTINEL: LOOP_SENTINEL$2,
442
- MIT: MIT$1,
443
- NODE_MODULES,
444
- NODE_MODULES_GLOB_RECURSIVE,
445
- NODE_WORKSPACES,
446
- NODE_VERSION,
447
- NPM_ORG,
448
- OVERRIDES,
449
- PACKAGE_DEFAULT_SOCKET_CATEGORIES: PACKAGE_DEFAULT_SOCKET_CATEGORIES$1,
450
- // Lazily defined values are initialized as `undefined` to keep their key order.
451
- PACKAGE_DEFAULT_NODE_RANGE: undefined,
452
- PACKAGE_DEFAULT_VERSION,
453
- PACKAGE_JSON: PACKAGE_JSON$1,
454
- PACKAGE_LOCK,
455
- PACKAGE_SCOPE: PACKAGE_SCOPE$1,
456
- README_GLOB,
457
- README_GLOB_RECURSIVE,
458
- README_MD,
459
- REGISTRY_SCOPE_DELIMITER: REGISTRY_SCOPE_DELIMITER$1,
460
- REGISTRY_WORKSPACE,
461
- REPO_ORG: REPO_ORG$1,
462
- REPO_NAME: REPO_NAME$1,
463
- TEMPLATE_CJS,
464
- TEMPLATE_CJS_BROWSER,
465
- TEMPLATE_CJS_ESM,
466
- TEMPLATE_ES_SHIM_CONSTRUCTOR,
467
- TEMPLATE_ES_SHIM_PROTOTYPE_METHOD,
468
- TEMPLATE_ES_SHIM_STATIC_METHOD,
469
- TSCONFIG_JSON,
470
- UNLICENCED: UNLICENCED$1,
471
- UNLICENSED: UNLICENSED$1,
472
- WIN_32,
473
- copyLeftLicenses: copyLeftLicenses$1,
474
- execPath,
475
- ignoreGlobs,
476
- kInternalsSymbol: kInternalsSymbol$1,
477
- lifecycleScriptNames,
478
- maintainedNodeVersions: undefined,
479
- npmExecPath: undefined,
480
- packageExtensions: packageExtensions$1,
481
- packumentCache: packumentCache$1,
482
- pacoteCachePath: pacoteCachePath$1,
483
- parseArgsConfig,
484
- skipTestsByEcosystem,
485
- tsLibsAvailable,
486
- tsTypesAvailable,
487
- win32EnsureTestsByEcosystem
488
- }, {
489
- PACKAGE_DEFAULT_NODE_RANGE: LAZY_PACKAGE_DEFAULT_NODE_RANGE,
490
- maintainedNodeVersions: lazyMaintainedNodeVersions,
491
- npmExecPath: lazyNpmExecPath
492
- }));
493
- var constants_1 = constants$4;
494
-
495
- const {
496
- kInternalsSymbol,
497
- [kInternalsSymbol]: {
498
- localeCompare: localeCompare$1,
499
- naturalSort
500
- }
501
- } = constants_1;
502
- var sorts = {
503
- localeCompare: localeCompare$1,
504
- naturalSort
505
- };
506
-
507
- const {
508
- LOOP_SENTINEL: LOOP_SENTINEL$1
509
- } = constants_1;
510
- const {
511
- localeCompare
512
- } = sorts;
513
- function getOwnPropertyValues$1(obj) {
514
- if (obj === null || obj === undefined) {
515
- return [];
516
- }
517
- const keys = Object.getOwnPropertyNames(obj);
518
- const {
519
- length
520
- } = keys;
521
- const values = Array(length);
522
- for (let i = 0; i < length; i += 1) {
523
- values[i] = obj[keys[i]];
524
- }
525
- return values;
526
- }
527
- function hasKeys(obj) {
528
- if (obj === null || obj === undefined) {
529
- return false;
530
- }
531
- for (const key in obj) {
532
- if (Object.hasOwn(obj, key)) {
533
- return true;
534
- }
535
- }
536
- return false;
537
- }
538
- function hasOwn(obj, propKey) {
539
- if (obj === null || obj === undefined) {
540
- return false;
541
- }
542
- return Object.hasOwn(obj, propKey);
543
- }
544
- function isObject$1(value) {
545
- return value !== null && typeof value === 'object';
546
- }
547
- function isObjectObject$1(value) {
548
- return value !== null && typeof value === 'object' && !Array.isArray(value);
549
- }
550
- function merge$1(target, source) {
551
- if (!isObject$1(target) || !isObject$1(source)) {
552
- return target;
553
- }
554
- const queue = [[target, source]];
555
- let pos = 0;
556
- let {
557
- length: queueLength
558
- } = queue;
559
- while (pos < queueLength) {
560
- if (pos === LOOP_SENTINEL$1) {
561
- throw new Error('Detected infinite loop in object crawl of merge');
562
- }
563
- const {
564
- 0: currentTarget,
565
- 1: currentSource
566
- } = queue[pos++];
567
- const isSourceArray = Array.isArray(currentSource);
568
- if (Array.isArray(currentTarget)) {
569
- if (isSourceArray) {
570
- const seen = new Set(currentTarget);
571
- for (let i = 0, {
572
- length
573
- } = currentSource; i < length; i += 1) {
574
- const item = currentSource[i];
575
- if (!seen.has(item)) {
576
- currentTarget.push(item);
577
- seen.add(item);
578
- }
579
- }
580
- }
581
- continue;
582
- }
583
- if (isSourceArray) {
584
- continue;
585
- }
586
- const keys = Reflect.ownKeys(currentSource);
587
- for (let i = 0, {
588
- length
589
- } = keys; i < length; i += 1) {
590
- const key = keys[i];
591
- const srcVal = currentSource[key];
592
- const targetVal = currentTarget[key];
593
- if (Array.isArray(srcVal)) {
594
- if (Array.isArray(targetVal)) {
595
- const seen = new Set(targetVal);
596
- for (let i = 0, {
597
- length
598
- } = srcVal; i < length; i += 1) {
599
- const item = srcVal[i];
600
- if (!seen.has(item)) {
601
- targetVal.push(item);
602
- seen.add(item);
603
- }
604
- }
605
- } else {
606
- currentTarget[key] = srcVal;
607
- }
608
- } else if (isObject$1(srcVal)) {
609
- if (isObject$1(targetVal) && !Array.isArray(targetVal)) {
610
- queue[queueLength++] = [targetVal, srcVal];
611
- } else {
612
- currentTarget[key] = srcVal;
613
- }
614
- } else {
615
- currentTarget[key] = srcVal;
616
- }
617
- }
618
- }
619
- return target;
620
- }
621
- function objectEntries$1(obj) {
622
- if (obj === null || obj === undefined) {
623
- return [];
624
- }
625
- const entries = Object.entries(obj);
626
- const symbols = Object.getOwnPropertySymbols(obj);
627
- for (let i = 0, {
628
- length
629
- } = symbols; i < length; i += 1) {
630
- const symbol = symbols[i];
631
- entries.push([symbol, obj[symbol]]);
632
- }
633
- return entries;
634
- }
635
- function objectFromEntries$1(entries) {
636
- const keyEntries = [];
637
- const symbolEntries = [];
638
- for (let i = 0, {
639
- length
640
- } = entries; i < length; i += 1) {
641
- const entry = entries[i];
642
- if (typeof entry[0] === 'symbol') {
643
- symbolEntries.push(entry);
644
- } else {
645
- keyEntries.push(entry);
646
- }
647
- }
648
- const object = Object.fromEntries(keyEntries);
649
- for (let i = 0, {
650
- length
651
- } = symbolEntries; i < length; i += 1) {
652
- const entry = symbolEntries[i];
653
- object[entry[0]] = entry[1];
654
- }
655
- return object;
656
- }
657
- function toSortedObject(obj) {
658
- return toSortedObjectFromEntries(objectEntries$1(obj));
659
- }
660
- function toSortedObjectFromEntries(entries) {
661
- return objectFromEntries$1(entries.sort((a, b) => localeCompare(a[0], b[0])));
662
- }
663
- var objects = {
664
- getOwnPropertyValues: getOwnPropertyValues$1,
665
- hasKeys,
666
- hasOwn,
667
- isObject: isObject$1,
668
- isObjectObject: isObjectObject$1,
669
- merge: merge$1,
670
- objectEntries: objectEntries$1,
671
- objectFromEntries: objectFromEntries$1,
672
- toSortedObject,
673
- toSortedObjectFromEntries
674
- };
675
-
676
80
  var source = {};
677
81
 
678
82
  var ansiStyles$1 = {};
@@ -875,9 +279,9 @@ Object.defineProperty(supportsColor$1, "__esModule", {
875
279
  });
876
280
  supportsColor$1.createSupportsColor = createSupportsColor;
877
281
  supportsColor$1.default = void 0;
878
- var _nodeProcess$g = require$$0$1;
879
- var _nodeOs$2 = require$$1$1;
880
- var _nodeTty = require$$2$1;
282
+ var _nodeProcess$g = require$$0;
283
+ var _nodeOs$2 = require$$1;
284
+ var _nodeTty = require$$2;
881
285
  // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
882
286
  /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
883
287
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : _nodeProcess$g.argv) {
@@ -1390,9 +794,9 @@ Object.defineProperty(node$1, "__esModule", {
1390
794
  value: true
1391
795
  });
1392
796
  node$1.default = void 0;
1393
- var _nodeFs$3 = require$$0$2;
1394
- var _nodeOs$1 = require$$1$1;
1395
- var _nodePath$2 = require$$1;
797
+ var _nodeFs$3 = require$$0$1;
798
+ var _nodeOs$1 = require$$1;
799
+ var _nodePath$2 = require$$1$1;
1396
800
  var _abstract = abstract;
1397
801
  /* IMPORT */
1398
802
 
@@ -1424,16 +828,16 @@ var utils$1 = {};
1424
828
 
1425
829
  var dist = {};
1426
830
 
1427
- var constants$3 = {};
831
+ var constants$1 = {};
1428
832
 
1429
- Object.defineProperty(constants$3, "__esModule", {
833
+ Object.defineProperty(constants$1, "__esModule", {
1430
834
  value: true
1431
835
  });
1432
- constants$3.ENABLED = void 0;
836
+ constants$1.ENABLED = void 0;
1433
837
  /* MAIN */
1434
838
  const ENV = globalThis.process?.env || {};
1435
839
  const ARGV = globalThis.process?.argv || [];
1436
- constants$3.ENABLED = !('NO_COLOR' in ENV) && ENV.COLOR !== '0' && ENV.TERM !== 'dumb' && !ARGV.includes('--no-color') && !ARGV.includes('--no-colors') && (ENV.COLOR === '1' || !globalThis.process?.stdout || globalThis.process?.stdout?.isTTY === true);
840
+ constants$1.ENABLED = !('NO_COLOR' in ENV) && ENV.COLOR !== '0' && ENV.TERM !== 'dumb' && !ARGV.includes('--no-color') && !ARGV.includes('--no-colors') && (ENV.COLOR === '1' || !globalThis.process?.stdout || globalThis.process?.stdout?.isTTY === true);
1437
841
 
1438
842
  (function (exports) {
1439
843
 
@@ -1447,7 +851,7 @@ constants$3.ENABLED = !('NO_COLOR' in ENV) && ENV.COLOR !== '0' && ENV.TERM !==
1447
851
  }
1448
852
  });
1449
853
  exports.default = void 0;
1450
- var _constants = constants$3;
854
+ var _constants = constants$1;
1451
855
  /* IMPORT */
1452
856
 
1453
857
  /* HELPERS */
@@ -1509,18 +913,18 @@ var node = {};
1509
913
 
1510
914
  var interceptor = {};
1511
915
 
1512
- var constants$2 = {};
916
+ var constants = {};
1513
917
 
1514
- Object.defineProperty(constants$2, "__esModule", {
918
+ Object.defineProperty(constants, "__esModule", {
1515
919
  value: true
1516
920
  });
1517
- constants$2.IS_WINDOWS = constants$2.IS_LINUX = void 0;
1518
- var _nodeProcess$f = require$$0$1;
921
+ constants.IS_WINDOWS = constants.IS_LINUX = void 0;
922
+ var _nodeProcess$f = require$$0;
1519
923
  /* IMPORT */
1520
924
 
1521
925
  /* MAIN */
1522
- constants$2.IS_LINUX = _nodeProcess$f.platform === 'linux';
1523
- constants$2.IS_WINDOWS = _nodeProcess$f.platform === 'win32';
926
+ constants.IS_LINUX = _nodeProcess$f.platform === 'linux';
927
+ constants.IS_WINDOWS = _nodeProcess$f.platform === 'win32';
1524
928
 
1525
929
  var signals = {};
1526
930
 
@@ -1528,7 +932,7 @@ Object.defineProperty(signals, "__esModule", {
1528
932
  value: true
1529
933
  });
1530
934
  signals.default = void 0;
1531
- var _constants$1 = constants$2;
935
+ var _constants$1 = constants;
1532
936
  /* IMPORT */
1533
937
 
1534
938
  /* MAIN */
@@ -1547,8 +951,8 @@ Object.defineProperty(interceptor, "__esModule", {
1547
951
  value: true
1548
952
  });
1549
953
  interceptor.default = void 0;
1550
- var _nodeProcess$e = require$$0$1;
1551
- var _constants = constants$2;
954
+ var _nodeProcess$e = require$$0;
955
+ var _constants = constants;
1552
956
  var _signals = signals;
1553
957
  /* IMPORT */
1554
958
 
@@ -1797,15 +1201,15 @@ var dependencies = {};
1797
1201
  exports.r = redent;
1798
1202
  exports.t = trimNewlines;
1799
1203
  exports.y = void 0;
1800
- var _util = _interopRequireWildcard2(require$$0$3, true);
1801
- var _path = require$$1;
1802
- var _fs = require$$0$2;
1803
- var _nodePath = require$$1;
1804
- var _nodeProcess = require$$0$1;
1805
- var _nodeUrl = require$$8$1;
1806
- var _nodeFs = require$$0$2;
1807
- var _os = require$$1$1;
1808
- var _url = require$$8$1;
1204
+ var _util = _interopRequireWildcard2(require$$0$2, true);
1205
+ var _path = require$$1$1;
1206
+ var _fs = require$$0$1;
1207
+ var _nodePath = require$$1$1;
1208
+ var _nodeProcess = require$$0;
1209
+ var _nodeUrl = require$$8;
1210
+ var _nodeFs = require$$0$1;
1211
+ var _os = require$$1;
1212
+ var _url = require$$8;
1809
1213
  function camelCase$1(str) {
1810
1214
  const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
1811
1215
  if (!isCamelCase) {
@@ -9856,9 +9260,9 @@ Object.defineProperty(options, "__esModule", {
9856
9260
  value: true
9857
9261
  });
9858
9262
  options.buildOptions = void 0;
9859
- var _nodeProcess$d = require$$0$1;
9860
- var _nodePath$1 = require$$1;
9861
- var _nodeUrl$1 = require$$8$1;
9263
+ var _nodeProcess$d = require$$0;
9264
+ var _nodePath$1 = require$$1$1;
9265
+ var _nodeUrl$1 = require$$8;
9862
9266
  var _dependencies$2 = dependencies;
9863
9267
  var _utils$1 = utils;
9864
9268
  const validateOptions = options => {
@@ -10026,7 +9430,7 @@ Object.defineProperty(validate$2, "__esModule", {
10026
9430
  value: true
10027
9431
  });
10028
9432
  validate$2.validate = validate$2.checkUnknownFlags = validate$2.checkMissingRequiredFlags = void 0;
10029
- var _nodeProcess$c = require$$0$1;
9433
+ var _nodeProcess$c = require$$0;
10030
9434
  var _utils = utils;
10031
9435
  const validateFlags = (flags, options) => {
10032
9436
  for (const [flagKey, flagValue] of Object.entries(options.flags)) {
@@ -10133,7 +9537,7 @@ Object.defineProperty(build, "__esModule", {
10133
9537
  value: true
10134
9538
  });
10135
9539
  build.default = void 0;
10136
- var _nodeProcess$b = require$$0$1;
9540
+ var _nodeProcess$b = require$$0;
10137
9541
  var _dependencies = dependencies;
10138
9542
  var _options = options;
10139
9543
  var _parser = parser;
@@ -10340,9 +9744,9 @@ Object.defineProperty(restoreCursor$1, "__esModule", {
10340
9744
  value: true
10341
9745
  });
10342
9746
  restoreCursor$1.default = void 0;
10343
- var _nodeProcess$a = require$$0$1;
9747
+ var _nodeProcess$a = require$$0;
10344
9748
  var _onetime = onetime$1;
10345
- var _signalExit = require$$2$2;
9749
+ var _signalExit = require$$2$1;
10346
9750
  const terminal = _nodeProcess$a.stderr.isTTY ? _nodeProcess$a.stderr : _nodeProcess$a.stdout.isTTY ? _nodeProcess$a.stdout : undefined;
10347
9751
  const restoreCursor = terminal ? (0, _onetime.default)(() => {
10348
9752
  (0, _signalExit.onExit)(() => {
@@ -10357,7 +9761,7 @@ Object.defineProperty(cliCursor$1, "__esModule", {
10357
9761
  value: true
10358
9762
  });
10359
9763
  cliCursor$1.default = void 0;
10360
- var _nodeProcess$9 = require$$0$1;
9764
+ var _nodeProcess$9 = require$$0;
10361
9765
  var _restoreCursor = restoreCursor$1;
10362
9766
  let isHidden = false;
10363
9767
  const cliCursor = {};
@@ -10396,7 +9800,7 @@ Object.defineProperty(isUnicodeSupported$3, "__esModule", {
10396
9800
  value: true
10397
9801
  });
10398
9802
  isUnicodeSupported$3.default = isUnicodeSupported$2;
10399
- var _nodeProcess$8 = require$$0$1;
9803
+ var _nodeProcess$8 = require$$0;
10400
9804
  function isUnicodeSupported$2() {
10401
9805
  if (_nodeProcess$8.platform !== 'win32') {
10402
9806
  return _nodeProcess$8.env.TERM !== 'linux'; // Linux console (kernel)
@@ -10536,7 +9940,7 @@ Object.defineProperty(stringWidth$1, "__esModule", {
10536
9940
  stringWidth$1.default = stringWidth;
10537
9941
  var _stripAnsi$1 = stripAnsi$1;
10538
9942
  var _getEastAsianWidth = getEastAsianWidth;
10539
- var _emojiRegex = require$$2$3;
9943
+ var _emojiRegex = require$$2$2;
10540
9944
  const segmenter = new Intl.Segmenter();
10541
9945
  const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
10542
9946
  function stringWidth(string, options = {}) {
@@ -10627,7 +10031,7 @@ Object.defineProperty(isUnicodeSupported$1, "__esModule", {
10627
10031
  value: true
10628
10032
  });
10629
10033
  isUnicodeSupported$1.default = isUnicodeSupported;
10630
- var _nodeProcess$7 = require$$0$1;
10034
+ var _nodeProcess$7 = require$$0;
10631
10035
  function isUnicodeSupported() {
10632
10036
  const {
10633
10037
  env
@@ -10651,7 +10055,7 @@ Object.defineProperty(stdinDiscarder$1, "__esModule", {
10651
10055
  value: true
10652
10056
  });
10653
10057
  stdinDiscarder$1.default = void 0;
10654
- var _nodeProcess$6 = require$$0$1;
10058
+ var _nodeProcess$6 = require$$0;
10655
10059
  const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code
10656
10060
 
10657
10061
  class StdinDiscarder {
@@ -10703,11 +10107,11 @@ Object.defineProperty(ora$1, "__esModule", {
10703
10107
  });
10704
10108
  ora$1.default = ora;
10705
10109
  ora$1.oraPromise = oraPromise;
10706
- ora$1.spinners = require$$3$1;
10707
- var _nodeProcess$5 = require$$0$1;
10110
+ ora$1.spinners = require$$3;
10111
+ var _nodeProcess$5 = require$$0;
10708
10112
  var _chalk = source;
10709
10113
  var _cliCursor = cliCursor$1;
10710
- var _cliSpinners = require$$3$1;
10114
+ var _cliSpinners = require$$3;
10711
10115
  var _logSymbols = logSymbols$1;
10712
10116
  var _stripAnsi = stripAnsi$1;
10713
10117
  var _stringWidth = stringWidth$1;
@@ -11196,942 +10600,6 @@ terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {
11196
10600
  });
11197
10601
  terminalLink.stderr.isSupported = _supportsHyperlinks.stderr;
11198
10602
 
11199
- const prettier = require$$0$4;
11200
- const constants$1 = constants_1;
11201
- function indentString(str, count = 1) {
11202
- return str.replace(/^(?!\s*$)/gm, ' '.repeat(count));
11203
- }
11204
- function isNonEmptyString$1(value) {
11205
- return typeof value === 'string' && value.length > 0;
11206
- }
11207
- function search$1(str, regexp, fromIndex = 0) {
11208
- const {
11209
- length
11210
- } = str;
11211
- if (fromIndex >= length) return -1;
11212
- if (fromIndex === 0) return str.search(regexp);
11213
- const offset = fromIndex < 0 ? Math.max(length + fromIndex, 0) : fromIndex;
11214
- const result = str.slice(offset).search(regexp);
11215
- return result === -1 ? -1 : result + offset;
11216
- }
11217
- async function prettierFormat(str, options) {
11218
- return prettier.format(str, {
11219
- __proto__: null,
11220
- // Lazily access constants.prettierConfigPromise.
11221
- ...(await constants$1.prettierConfigPromise),
11222
- ...options
11223
- });
11224
- }
11225
- var strings = {
11226
- indentString,
11227
- isNonEmptyString: isNonEmptyString$1,
11228
- prettierFormat,
11229
- search: search$1
11230
- };
11231
-
11232
- const {
11233
- search
11234
- } = strings;
11235
- const leadingDotSlashRegExp = /^\.\.?[/\\]/;
11236
- const slashRegExp = /[/\\]/;
11237
- const nodeModulesPathRegExp = /(?:^|[/\\])node_modules(?:[/\\]|$)/;
11238
- function isNodeModules$1(filepath) {
11239
- return nodeModulesPathRegExp.test(filepath);
11240
- }
11241
- function isRelative(filepath) {
11242
- if (typeof filepath === 'string' && filepath.charCodeAt(0) === 46 /*'.'*/) {
11243
- if (filepath.length === 1) {
11244
- return true;
11245
- }
11246
- const code1 = filepath.charCodeAt(1);
11247
- return code1 === 47 /*'/'*/ || code1 === 92; /*'\\'*/
11248
- }
11249
- return false;
11250
- }
11251
- function normalizePath$1(filePath) {
11252
- const {
11253
- length
11254
- } = filePath;
11255
- if (length < 2) {
11256
- return length === 1 && filePath.charCodeAt(0) === 92 /*'\\'*/ ? '/' : filePath;
11257
- }
11258
- let code = 0;
11259
- let collapsed = '';
11260
- let start = 0;
11261
-
11262
- // Ensure win32 namespaces have two leading slashes so they are handled properly
11263
- // by path.win32.parse() after being normalized.
11264
- // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#namespaces
11265
- // UNC paths, paths starting with double slashes, e.g. "\\\\wsl.localhost\\Ubuntu\home\\",
11266
- // are okay to convert to forward slashes.
11267
- // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
11268
- let prefix = '';
11269
- if (length > 4 && filePath.charCodeAt(3) === 92 /*'\\'*/) {
11270
- const code2 = filePath.charCodeAt(2);
11271
- // Look for \\?\ or \\.\
11272
- if ((code2 === 63 /*'?'*/ || code2 === 46 /*'.'*/) && filePath.charCodeAt(0) === 92 /*'\\'*/ && filePath.charCodeAt(1) === 92 /*'\\'*/) {
11273
- start = 2;
11274
- prefix = '//';
11275
- }
11276
- }
11277
- if (start === 0) {
11278
- // Trim leading slashes
11279
- while (code = filePath.charCodeAt(start), code === 47 /*'/'*/ || code === 92 /*'\\'*/) {
11280
- start += 1;
11281
- }
11282
- if (start) {
11283
- prefix = '/';
11284
- }
11285
- }
11286
- let nextIndex = search(filePath, slashRegExp, start);
11287
- if (nextIndex === -1) {
11288
- return prefix + filePath.slice(start);
11289
- }
11290
- // Discard any empty string segments by collapsing repeated segment separator slashes.
11291
- while (nextIndex !== -1) {
11292
- const segment = filePath.slice(start, nextIndex);
11293
- collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + segment;
11294
- start = nextIndex + 1;
11295
- while (code = filePath.charCodeAt(start), code === 47 /*'/'*/ || code === 92 /*'\\'*/) {
11296
- start += 1;
11297
- }
11298
- nextIndex = search(filePath, slashRegExp, start);
11299
- }
11300
- const lastSegment = filePath.slice(start);
11301
- if (lastSegment.length !== 0) {
11302
- collapsed = collapsed + '/' + lastSegment;
11303
- }
11304
- return prefix + collapsed;
11305
- }
11306
- function splitPath(filepath) {
11307
- return filepath.split(slashRegExp);
11308
- }
11309
- function trimLeadingDotSlash(filepath) {
11310
- return filepath.replace(leadingDotSlashRegExp, '');
11311
- }
11312
- var path$1 = {
11313
- isNodeModules: isNodeModules$1,
11314
- isRelative,
11315
- normalizePath: normalizePath$1,
11316
- splitPath,
11317
- trimLeadingDotSlash
11318
- };
11319
-
11320
- // Inlined "escape-string-regexp":
11321
- // https://socket.dev/npm/package/escape-string-regexp/overview/5.0.0
11322
- // MIT License
11323
- // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
11324
- function escapeRegExp$1(str) {
11325
- // Escape characters with special meaning either inside or outside character sets.
11326
- // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when
11327
- // the simpler form would be disallowed by Unicode patterns’ stricter grammar.
11328
- return str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
11329
- }
11330
- var regexps = {
11331
- escapeRegExp: escapeRegExp$1
11332
- };
11333
-
11334
- const path = require$$1;
11335
- const EditablePackageJson = require$$1$3;
11336
- const cacache = require$$2$4;
11337
- const fs = require$$4;
11338
- const pack = require$$4$1;
11339
- const makeFetchHappen = require$$5$1;
11340
- const normalizePackageData = require$$6$1;
11341
- const npmPackageArg = require$$7;
11342
- const {
11343
- PackageURL
11344
- } = require$$8$2;
11345
- const pacote = require$$5;
11346
- const semver = require$$14;
11347
- const spdxCorrect = require$$11;
11348
- const spdxExpParse = require$$12;
11349
- const validateNpmPackageName = require$$13;
11350
- const {
11351
- getOwnPropertyValues,
11352
- isObject,
11353
- isObjectObject,
11354
- merge,
11355
- objectEntries,
11356
- objectFromEntries
11357
- } = objects;
11358
- const {
11359
- isNodeModules,
11360
- normalizePath
11361
- } = path$1;
11362
- const {
11363
- escapeRegExp
11364
- } = regexps;
11365
- const {
11366
- isNonEmptyString
11367
- } = strings;
11368
- const constants = constants_1;
11369
- const {
11370
- LOOP_SENTINEL,
11371
- MIT,
11372
- PACKAGE_DEFAULT_SOCKET_CATEGORIES,
11373
- PACKAGE_JSON,
11374
- PACKAGE_SCOPE,
11375
- REGISTRY_SCOPE_DELIMITER,
11376
- REPO_NAME,
11377
- REPO_ORG,
11378
- UNLICENCED,
11379
- UNLICENSED,
11380
- copyLeftLicenses,
11381
- packageExtensions,
11382
- packumentCache,
11383
- pacoteCachePath
11384
- } = constants;
11385
- const BINARY_OPERATION_NODE_TYPE = 'BinaryOperation';
11386
- const LICENSE_NODE_TYPE = 'License';
11387
- const escapedScopeRegExp = new RegExp(`^[^${escapeRegExp(REGISTRY_SCOPE_DELIMITER[0])}]+${escapeRegExp(REGISTRY_SCOPE_DELIMITER)}(?!${escapeRegExp(REGISTRY_SCOPE_DELIMITER[0])})`);
11388
- const fileReferenceRegExp = /^SEE LICEN[CS]E IN (.+)$/;
11389
- const pkgScopeRegExp = new RegExp(`^${escapeRegExp(PACKAGE_SCOPE)}/`);
11390
- const fetcher = makeFetchHappen.defaults({
11391
- cachePath: pacoteCachePath,
11392
- // Prefer-offline: Staleness checks for cached data will be bypassed, but
11393
- // missing data will be requested from the server.
11394
- // https://github.com/npm/make-fetch-happen?tab=readme-ov-file#--optscache
11395
- cache: 'force-cache'
11396
- });
11397
- function collectIncompatibleLicenses(licenseNodes) {
11398
- const result = [];
11399
- for (let i = 0, {
11400
- length
11401
- } = licenseNodes; i < length; i += 1) {
11402
- const node = licenseNodes[i];
11403
- if (copyLeftLicenses.has(node.license)) {
11404
- result.push(node);
11405
- }
11406
- }
11407
- return result;
11408
- }
11409
- function collectLicenseWarnings(licenseNodes) {
11410
- const warnings = new Map();
11411
- for (let i = 0, {
11412
- length
11413
- } = licenseNodes; i < length; i += 1) {
11414
- const node = licenseNodes[i];
11415
- const {
11416
- license
11417
- } = node;
11418
- if (license === UNLICENSED) {
11419
- warnings.set(UNLICENSED, `Package is unlicensed`);
11420
- } else if (node.inFile !== undefined) {
11421
- warnings.set('IN_FILE', `License terms specified in ${node.inFile}`);
11422
- }
11423
- }
11424
- return [...warnings.values()];
11425
- }
11426
- function createAstNode(rawNode) {
11427
- return Object.hasOwn(rawNode, 'license') ? createLicenseNode(rawNode) : createBinaryOperationNode(rawNode);
11428
- }
11429
- function createBinaryOperationNode(rawNode) {
11430
- let left;
11431
- let right;
11432
- let {
11433
- left: rawLeft,
11434
- right: rawRight
11435
- } = rawNode;
11436
- const {
11437
- conjunction
11438
- } = rawNode;
11439
- rawNode = undefined;
11440
- return {
11441
- __proto__: null,
11442
- type: BINARY_OPERATION_NODE_TYPE,
11443
- get left() {
11444
- if (left === undefined) {
11445
- left = createAstNode(rawLeft);
11446
- rawLeft = undefined;
11447
- }
11448
- return left;
11449
- },
11450
- conjunction,
11451
- get right() {
11452
- if (right === undefined) {
11453
- right = createAstNode(rawRight);
11454
- rawRight = undefined;
11455
- }
11456
- return right;
11457
- }
11458
- };
11459
- }
11460
- function createLicenseNode(rawNode) {
11461
- return {
11462
- __proto__: null,
11463
- ...rawNode,
11464
- type: LICENSE_NODE_TYPE
11465
- };
11466
- }
11467
- function createPackageJson(regPkgName, directory, options) {
11468
- const {
11469
- dependencies,
11470
- description,
11471
- engines,
11472
- exports: entryExportsRaw,
11473
- files,
11474
- keywords,
11475
- main,
11476
- overrides,
11477
- resolutions,
11478
- sideEffects,
11479
- socket,
11480
- type,
11481
- version
11482
- } = {
11483
- __proto__: null,
11484
- ...options
11485
- };
11486
- // Lazily access constants.PACKAGE_DEFAULT_NODE_RANGE.
11487
- const {
11488
- PACKAGE_DEFAULT_NODE_RANGE
11489
- } = constants;
11490
- const name = `${PACKAGE_SCOPE}/${regPkgName.replace(pkgScopeRegExp, '')}`;
11491
- const entryExports = resolvePackageJsonEntryExports(entryExportsRaw);
11492
- const githubUrl = `https://github.com/${REPO_ORG}/${REPO_NAME}`;
11493
- return {
11494
- __proto__: null,
11495
- name,
11496
- version,
11497
- license: MIT,
11498
- description,
11499
- keywords,
11500
- homepage: `${githubUrl}/tree/main/${directory}`,
11501
- repository: {
11502
- type: 'git',
11503
- url: `git+${githubUrl}.git`,
11504
- directory
11505
- },
11506
- ...(type ? {
11507
- type
11508
- } : {}),
11509
- ...(entryExports ? {
11510
- exports: entryExports
11511
- } : {}),
11512
- ...(entryExports ? {} : {
11513
- main: `${main ?? './index.js'}`
11514
- }),
11515
- sideEffects: sideEffects !== undefined && !!sideEffects,
11516
- ...(isObjectObject(dependencies) ? {
11517
- dependencies
11518
- } : {}),
11519
- ...(isObjectObject(overrides) ? {
11520
- overrides
11521
- } : {}),
11522
- ...(isObjectObject(resolutions) ? {
11523
- resolutions
11524
- } : {}),
11525
- ...(isObjectObject(engines) ? {
11526
- engines: objectFromEntries(objectEntries(engines).map(pair => {
11527
- if (pair[0] === 'node') {
11528
- const {
11529
- 1: range
11530
- } = pair;
11531
- if (!semver.satisfies(semver.coerce(range), PACKAGE_DEFAULT_NODE_RANGE)) {
11532
- pair[1] = pkgScopeRegExp;
11533
- }
11534
- }
11535
- return pair;
11536
- }))
11537
- } : {
11538
- engines: {
11539
- node: PACKAGE_DEFAULT_NODE_RANGE
11540
- }
11541
- }),
11542
- files: Array.isArray(files) ? files : ['*.d.ts', '*.js'],
11543
- ...(isObjectObject(socket) ? {
11544
- socket
11545
- } : {
11546
- socket: {
11547
- // Valid categories are: cleanup, levelup, speedup, tuneup
11548
- categories: PACKAGE_DEFAULT_SOCKET_CATEGORIES
11549
- }
11550
- })
11551
- };
11552
- }
11553
- async function extractPackage(pkgNameOrId, options, callback) {
11554
- if (arguments.length === 2 && typeof options === 'function') {
11555
- callback = options;
11556
- options = undefined;
11557
- }
11558
- const {
11559
- tmpPrefix,
11560
- ...extractOptions
11561
- } = {
11562
- __proto__: null,
11563
- ...options
11564
- };
11565
- await cacache.tmp.withTmp(pacoteCachePath, {
11566
- tmpPrefix
11567
- }, async tmpDirPath => {
11568
- await pacote.extract(pkgNameOrId, tmpDirPath, {
11569
- __proto__: null,
11570
- packumentCache,
11571
- preferOffline: true,
11572
- ...extractOptions
11573
- });
11574
- await callback(tmpDirPath);
11575
- });
11576
- }
11577
- async function fetchPackageManifest(pkgNameOrId, options) {
11578
- const pacoteOptions = {
11579
- __proto__: null,
11580
- ...options,
11581
- packumentCache,
11582
- preferOffline: true
11583
- };
11584
- const {
11585
- signal
11586
- } = pacoteOptions;
11587
- if (signal?.aborted) {
11588
- return null;
11589
- }
11590
- let result;
11591
- try {
11592
- result = await pacote.manifest(pkgNameOrId, pacoteOptions);
11593
- } catch {}
11594
- if (signal?.aborted) {
11595
- return null;
11596
- }
11597
- if (result) {
11598
- const spec = npmPackageArg(pkgNameOrId, pacoteOptions.where);
11599
- if (isRegistryFetcherType(spec.type)) {
11600
- return result;
11601
- }
11602
- }
11603
- // Convert a manifest not fetched by RegistryFetcher to one that is.
11604
- return result ? fetchPackageManifest(`${result.name}@${result.version}`, pacoteOptions) : null;
11605
- }
11606
- function findPackageExtensions(pkgName, pkgVer) {
11607
- let result;
11608
- for (const {
11609
- 0: selector,
11610
- 1: ext
11611
- } of packageExtensions) {
11612
- const lastAtSignIndex = selector.lastIndexOf('@');
11613
- const name = selector.slice(0, lastAtSignIndex);
11614
- if (pkgName === name) {
11615
- const range = selector.slice(lastAtSignIndex + 1);
11616
- if (semver.satisfies(pkgVer, range)) {
11617
- if (result === undefined) {
11618
- result = {};
11619
- }
11620
- merge(result, ext);
11621
- }
11622
- }
11623
- }
11624
- return result;
11625
- }
11626
- function findTypesForSubpath(entryExports, subpath) {
11627
- const queue = [entryExports];
11628
- let pos = 0;
11629
- while (pos < queue.length) {
11630
- if (pos === LOOP_SENTINEL) {
11631
- throw new Error('Detected infinite loop in entry exports crawl of getTypesForSubpath');
11632
- }
11633
- const value = queue[pos++];
11634
- if (Array.isArray(value)) {
11635
- for (let i = 0, {
11636
- length
11637
- } = value; i < length; i += 1) {
11638
- const item = value[i];
11639
- if (item === subpath) {
11640
- return value.types;
11641
- }
11642
- if (isObject(item)) {
11643
- queue.push(item);
11644
- }
11645
- }
11646
- } else if (isObject(value)) {
11647
- const keys = Object.getOwnPropertyNames(value);
11648
- for (let i = 0, {
11649
- length
11650
- } = keys; i < length; i += 1) {
11651
- const item = value[keys[i]];
11652
- if (item === subpath) {
11653
- return value.types;
11654
- }
11655
- if (isObject(item)) {
11656
- queue.push(item);
11657
- }
11658
- }
11659
- }
11660
- }
11661
- return undefined;
11662
- }
11663
- function getRepoUrlDetails(repoUrl = '') {
11664
- const userAndRepo = repoUrl.replace(/^.+github.com\//, '').split('/');
11665
- const {
11666
- 0: user
11667
- } = userAndRepo;
11668
- const project = userAndRepo.length > 1 ? userAndRepo[1].slice(0, -'.git'.length) : '';
11669
- return {
11670
- user,
11671
- project
11672
- };
11673
- }
11674
- function getSubpaths(entryExports) {
11675
- const result = [];
11676
- const queue = getOwnPropertyValues(entryExports);
11677
- let pos = 0;
11678
- while (pos < queue.length) {
11679
- if (pos === LOOP_SENTINEL) {
11680
- throw new Error('Detected infinite loop in entry exports crawl of getSubpaths');
11681
- }
11682
- const value = queue[pos++];
11683
- if (typeof value === 'string') {
11684
- result.push(value);
11685
- } else if (Array.isArray(value)) {
11686
- queue.push(...value);
11687
- } else if (isObject(value)) {
11688
- queue.push(...getOwnPropertyValues(value));
11689
- }
11690
- }
11691
- return result;
11692
- }
11693
- function gitHubTagRefUrl(user, project, tag) {
11694
- return `https://api.github.com/repos/${user}/${project}/git/ref/tags/${tag}`;
11695
- }
11696
- function gitHubTgzUrl(user, project, sha) {
11697
- return `https://github.com/${user}/${project}/archive/${sha}.tar.gz`;
11698
- }
11699
- function isConditionalExports(entryExports) {
11700
- if (!isObjectObject(entryExports)) {
11701
- return false;
11702
- }
11703
- const keys = Object.getOwnPropertyNames(entryExports);
11704
- const {
11705
- length
11706
- } = keys;
11707
- if (!length) {
11708
- return false;
11709
- }
11710
- // Conditional entry exports do NOT contain keys starting with '.'.
11711
- // Entry exports cannot contain some keys starting with '.' and some not.
11712
- // The exports object MUST either be an object of package subpath keys OR
11713
- // an object of main entry condition name keys only.
11714
- for (let i = 0; i < length; i += 1) {
11715
- const key = keys[i];
11716
- if (key.length > 0 && key.charCodeAt(0) === 46 /*'.'*/) {
11717
- return false;
11718
- }
11719
- }
11720
- return true;
11721
- }
11722
- function isRegistryFetcherType(type) {
11723
- // RegistryFetcher spec.type check based on:
11724
- // https://github.com/npm/pacote/blob/v19.0.0/lib/fetcher.js#L467-L488
11725
- return type === 'alias' || type === 'range' || type === 'tag' || type === 'version';
11726
- }
11727
- function isSubpathExports(entryExports) {
11728
- if (isObjectObject(entryExports)) {
11729
- const keys = Object.getOwnPropertyNames(entryExports);
11730
- for (let i = 0, {
11731
- length
11732
- } = keys; i < length; i += 1) {
11733
- // Subpath entry exports contain keys starting with '.'.
11734
- // Entry exports cannot contain some keys starting with '.' and some not.
11735
- // The exports object MUST either be an object of package subpath keys OR
11736
- // an object of main entry condition name keys only.
11737
- if (keys[i].charCodeAt(0) === 46 /*'.'*/) {
11738
- return true;
11739
- }
11740
- }
11741
- }
11742
- return false;
11743
- }
11744
- function isValidPackageName(value) {
11745
- return validateNpmPackageName(value).validForOldPackages;
11746
- }
11747
- function jsonToEditablePackageJson(pkgJson, options) {
11748
- return new EditablePackageJson().fromContent(normalizePackageJson(pkgJson, options));
11749
- }
11750
- function normalizePackageJson(pkgJson, options) {
11751
- const {
11752
- preserve
11753
- } = {
11754
- __proto__: null,
11755
- ...options
11756
- };
11757
- const preserved = [['_id', undefined], ['readme', undefined], ...(Object.hasOwn(pkgJson, 'bugs') ? [] : [['bugs', undefined]]), ...(Object.hasOwn(pkgJson, 'homepage') ? [] : [['homepage', undefined]]), ...(Object.hasOwn(pkgJson, 'name') ? [] : [['name', undefined]]), ...(Object.hasOwn(pkgJson, 'version') ? [] : [['version', undefined]]), ...(Array.isArray(preserve) ? preserve.map(k => [k, Object.hasOwn(pkgJson, k) ? pkgJson[k] : undefined]) : [])];
11758
- normalizePackageData(pkgJson);
11759
- merge(pkgJson, findPackageExtensions(pkgJson.name, pkgJson.version));
11760
- // Revert/remove properties we don't care to have normalized.
11761
- // Properties with undefined values are omitted when saved as JSON.
11762
- for (const {
11763
- 0: key,
11764
- 1: value
11765
- } of preserved) {
11766
- pkgJson[key] = value;
11767
- }
11768
- return pkgJson;
11769
- }
11770
- async function packPackage(spec, options) {
11771
- return await pack(spec, {
11772
- __proto__: null,
11773
- ...options,
11774
- packumentCache,
11775
- preferOffline: true
11776
- });
11777
- }
11778
- function parseSpdxExp(spdxExp) {
11779
- try {
11780
- return spdxExpParse(spdxExp);
11781
- } catch {}
11782
- const corrected = spdxCorrect(spdxExp);
11783
- return corrected ? spdxExpParse(corrected) : null;
11784
- }
11785
- async function readPackageJson(filepath, options) {
11786
- const {
11787
- editable,
11788
- ...otherOptions
11789
- } = {
11790
- __proto__: null,
11791
- ...options
11792
- };
11793
- const pkgJson = await fs.readJson(resolvePackageJsonPath(filepath));
11794
- return editable ? await toEditablePackageJson(pkgJson, {
11795
- path: filepath,
11796
- ...otherOptions
11797
- }) : normalizePackageJson(pkgJson, otherOptions);
11798
- }
11799
- function readPackageJsonSync(filepath, options) {
11800
- const {
11801
- editable,
11802
- ...otherOptions
11803
- } = {
11804
- __proto__: null,
11805
- ...options
11806
- };
11807
- const pkgJson = fs.readJsonSync(resolvePackageJsonPath(filepath));
11808
- return editable ? toEditablePackageJsonSync(pkgJson, {
11809
- path: filepath,
11810
- ...otherOptions
11811
- }) : normalizePackageJson(pkgJson, otherOptions);
11812
- }
11813
- function resolveEscapedScope(regPkgName) {
11814
- return escapedScopeRegExp.exec(regPkgName)?.[0] ?? '';
11815
- }
11816
- async function resolveGitHubTgzUrl(pkgNameOrId, where) {
11817
- const whereIsPkgJson = isObjectObject(where);
11818
- const pkgJson = whereIsPkgJson ? where : await readPackageJson(where);
11819
- const {
11820
- version
11821
- } = pkgJson;
11822
- const parsedSpec = npmPackageArg(pkgNameOrId, whereIsPkgJson ? undefined : where);
11823
- const isTarballUrl = parsedSpec.type === 'remote' && !!parsedSpec.saveSpec?.endsWith('.tar.gz');
11824
- if (isTarballUrl) {
11825
- return parsedSpec.saveSpec;
11826
- }
11827
- const isgithubUrl = parsedSpec.type === 'git' && parsedSpec.hosted?.domain === 'github.com' && isNonEmptyString(parsedSpec.gitCommittish);
11828
- const {
11829
- project,
11830
- user
11831
- } = isgithubUrl ? parsedSpec.hosted : getRepoUrlDetails(pkgJson.repository?.url);
11832
- if (user && project) {
11833
- let apiUrl = '';
11834
- if (isgithubUrl) {
11835
- apiUrl = gitHubTagRefUrl(user, project, parsedSpec.gitCommittish);
11836
- } else {
11837
- // First try to resolve the sha for a tag starting with "v", e.g. v1.2.3.
11838
- apiUrl = gitHubTagRefUrl(user, project, `v${version}`);
11839
- if (!(await fetcher(apiUrl, {
11840
- method: 'head'
11841
- })).ok) {
11842
- // If a sha isn't found, try again with the "v" removed, e.g. 1.2.3.
11843
- apiUrl = gitHubTagRefUrl(user, project, version);
11844
- if (!(await fetcher(apiUrl, {
11845
- method: 'head'
11846
- })).ok) {
11847
- apiUrl = '';
11848
- }
11849
- }
11850
- }
11851
- if (apiUrl) {
11852
- const resp = await fetcher(apiUrl);
11853
- const json = await resp.json();
11854
- const sha = json?.object?.sha;
11855
- if (sha) {
11856
- return gitHubTgzUrl(user, project, sha);
11857
- }
11858
- }
11859
- }
11860
- return '';
11861
- }
11862
- function resolveOriginalPackageName(regPkgName) {
11863
- const escapedScope = resolveEscapedScope(regPkgName);
11864
- return escapedScope ? `${unescapeScope(escapedScope)}/${regPkgName.slice(escapedScope.length)}` : regPkgName;
11865
- }
11866
- function resolvePackageJsonDirname(filepath) {
11867
- return filepath.endsWith(PACKAGE_JSON) ? path.dirname(filepath) : filepath;
11868
- }
11869
- function resolvePackageJsonEntryExports(entryExports) {
11870
- // If conditional exports main sugar
11871
- // https://nodejs.org/api/packages.html#exports-sugar
11872
- if (typeof entryExports === 'string' || Array.isArray(entryExports)) {
11873
- return {
11874
- '.': entryExports
11875
- };
11876
- }
11877
- if (isConditionalExports(entryExports)) {
11878
- return entryExports;
11879
- }
11880
- return isObject(entryExports) ? entryExports : undefined;
11881
- }
11882
- function resolvePackageJsonPath(filepath) {
11883
- return filepath.endsWith(PACKAGE_JSON) ? filepath : path.join(filepath, PACKAGE_JSON);
11884
- }
11885
- function resolvePackageLicenses(licenseFieldValue, where) {
11886
- // Based off of validate-npm-package-license which npm, by way of normalize-package-data,
11887
- // uses to validate license field values:
11888
- // https://github.com/kemitchell/validate-npm-package-license.js/blob/v3.0.4/index.js#L40-L41
11889
- if (licenseFieldValue === UNLICENSED || licenseFieldValue === UNLICENCED) {
11890
- return [{
11891
- license: UNLICENSED
11892
- }];
11893
- }
11894
- // Match "SEE LICENSE IN <relativeFilepathToLicense>"
11895
- // https://github.com/kemitchell/validate-npm-package-license.js/blob/v3.0.4/index.js#L48-L53
11896
- const match = fileReferenceRegExp.exec(licenseFieldValue);
11897
- if (match) {
11898
- return [{
11899
- license: licenseFieldValue,
11900
- inFile: normalizePath(path.relative(where, match[1]))
11901
- }];
11902
- }
11903
- const licenseNodes = [];
11904
- const ast = parseSpdxExp(licenseFieldValue);
11905
- if (ast) {
11906
- // SPDX expressions are valid, too except if they contain "LicenseRef" or
11907
- // "DocumentRef". If the licensing terms cannot be described with standardized
11908
- // SPDX identifiers, then the terms should be put in a file in the package
11909
- // and the license field should point users there, e.g. "SEE LICENSE IN LICENSE.txt".
11910
- // https://github.com/kemitchell/validate-npm-package-license.js/blob/v3.0.4/index.js#L18-L24
11911
- visitLicenses(ast, {
11912
- __proto__: null,
11913
- License(node) {
11914
- const {
11915
- license
11916
- } = node;
11917
- if (license.startsWith('LicenseRef') || license.startsWith('DocumentRef')) {
11918
- licenseNodes.length = 0;
11919
- return false;
11920
- }
11921
- licenseNodes.push(node);
11922
- }
11923
- });
11924
- }
11925
- return licenseNodes;
11926
- }
11927
- function resolveRegistryPackageName(pkgName) {
11928
- const purlObj = PackageURL.fromString(`pkg:npm/${pkgName}`);
11929
- return purlObj.namespace ? `${purlObj.namespace.slice(1)}${REGISTRY_SCOPE_DELIMITER}${purlObj.name}` : pkgName;
11930
- }
11931
- async function toEditablePackageJson(pkgJson, options) {
11932
- const {
11933
- path: filepath,
11934
- ...normalizeOptions
11935
- } = {
11936
- __proto__: null,
11937
- ...options
11938
- };
11939
- if (typeof filepath !== 'string') {
11940
- return jsonToEditablePackageJson(pkgJson, normalizeOptions);
11941
- }
11942
- const pkgJsonPath = resolvePackageJsonDirname(filepath);
11943
- return (await EditablePackageJson.load(pkgJsonPath, {
11944
- create: true
11945
- })).fromJSON(`${JSON.stringify(normalizePackageJson(pkgJson, {
11946
- __proto__: null,
11947
- ...(isNodeModules(pkgJsonPath) ? {} : {
11948
- preserve: ['repository']
11949
- }),
11950
- ...normalizeOptions
11951
- }), null, 2)}\n`);
11952
- }
11953
- function toEditablePackageJsonSync(pkgJson, options) {
11954
- const {
11955
- path: filepath,
11956
- ...normalizeOptions
11957
- } = {
11958
- __proto__: null,
11959
- ...options
11960
- };
11961
- if (typeof filepath !== 'string') {
11962
- return jsonToEditablePackageJson(pkgJson, normalizeOptions);
11963
- }
11964
- const pkgJsonPath = resolvePackageJsonDirname(filepath);
11965
- return new EditablePackageJson().create(pkgJsonPath).fromJSON(`${JSON.stringify(normalizePackageJson(pkgJson, {
11966
- __proto__: null,
11967
- ...(isNodeModules(pkgJsonPath) ? {} : {
11968
- preserve: ['repository']
11969
- }),
11970
- ...normalizeOptions
11971
- }), null, 2)}\n`);
11972
- }
11973
- function unescapeScope(escapedScope) {
11974
- return `@${escapedScope.slice(0, -REGISTRY_SCOPE_DELIMITER.length)}`;
11975
- }
11976
- function visitLicenses(ast, visitor) {
11977
- const queue = [[createAstNode(ast), undefined]];
11978
- let pos = 0;
11979
- let {
11980
- length: queueLength
11981
- } = queue;
11982
- while (pos < queueLength) {
11983
- if (pos === LOOP_SENTINEL) {
11984
- throw new Error('Detected infinite loop in ast crawl of visitLicenses');
11985
- }
11986
- // AST nodes can be a license node which looks like
11987
- // {
11988
- // license: string
11989
- // plus?: boolean
11990
- // exception?: string
11991
- // }
11992
- // or a binary operation node which looks like
11993
- // {
11994
- // left: License | BinaryOperation
11995
- // conjunction: string
11996
- // right: License | BinaryOperation
11997
- // }
11998
- const {
11999
- 0: node,
12000
- 1: parent
12001
- } = queue[pos++];
12002
- const {
12003
- type
12004
- } = node;
12005
- if (visitor[type]?.(node, parent) === false) {
12006
- break;
12007
- }
12008
- if (type === BINARY_OPERATION_NODE_TYPE) {
12009
- queue[queueLength++] = [node.left, node];
12010
- queue[queueLength++] = [node.right, node];
12011
- }
12012
- }
12013
- }
12014
- var packages = {
12015
- collectIncompatibleLicenses,
12016
- collectLicenseWarnings,
12017
- createPackageJson,
12018
- extractPackage,
12019
- fetchPackageManifest,
12020
- findTypesForSubpath,
12021
- getSubpaths,
12022
- isConditionalExports,
12023
- isSubpathExports,
12024
- isValidPackageName,
12025
- normalizePackageJson,
12026
- packPackage,
12027
- readPackageJson,
12028
- readPackageJsonSync,
12029
- resolveEscapedScope,
12030
- resolveGitHubTgzUrl,
12031
- resolveOriginalPackageName,
12032
- resolvePackageJsonDirname,
12033
- resolvePackageJsonEntryExports,
12034
- resolvePackageJsonPath,
12035
- resolvePackageLicenses,
12036
- resolveRegistryPackageName,
12037
- toEditablePackageJson,
12038
- toEditablePackageJsonSync,
12039
- unescapeScope
12040
- };
12041
-
12042
- function arrayChunk$1(arr, size = 2) {
12043
- const {
12044
- length
12045
- } = arr;
12046
- const chunkSize = Math.min(length, size);
12047
- const chunks = [];
12048
- for (let i = 0; i < length; i += chunkSize) {
12049
- chunks.push(arr.slice(i, i + chunkSize));
12050
- }
12051
- return chunks;
12052
- }
12053
- function arrayUnique(arr) {
12054
- return [...new Set(arr)];
12055
- }
12056
- function joinAsList(arr) {
12057
- const {
12058
- length
12059
- } = arr;
12060
- if (length === 0) {
12061
- return '';
12062
- }
12063
- if (length === 1) {
12064
- return arr[0];
12065
- }
12066
- if (length === 2) {
12067
- return `${arr[0]} and ${arr[1]}`;
12068
- }
12069
- return `${arr.slice(0, -1).join(', ')}, and ${arr.at(-1)}`;
12070
- }
12071
- var arrays = {
12072
- arrayChunk: arrayChunk$1,
12073
- arrayUnique,
12074
- joinAsList
12075
- };
12076
-
12077
- const {
12078
- arrayChunk
12079
- } = arrays;
12080
- async function pEach(array, concurrency, callbackFn, options) {
12081
- await pEachChunk(arrayChunk(array, concurrency), callbackFn, options);
12082
- }
12083
- async function pFilter(array, concurrency, callbackFn, options) {
12084
- return (await pFilterChunk(arrayChunk(array, concurrency), callbackFn, options)).flat();
12085
- }
12086
- async function pEachChunk(chunks, callbackFn, options) {
12087
- const {
12088
- signal
12089
- } = {
12090
- __proto__: null,
12091
- ...options
12092
- };
12093
- for (const chunk of chunks) {
12094
- if (signal?.aborted) {
12095
- return;
12096
- }
12097
- // eslint-disable-next-line no-await-in-loop
12098
- await Promise.all(chunk.map(value => signal?.aborted ? undefined : callbackFn(value, {
12099
- signal
12100
- })));
12101
- }
12102
- }
12103
- async function pFilterChunk(chunks, callbackFn, options) {
12104
- const {
12105
- signal
12106
- } = {
12107
- __proto__: null,
12108
- ...options
12109
- };
12110
- const {
12111
- length
12112
- } = chunks;
12113
- const filteredChunks = Array(length);
12114
- for (let i = 0; i < length; i += 1) {
12115
- // Process each chunk, filtering based on the callback function
12116
- if (signal?.aborted) {
12117
- filteredChunks[i] = [];
12118
- } else {
12119
- // eslint-disable-next-line no-await-in-loop
12120
- const results = await Promise.all(chunks[i].map(value => signal?.aborted ? Promise.resolve() : callbackFn(value, {
12121
- signal
12122
- })));
12123
- filteredChunks[i] = results.filter(Boolean);
12124
- }
12125
- }
12126
- return filteredChunks;
12127
- }
12128
- var promises = {
12129
- pEach,
12130
- pEachChunk,
12131
- pFilter,
12132
- pFilterChunk
12133
- };
12134
-
12135
10603
  var open$1 = {};
12136
10604
 
12137
10605
  var isWsl$1 = {};
@@ -12144,7 +10612,7 @@ Object.defineProperty(isDocker$1, "__esModule", {
12144
10612
  value: true
12145
10613
  });
12146
10614
  isDocker$1.default = isDocker;
12147
- var _nodeFs$2 = require$$0$2;
10615
+ var _nodeFs$2 = require$$0$1;
12148
10616
  let isDockerCached;
12149
10617
  function hasDockerEnv() {
12150
10618
  try {
@@ -12173,7 +10641,7 @@ Object.defineProperty(isInsideContainer$1, "__esModule", {
12173
10641
  value: true
12174
10642
  });
12175
10643
  isInsideContainer$1.default = isInsideContainer;
12176
- var _nodeFs$1 = require$$0$2;
10644
+ var _nodeFs$1 = require$$0$1;
12177
10645
  var _isDocker = isDocker$1;
12178
10646
  let cachedResult;
12179
10647
 
@@ -12198,9 +10666,9 @@ Object.defineProperty(isWsl$1, "__esModule", {
12198
10666
  value: true
12199
10667
  });
12200
10668
  isWsl$1.default = void 0;
12201
- var _nodeProcess$4 = require$$0$1;
12202
- var _nodeOs = require$$1$1;
12203
- var _nodeFs = require$$0$2;
10669
+ var _nodeProcess$4 = require$$0;
10670
+ var _nodeOs = require$$1;
10671
+ var _nodeFs = require$$0$1;
12204
10672
  var _isInsideContainer$1 = isInsideContainer$1;
12205
10673
  const isWsl = () => {
12206
10674
  if (_nodeProcess$4.platform !== 'linux') {
@@ -12255,9 +10723,9 @@ Object.defineProperty(defaultBrowserId$1, "__esModule", {
12255
10723
  value: true
12256
10724
  });
12257
10725
  defaultBrowserId$1.default = defaultBrowserId;
12258
- var _nodeUtil$3 = require$$0$3;
12259
- var _nodeProcess$3 = require$$0$1;
12260
- var _nodeChild_process$4 = require$$2$5;
10726
+ var _nodeUtil$3 = require$$0$2;
10727
+ var _nodeProcess$3 = require$$0;
10728
+ var _nodeChild_process$4 = require$$2$3;
12261
10729
  const execFileAsync$3 = (0, _nodeUtil$3.promisify)(_nodeChild_process$4.execFile);
12262
10730
  async function defaultBrowserId() {
12263
10731
  if (_nodeProcess$3.platform !== 'darwin') {
@@ -12281,9 +10749,9 @@ Object.defineProperty(runApplescript, "__esModule", {
12281
10749
  });
12282
10750
  runApplescript.runAppleScript = runAppleScript;
12283
10751
  runApplescript.runAppleScriptSync = runAppleScriptSync;
12284
- var _nodeProcess$2 = require$$0$1;
12285
- var _nodeUtil$2 = require$$0$3;
12286
- var _nodeChild_process$3 = require$$2$5;
10752
+ var _nodeProcess$2 = require$$0;
10753
+ var _nodeUtil$2 = require$$0$2;
10754
+ var _nodeChild_process$3 = require$$2$3;
12287
10755
  const execFileAsync$2 = (0, _nodeUtil$2.promisify)(_nodeChild_process$3.execFile);
12288
10756
  async function runAppleScript(script, {
12289
10757
  humanReadableOutput = true
@@ -12328,8 +10796,8 @@ Object.defineProperty(windows, "__esModule", {
12328
10796
  });
12329
10797
  windows.UnknownBrowserError = void 0;
12330
10798
  windows.default = defaultBrowser$1;
12331
- var _nodeUtil$1 = require$$0$3;
12332
- var _nodeChild_process$2 = require$$2$5;
10799
+ var _nodeUtil$1 = require$$0$2;
10800
+ var _nodeChild_process$2 = require$$2$3;
12333
10801
  const execFileAsync$1 = (0, _nodeUtil$1.promisify)(_nodeChild_process$2.execFile);
12334
10802
 
12335
10803
  // Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake
@@ -12398,9 +10866,9 @@ Object.defineProperty(defaultBrowser$2, "__esModule", {
12398
10866
  value: true
12399
10867
  });
12400
10868
  defaultBrowser$2.default = defaultBrowser;
12401
- var _nodeUtil = require$$0$3;
12402
- var _nodeProcess$1 = require$$0$1;
12403
- var _nodeChild_process$1 = require$$2$5;
10869
+ var _nodeUtil = require$$0$2;
10870
+ var _nodeProcess$1 = require$$0;
10871
+ var _nodeChild_process$1 = require$$2$3;
12404
10872
  var _defaultBrowserId = defaultBrowserId$1;
12405
10873
  var _bundleName = bundleName$1;
12406
10874
  var _windows = windows;
@@ -12439,18 +10907,18 @@ Object.defineProperty(open$1, "__esModule", {
12439
10907
  value: true
12440
10908
  });
12441
10909
  open$1.openApp = open$1.default = open$1.apps = void 0;
12442
- var _nodeProcess = require$$0$1;
12443
- var _nodeBuffer = require$$2$6;
12444
- var _nodePath = require$$1;
12445
- var _nodeUrl = require$$8$1;
12446
- var _nodeChild_process = require$$2$5;
12447
- var _promises = _interopRequireWildcard(require$$1$4, true);
10910
+ var _nodeProcess = require$$0;
10911
+ var _nodeBuffer = require$$2$4;
10912
+ var _nodePath = require$$1$1;
10913
+ var _nodeUrl = require$$8;
10914
+ var _nodeChild_process = require$$2$3;
10915
+ var _promises = _interopRequireWildcard(require$$1$3, true);
12448
10916
  var _isWsl = isWsl$1;
12449
10917
  var _defineLazyProp = defineLazyProp;
12450
10918
  var _defaultBrowser = defaultBrowser$2;
12451
10919
  var _isInsideContainer = isInsideContainer$1;
12452
10920
  // Path to included `xdg-open`.
12453
- const _dirname = _nodePath.dirname((0, _nodeUrl.fileURLToPath)((typeof document === 'undefined' ? require$$8$1.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vendor.js', document.baseURI).href))));
10921
+ const _dirname = _nodePath.dirname((0, _nodeUrl.fileURLToPath)((typeof document === 'undefined' ? require$$8.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vendor.js', document.baseURI).href))));
12454
10922
  const localXdgOpenPath = _nodePath.join(_dirname, 'xdg-open');
12455
10923
  const {
12456
10924
  platform,
@@ -12745,19 +11213,12 @@ const apps = open$1.apps = {};
12745
11213
  open$1.default = open;
12746
11214
 
12747
11215
  exports.build = build;
12748
- exports.constants_1 = constants_1;
12749
11216
  exports.dist = dist$1;
12750
- exports.env = env$1;
12751
11217
  exports.interopRequireDefault = interopRequireDefault;
12752
11218
  exports.interopRequireWildcard = interopRequireWildcard;
12753
11219
  exports.isInteractive = isInteractive$1;
12754
11220
  exports.isUnicodeSupported = isUnicodeSupported$1;
12755
- exports.objects = objects;
12756
11221
  exports.open = open$1;
12757
11222
  exports.ora = ora$1;
12758
- exports.packages = packages;
12759
- exports.promises = promises;
12760
- exports.regexps = regexps;
12761
11223
  exports.source = source;
12762
- exports.strings = strings;
12763
11224
  exports.terminalLink = terminalLink$1;