@socketsecurity/cli 0.11.1 → 0.13.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/dist/vendor.js CHANGED
@@ -24,11 +24,10 @@ var require$$0$b = require('node:stream/promises');
24
24
  var require$$0$d = require('node:stream');
25
25
  var require$$0$c = require('node:buffer');
26
26
  var require$$1$1 = require('signal-exit');
27
- var require$$1$2 = require('onetime');
28
- var require$$0$e = require('node:assert');
29
27
  var require$$3 = require('cli-spinners');
30
- var require$$1$3 = require('supports-hyperlinks');
31
- var require$$1$4 = require('node:fs/promises');
28
+ var require$$0$e = require('supports-color');
29
+ var require$$1$2 = require('has-flag');
30
+ var require$$1$3 = require('node:fs/promises');
32
31
  var require$$4$1 = require('fast-glob');
33
32
  var require$$5 = require('ignore');
34
33
 
@@ -314,19 +313,19 @@ function assembleStyles$1() {
314
313
  const ansiStyles$2 = assembleStyles$1();
315
314
  ansiStyles$3.default = ansiStyles$2;
316
315
 
317
- var supportsColor$1 = {};
316
+ var supportsColor$2 = {};
318
317
 
319
- Object.defineProperty(supportsColor$1, "__esModule", {
318
+ Object.defineProperty(supportsColor$2, "__esModule", {
320
319
  value: true
321
320
  });
322
- supportsColor$1.createSupportsColor = createSupportsColor;
323
- supportsColor$1.default = void 0;
321
+ supportsColor$2.createSupportsColor = createSupportsColor;
322
+ supportsColor$2.default = void 0;
324
323
  var _nodeProcess$w = require$$0;
325
324
  var _nodeOs$7 = require$$0$1;
326
325
  var _nodeTty$2 = require$$2;
327
326
  // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
328
327
  /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
329
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : _nodeProcess$w.argv) {
328
+ function hasFlag$1(flag, argv = globalThis.Deno ? globalThis.Deno.args : _nodeProcess$w.argv) {
330
329
  const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
331
330
  const position = argv.indexOf(prefix + flag);
332
331
  const terminatorPosition = argv.indexOf('--');
@@ -336,9 +335,9 @@ const {
336
335
  env: env$1
337
336
  } = _nodeProcess$w;
338
337
  let flagForceColor;
339
- if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) {
338
+ if (hasFlag$1('no-color') || hasFlag$1('no-colors') || hasFlag$1('color=false') || hasFlag$1('color=never')) {
340
339
  flagForceColor = 0;
341
- } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
340
+ } else if (hasFlag$1('color') || hasFlag$1('colors') || hasFlag$1('color=true') || hasFlag$1('color=always')) {
342
341
  flagForceColor = 1;
343
342
  }
344
343
  function envForceColor() {
@@ -376,10 +375,10 @@ function _supportsColor(haveStream, {
376
375
  return 0;
377
376
  }
378
377
  if (sniffFlags) {
379
- if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
378
+ if (hasFlag$1('color=16m') || hasFlag$1('color=full') || hasFlag$1('color=truecolor')) {
380
379
  return 3;
381
380
  }
382
- if (hasFlag('color=256')) {
381
+ if (hasFlag$1('color=256')) {
383
382
  return 2;
384
383
  }
385
384
  }
@@ -455,7 +454,7 @@ function createSupportsColor(stream, options = {}) {
455
454
  });
456
455
  return translateLevel(level);
457
456
  }
458
- const supportsColor = {
457
+ const supportsColor$1 = {
459
458
  stdout: createSupportsColor({
460
459
  isTTY: _nodeTty$2.isatty(1)
461
460
  }),
@@ -463,7 +462,7 @@ const supportsColor = {
463
462
  isTTY: _nodeTty$2.isatty(2)
464
463
  })
465
464
  };
466
- supportsColor$1.default = supportsColor;
465
+ supportsColor$2.default = supportsColor$1;
467
466
 
468
467
  var utilities$1 = {};
469
468
 
@@ -560,7 +559,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
560
559
  });
561
560
  exports.supportsColorStderr = exports.supportsColor = void 0;
562
561
  var _ansiStyles = ansiStyles$3;
563
- var _supportsColor = supportsColor$1;
562
+ var _supportsColor = supportsColor$2;
564
563
  var _utilities = utilities$1;
565
564
  var _index = ansiStyles$3;
566
565
  const {
@@ -1148,12 +1147,12 @@ var _nodeProcess$t = require$$0;
1148
1147
  constants$1.IS_LINUX = _nodeProcess$t.platform === 'linux';
1149
1148
  constants$1.IS_WINDOWS = _nodeProcess$t.platform === 'win32';
1150
1149
 
1151
- var signals$3 = {};
1150
+ var signals$1 = {};
1152
1151
 
1153
- Object.defineProperty(signals$3, "__esModule", {
1152
+ Object.defineProperty(signals$1, "__esModule", {
1154
1153
  value: true
1155
1154
  });
1156
- signals$3.default = void 0;
1155
+ signals$1.default = void 0;
1157
1156
  var _constants$6 = constants$1;
1158
1157
  /* IMPORT */
1159
1158
 
@@ -1167,7 +1166,7 @@ if (_constants$6.IS_LINUX) {
1167
1166
  Signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED');
1168
1167
  }
1169
1168
  /* EXPORT */
1170
- signals$3.default = Signals;
1169
+ signals$1.default = Signals;
1171
1170
 
1172
1171
  Object.defineProperty(interceptor, "__esModule", {
1173
1172
  value: true
@@ -1175,7 +1174,7 @@ Object.defineProperty(interceptor, "__esModule", {
1175
1174
  interceptor.default = void 0;
1176
1175
  var _nodeProcess$s = require$$0;
1177
1176
  var _constants$5 = constants$1;
1178
- var _signals$1 = signals$3;
1177
+ var _signals$1 = signals$1;
1179
1178
  /* IMPORT */
1180
1179
 
1181
1180
  /* MAIN */
@@ -5719,7 +5718,7 @@ const getRealtimeSignal = (value, index) => ({
5719
5718
  const SIGRTMIN = 34;
5720
5719
  const SIGRTMAX = realtime.SIGRTMAX = 64;
5721
5720
 
5722
- var signals$2 = {};
5721
+ var signals = {};
5723
5722
 
5724
5723
  var core = {};
5725
5724
 
@@ -5960,10 +5959,10 @@ core.SIGNALS = [{
5960
5959
  standard: "other"
5961
5960
  }];
5962
5961
 
5963
- Object.defineProperty(signals$2, "__esModule", {
5962
+ Object.defineProperty(signals, "__esModule", {
5964
5963
  value: true
5965
5964
  });
5966
- signals$2.getSignals = void 0;
5965
+ signals.getSignals = void 0;
5967
5966
  var _nodeOs$3 = require$$0$1;
5968
5967
  var _core = core;
5969
5968
  var _realtime$1 = realtime;
@@ -5972,7 +5971,7 @@ const getSignals = () => {
5972
5971
  const signals = [..._core.SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
5973
5972
  return signals;
5974
5973
  };
5975
- signals$2.getSignals = getSignals;
5974
+ signals.getSignals = getSignals;
5976
5975
  const normalizeSignal$1 = ({
5977
5976
  name,
5978
5977
  number: defaultNumber,
@@ -6005,7 +6004,7 @@ Object.defineProperty(main$1, "__esModule", {
6005
6004
  main$1.signalsByNumber = main$1.signalsByName = void 0;
6006
6005
  var _nodeOs$2 = require$$0$1;
6007
6006
  var _realtime = realtime;
6008
- var _signals = signals$2;
6007
+ var _signals = signals;
6009
6008
  const getSignalsByName = () => {
6010
6009
  const signals = (0, _signals.getSignals)();
6011
6010
  return Object.fromEntries(signals.map(getSignalByName));
@@ -23104,244 +23103,134 @@ var cliCursor$1 = {};
23104
23103
 
23105
23104
  var restoreCursor$1 = {};
23106
23105
 
23107
- var signalExit = {exports: {}};
23106
+ var onetime$1 = {};
23108
23107
 
23109
- var signals$1 = {exports: {}};
23108
+ var mimicFunction$1 = {};
23110
23109
 
23111
- var hasRequiredSignals;
23112
-
23113
- function requireSignals () {
23114
- if (hasRequiredSignals) return signals$1.exports;
23115
- hasRequiredSignals = 1;
23116
- (function (module) {
23117
-
23118
- // This is not the set of all possible signals.
23119
- //
23120
- // It IS, however, the set of all signals that trigger
23121
- // an exit on either Linux or BSD systems. Linux is a
23122
- // superset of the signal names supported on BSD, and
23123
- // the unknown signals just fail to register, so we can
23124
- // catch that easily enough.
23125
- //
23126
- // Don't bother with SIGKILL. It's uncatchable, which
23127
- // means that we can't fire any callbacks anyway.
23128
- //
23129
- // If a user does happen to register a handler on a non-
23130
- // fatal signal like SIGWINCH or something, and then
23131
- // exit, it'll end up firing `process.emit('exit')`, so
23132
- // the handler will be fired anyway.
23133
- //
23134
- // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
23135
- // artificially, inherently leave the process in a
23136
- // state from which it is not safe to try and enter JS
23137
- // listeners.
23138
- module.exports = ['SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM'];
23139
- if (process.platform !== 'win32') {
23140
- module.exports.push('SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
23141
- // should detect profiler and enable/disable accordingly.
23142
- // see #21
23143
- // 'SIGPROF'
23144
- );
23145
- }
23146
- if (process.platform === 'linux') {
23147
- module.exports.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED');
23148
- }
23149
- } (signals$1));
23150
- return signals$1.exports;
23151
- }
23110
+ Object.defineProperty(mimicFunction$1, "__esModule", {
23111
+ value: true
23112
+ });
23113
+ mimicFunction$1.default = mimicFunction;
23114
+ const copyProperty = (to, from, property, ignoreNonConfigurable) => {
23115
+ // `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
23116
+ // `Function#prototype` is non-writable and non-configurable so can never be modified.
23117
+ if (property === 'length' || property === 'prototype') {
23118
+ return;
23119
+ }
23152
23120
 
23153
- // Note: since nyc uses this module to output coverage, any lines
23154
- // that are in the direct sync flow of nyc's outputCoverage are
23155
- // ignored, since we can never get coverage for them.
23156
- // grab a reference to node's real process object right away
23157
- var process$1 = global.process;
23158
- const processOk = function (process) {
23159
- return process && typeof process === 'object' && typeof process.removeListener === 'function' && typeof process.emit === 'function' && typeof process.reallyExit === 'function' && typeof process.listeners === 'function' && typeof process.kill === 'function' && typeof process.pid === 'number' && typeof process.on === 'function';
23121
+ // `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.
23122
+ if (property === 'arguments' || property === 'caller') {
23123
+ return;
23124
+ }
23125
+ const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
23126
+ const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
23127
+ if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
23128
+ return;
23129
+ }
23130
+ Object.defineProperty(to, property, fromDescriptor);
23160
23131
  };
23161
23132
 
23162
- // some kind of non-node environment, just no-op
23163
- /* istanbul ignore if */
23164
- if (!processOk(process$1)) {
23165
- signalExit.exports = function () {
23166
- return function () {};
23167
- };
23168
- } else {
23169
- var assert = require$$0$e;
23170
- var signals = requireSignals();
23171
- var isWin = /^win/i.test(process$1.platform);
23172
- var EE = require$$0$9;
23173
- /* istanbul ignore if */
23174
- if (typeof EE !== 'function') {
23175
- EE = EE.EventEmitter;
23176
- }
23177
- var emitter;
23178
- if (process$1.__signal_exit_emitter__) {
23179
- emitter = process$1.__signal_exit_emitter__;
23180
- } else {
23181
- emitter = process$1.__signal_exit_emitter__ = new EE();
23182
- emitter.count = 0;
23183
- emitter.emitted = {};
23184
- }
23185
-
23186
- // Because this emitter is a global, we have to check to see if a
23187
- // previous version of this library failed to enable infinite listeners.
23188
- // I know what you're about to say. But literally everything about
23189
- // signal-exit is a compromise with evil. Get used to it.
23190
- if (!emitter.infinite) {
23191
- emitter.setMaxListeners(Infinity);
23192
- emitter.infinite = true;
23193
- }
23194
- signalExit.exports = function (cb, opts) {
23195
- /* istanbul ignore if */
23196
- if (!processOk(global.process)) {
23197
- return function () {};
23198
- }
23199
- assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
23200
- if (loaded === false) {
23201
- load();
23202
- }
23203
- var ev = 'exit';
23204
- if (opts && opts.alwaysLast) {
23205
- ev = 'afterexit';
23206
- }
23207
- var remove = function () {
23208
- emitter.removeListener(ev, cb);
23209
- if (emitter.listeners('exit').length === 0 && emitter.listeners('afterexit').length === 0) {
23210
- unload();
23211
- }
23212
- };
23213
- emitter.on(ev, cb);
23214
- return remove;
23215
- };
23216
- var unload = function unload() {
23217
- if (!loaded || !processOk(global.process)) {
23218
- return;
23219
- }
23220
- loaded = false;
23221
- signals.forEach(function (sig) {
23222
- try {
23223
- process$1.removeListener(sig, sigListeners[sig]);
23224
- } catch (er) {}
23225
- });
23226
- process$1.emit = originalProcessEmit;
23227
- process$1.reallyExit = originalProcessReallyExit;
23228
- emitter.count -= 1;
23229
- };
23230
- signalExit.exports.unload = unload;
23231
- var emit = function emit(event, code, signal) {
23232
- /* istanbul ignore if */
23233
- if (emitter.emitted[event]) {
23234
- return;
23235
- }
23236
- emitter.emitted[event] = true;
23237
- emitter.emit(event, code, signal);
23238
- };
23133
+ // `Object.defineProperty()` throws if the property exists, is not configurable and either:
23134
+ // - one its descriptors is changed
23135
+ // - it is non-writable and its value is changed
23136
+ const canCopyProperty = function (toDescriptor, fromDescriptor) {
23137
+ return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
23138
+ };
23139
+ const changePrototype = (to, from) => {
23140
+ const fromPrototype = Object.getPrototypeOf(from);
23141
+ if (fromPrototype === Object.getPrototypeOf(to)) {
23142
+ return;
23143
+ }
23144
+ Object.setPrototypeOf(to, fromPrototype);
23145
+ };
23146
+ const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`;
23147
+ const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');
23148
+ const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');
23239
23149
 
23240
- // { <signal>: <listener fn>, ... }
23241
- var sigListeners = {};
23242
- signals.forEach(function (sig) {
23243
- sigListeners[sig] = function listener() {
23244
- /* istanbul ignore if */
23245
- if (!processOk(global.process)) {
23246
- return;
23247
- }
23248
- // If there are no other listeners, an exit is coming!
23249
- // Simplest way: remove us and then re-send the signal.
23250
- // We know that this will kill the process, so we can
23251
- // safely emit now.
23252
- var listeners = process$1.listeners(sig);
23253
- if (listeners.length === emitter.count) {
23254
- unload();
23255
- emit('exit', null, sig);
23256
- /* istanbul ignore next */
23257
- emit('afterexit', null, sig);
23258
- /* istanbul ignore next */
23259
- if (isWin && sig === 'SIGHUP') {
23260
- // "SIGHUP" throws an `ENOSYS` error on Windows,
23261
- // so use a supported signal instead
23262
- sig = 'SIGINT';
23263
- }
23264
- /* istanbul ignore next */
23265
- process$1.kill(process$1.pid, sig);
23266
- }
23267
- };
23150
+ // We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.
23151
+ // We use `bind()` instead of a closure for the same reason.
23152
+ // Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.
23153
+ const changeToString = (to, from, name) => {
23154
+ const withName = name === '' ? '' : `with ${name.trim()}() `;
23155
+ const newToString = wrappedToString.bind(null, withName, from.toString());
23156
+ // Ensure `to.toString.toString` is non-enumerable and has the same `same`
23157
+ Object.defineProperty(newToString, 'name', toStringName);
23158
+ const {
23159
+ writable,
23160
+ enumerable,
23161
+ configurable
23162
+ } = toStringDescriptor; // We destructue to avoid a potential `get` descriptor.
23163
+ Object.defineProperty(to, 'toString', {
23164
+ value: newToString,
23165
+ writable,
23166
+ enumerable,
23167
+ configurable
23268
23168
  });
23269
- signalExit.exports.signals = function () {
23270
- return signals;
23271
- };
23272
- var loaded = false;
23273
- var load = function load() {
23274
- if (loaded || !processOk(global.process)) {
23275
- return;
23276
- }
23277
- loaded = true;
23278
-
23279
- // This is the number of onSignalExit's that are in play.
23280
- // It's important so that we can count the correct number of
23281
- // listeners on signals, and don't wait for the other one to
23282
- // handle it instead of us.
23283
- emitter.count += 1;
23284
- signals = signals.filter(function (sig) {
23285
- try {
23286
- process$1.on(sig, sigListeners[sig]);
23287
- return true;
23288
- } catch (er) {
23289
- return false;
23290
- }
23291
- });
23292
- process$1.emit = processEmit;
23293
- process$1.reallyExit = processReallyExit;
23294
- };
23295
- signalExit.exports.load = load;
23296
- var originalProcessReallyExit = process$1.reallyExit;
23297
- var processReallyExit = function processReallyExit(code) {
23298
- /* istanbul ignore if */
23299
- if (!processOk(global.process)) {
23300
- return;
23301
- }
23302
- process$1.exitCode = code || /* istanbul ignore next */0;
23303
- emit('exit', process$1.exitCode, null);
23304
- /* istanbul ignore next */
23305
- emit('afterexit', process$1.exitCode, null);
23306
- /* istanbul ignore next */
23307
- originalProcessReallyExit.call(process$1, process$1.exitCode);
23308
- };
23309
- var originalProcessEmit = process$1.emit;
23310
- var processEmit = function processEmit(ev, arg) {
23311
- if (ev === 'exit' && processOk(global.process)) {
23312
- /* istanbul ignore else */
23313
- if (arg !== undefined) {
23314
- process$1.exitCode = arg;
23315
- }
23316
- var ret = originalProcessEmit.apply(this, arguments);
23317
- /* istanbul ignore next */
23318
- emit('exit', process$1.exitCode, null);
23319
- /* istanbul ignore next */
23320
- emit('afterexit', process$1.exitCode, null);
23321
- /* istanbul ignore next */
23322
- return ret;
23323
- } else {
23324
- return originalProcessEmit.apply(this, arguments);
23325
- }
23326
- };
23169
+ };
23170
+ function mimicFunction(to, from, {
23171
+ ignoreNonConfigurable = false
23172
+ } = {}) {
23173
+ const {
23174
+ name
23175
+ } = to;
23176
+ for (const property of Reflect.ownKeys(from)) {
23177
+ copyProperty(to, from, property, ignoreNonConfigurable);
23178
+ }
23179
+ changePrototype(to, from);
23180
+ changeToString(to, from, name);
23181
+ return to;
23327
23182
  }
23328
23183
 
23329
- var signalExitExports = signalExit.exports;
23184
+ Object.defineProperty(onetime$1, "__esModule", {
23185
+ value: true
23186
+ });
23187
+ onetime$1.default = void 0;
23188
+ var _mimicFunction = mimicFunction$1;
23189
+ const calledFunctions = new WeakMap();
23190
+ const onetime = (function_, options = {}) => {
23191
+ if (typeof function_ !== 'function') {
23192
+ throw new TypeError('Expected a function');
23193
+ }
23194
+ let returnValue;
23195
+ let callCount = 0;
23196
+ const functionName = function_.displayName || function_.name || '<anonymous>';
23197
+ const onetime = function (...arguments_) {
23198
+ calledFunctions.set(onetime, ++callCount);
23199
+ if (callCount === 1) {
23200
+ returnValue = function_.apply(this, arguments_);
23201
+ function_ = undefined;
23202
+ } else if (options.throw === true) {
23203
+ throw new Error(`Function \`${functionName}\` can only be called once`);
23204
+ }
23205
+ return returnValue;
23206
+ };
23207
+ (0, _mimicFunction.default)(onetime, function_);
23208
+ calledFunctions.set(onetime, callCount);
23209
+ return onetime;
23210
+ };
23211
+ onetime.callCount = function_ => {
23212
+ if (!calledFunctions.has(function_)) {
23213
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
23214
+ }
23215
+ return calledFunctions.get(function_);
23216
+ };
23217
+ onetime$1.default = onetime;
23330
23218
 
23331
23219
  Object.defineProperty(restoreCursor$1, "__esModule", {
23332
23220
  value: true
23333
23221
  });
23334
23222
  restoreCursor$1.default = void 0;
23335
23223
  var _nodeProcess$a = require$$0;
23336
- var _onetime = require$$1$2;
23337
- var _signalExit = signalExitExports;
23338
- const restoreCursor = _onetime(() => {
23339
- _signalExit(() => {
23340
- _nodeProcess$a.stderr.write('\u001B[?25h');
23224
+ var _onetime = onetime$1;
23225
+ var _signalExit = require$$1$1;
23226
+ const terminal = _nodeProcess$a.stderr.isTTY ? _nodeProcess$a.stderr : _nodeProcess$a.stdout.isTTY ? _nodeProcess$a.stdout : undefined;
23227
+ const restoreCursor = terminal ? (0, _onetime.default)(() => {
23228
+ (0, _signalExit.onExit)(() => {
23229
+ terminal.write('\u001B[?25h');
23341
23230
  }, {
23342
23231
  alwaysLast: true
23343
23232
  });
23344
- });
23233
+ }) : () => {};
23345
23234
  restoreCursor$1.default = restoreCursor;
23346
23235
 
23347
23236
  Object.defineProperty(cliCursor$1, "__esModule", {
@@ -24061,12 +23950,97 @@ ansiEscapes.iTerm = {
24061
23950
  };
24062
23951
  ansiEscapes$1.default = ansiEscapes;
24063
23952
 
23953
+ const supportsColor = require$$0$e;
23954
+ const hasFlag = require$$1$2;
23955
+ function parseVersion(versionString) {
23956
+ if (/^\d{3,4}$/.test(versionString)) {
23957
+ // Env var doesn't always use dots. example: 4601 => 46.1.0
23958
+ const m = /(\d{1,2})(\d{2})/.exec(versionString);
23959
+ return {
23960
+ major: 0,
23961
+ minor: parseInt(m[1], 10),
23962
+ patch: parseInt(m[2], 10)
23963
+ };
23964
+ }
23965
+ const versions = (versionString || '').split('.').map(n => parseInt(n, 10));
23966
+ return {
23967
+ major: versions[0],
23968
+ minor: versions[1],
23969
+ patch: versions[2]
23970
+ };
23971
+ }
23972
+ function supportsHyperlink(stream) {
23973
+ const {
23974
+ env
23975
+ } = process;
23976
+ if ('FORCE_HYPERLINK' in env) {
23977
+ return !(env.FORCE_HYPERLINK.length > 0 && parseInt(env.FORCE_HYPERLINK, 10) === 0);
23978
+ }
23979
+ if (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {
23980
+ return false;
23981
+ }
23982
+ if (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) {
23983
+ return true;
23984
+ }
23985
+
23986
+ // Netlify does not run a TTY, it does not need `supportsColor` check
23987
+ if ('NETLIFY' in env) {
23988
+ return true;
23989
+ }
23990
+
23991
+ // If they specify no colors, they probably don't want hyperlinks.
23992
+ if (!supportsColor.supportsColor(stream)) {
23993
+ return false;
23994
+ }
23995
+ if (stream && !stream.isTTY) {
23996
+ return false;
23997
+ }
23998
+ if (process.platform === 'win32') {
23999
+ return false;
24000
+ }
24001
+ if ('CI' in env) {
24002
+ return false;
24003
+ }
24004
+ if ('TEAMCITY_VERSION' in env) {
24005
+ return false;
24006
+ }
24007
+ if ('TERM_PROGRAM' in env) {
24008
+ const version = parseVersion(env.TERM_PROGRAM_VERSION);
24009
+ switch (env.TERM_PROGRAM) {
24010
+ case 'iTerm.app':
24011
+ if (version.major === 3) {
24012
+ return version.minor >= 1;
24013
+ }
24014
+ return version.major > 3;
24015
+ case 'WezTerm':
24016
+ return version.major >= 20200620;
24017
+ case 'vscode':
24018
+ return version.major > 1 || version.major === 1 && version.minor >= 72;
24019
+ // No default
24020
+ }
24021
+ }
24022
+ if ('VTE_VERSION' in env) {
24023
+ // 0.50.0 was supposed to support hyperlinks, but throws a segfault
24024
+ if (env.VTE_VERSION === '0.50.0') {
24025
+ return false;
24026
+ }
24027
+ const version = parseVersion(env.VTE_VERSION);
24028
+ return version.major > 0 || version.minor >= 50;
24029
+ }
24030
+ return false;
24031
+ }
24032
+ var supportsHyperlinks = {
24033
+ supportsHyperlink,
24034
+ stdout: supportsHyperlink(process.stdout),
24035
+ stderr: supportsHyperlink(process.stderr)
24036
+ };
24037
+
24064
24038
  Object.defineProperty(terminalLink$1, "__esModule", {
24065
24039
  value: true
24066
24040
  });
24067
24041
  terminalLink$1.default = terminalLink;
24068
24042
  var _ansiEscapes = ansiEscapes$1;
24069
- var _supportsHyperlinks = require$$1$3;
24043
+ var _supportsHyperlinks = supportsHyperlinks;
24070
24044
  function terminalLink(text, url, {
24071
24045
  target = 'stdout',
24072
24046
  ...options
@@ -24462,7 +24436,7 @@ Object.defineProperty(ignore, "__esModule", {
24462
24436
  ignore.isIgnoredByIgnoreFilesSync = ignore.isIgnoredByIgnoreFiles = ignore.isGitIgnoredSync = ignore.isGitIgnored = ignore.GITIGNORE_FILES_PATTERN = void 0;
24463
24437
  var _nodeProcess$5 = require$$0;
24464
24438
  var _nodeFs$3 = require$$0$2;
24465
- var _promises$1 = require$$1$4;
24439
+ var _promises$1 = require$$1$3;
24466
24440
  var _nodePath$1 = require$$1;
24467
24441
  var _fastGlob = require$$4$1;
24468
24442
  var _ignore = require$$5;
@@ -25107,7 +25081,7 @@ var _nodeBuffer = require$$0$c;
25107
25081
  var _nodePath = require$$1;
25108
25082
  var _nodeUrl = require$$2$3;
25109
25083
  var _nodeChild_process = require$$0$6;
25110
- var _promises = _interopRequireWildcard(require$$1$4, true);
25084
+ var _promises = _interopRequireWildcard(require$$1$3, true);
25111
25085
  var _isWsl = isWsl$1;
25112
25086
  var _defineLazyProp = defineLazyProp;
25113
25087
  var _defaultBrowser = defaultBrowser$2;