snyk 1.1190.0 → 1.1192.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.
@@ -14,18 +14,33 @@ const child_process_1 = __webpack_require__(32081);
14
14
  // Resolves successfully on exit code 0 with all the info
15
15
  // available
16
16
  async function execute(command, args, options) {
17
+ // WARN: Snyk CLI uses an internal proxy configuration that interferes
18
+ // with network requests made by subprocesses. In order to bypass this
19
+ // we reset the relevant environment variables to their defaults that
20
+ // the CLI has cached.
21
+ const env = Object.assign({}, process.env);
22
+ if (typeof process.env.SNYK_SYSTEM_HTTP_PROXY !== 'undefined') {
23
+ env.HTTP_PROXY = process.env.SNYK_SYSTEM_HTTP_PROXY;
24
+ }
25
+ if (typeof process.env.SNYK_SYSTEM_HTTPS_PROXY !== 'undefined') {
26
+ env.HTTPS_PROXY = process.env.SNYK_SYSTEM_HTTPS_PROXY;
27
+ }
28
+ if (typeof process.env.SNYK_SYSTEM_NO_PROXY !== 'undefined') {
29
+ env.NO_PROXY = process.env.SNYK_SYSTEM_NO_PROXY;
30
+ }
17
31
  const spawnOptions = {
32
+ env,
18
33
  shell: false,
19
- detached: true,
34
+ detached: true, // do not send signals to child processes
20
35
  };
21
36
  if (options && options.cwd) {
22
37
  spawnOptions.cwd = options.cwd;
23
38
  }
24
- const fullCommand = `${command} ${args.join(' ')}`;
39
+ const fullCommand = `${command} ${args.join(' ')}`.trim();
25
40
  const startTime = Date.now();
26
41
  let processId;
27
42
  try {
28
- const worker = child_process_1.spawn(command, args, options);
43
+ const worker = (0, child_process_1.spawn)(command, args, spawnOptions);
29
44
  processId = worker.pid;
30
45
  return await new Promise((resolve, reject) => {
31
46
  let stderr = '';
@@ -91,6 +106,7 @@ exports.execute = execute;
91
106
  "use strict";
92
107
 
93
108
  Object.defineProperty(exports, "__esModule", ({ value: true }));
109
+ exports.execute = void 0;
94
110
  var child_process_1 = __webpack_require__(18971);
95
111
  Object.defineProperty(exports, "execute", ({ enumerable: true, get: function () { return child_process_1.execute; } }));
96
112
  //# sourceMappingURL=index.js.map
@@ -104,8 +120,8 @@ Object.defineProperty(exports, "execute", ({ enumerable: true, get: function ()
104
120
 
105
121
  Object.defineProperty(exports, "__esModule", ({ value: true }));
106
122
  exports.isPipenvInstalled = exports.extractPipenvVersion = void 0;
107
- const debugLib = __webpack_require__(92259);
108
123
  const child_process_1 = __webpack_require__(74262);
124
+ const debugLib = __webpack_require__(15158);
109
125
  const debug = debugLib('snyk-fix:python:Pipfile');
110
126
  function extractPipenvVersion(stdout) {
111
127
  /* stdout example:
@@ -123,7 +139,7 @@ exports.extractPipenvVersion = extractPipenvVersion;
123
139
  async function isPipenvInstalled() {
124
140
  let res;
125
141
  try {
126
- res = await child_process_1.execute('pipenv', ['--version'], {});
142
+ res = await (0, child_process_1.execute)('pipenv', ['--version'], {});
127
143
  }
128
144
  catch (e) {
129
145
  debug('Execute failed with', e);
@@ -145,6 +161,7 @@ exports.isPipenvInstalled = isPipenvInstalled;
145
161
  "use strict";
146
162
 
147
163
  Object.defineProperty(exports, "__esModule", ({ value: true }));
164
+ exports.pipenvInstall = exports.isPipenvSupportedVersion = exports.isPipenvInstalled = void 0;
148
165
  var check_pip_env_installed_1 = __webpack_require__(21591);
149
166
  Object.defineProperty(exports, "isPipenvInstalled", ({ enumerable: true, get: function () { return check_pip_env_installed_1.isPipenvInstalled; } }));
150
167
  var is_pipenv_supported_version_1 = __webpack_require__(97149);
@@ -206,8 +223,8 @@ exports.isPipenvSupportedVersion = isPipenvSupportedVersion;
206
223
 
207
224
  Object.defineProperty(exports, "__esModule", ({ value: true }));
208
225
  exports.pipenvInstall = void 0;
209
- const debugLib = __webpack_require__(92259);
210
226
  const bottleneck_1 = __webpack_require__(35861);
227
+ const debugLib = __webpack_require__(15158);
211
228
  const child_process_1 = __webpack_require__(74262);
212
229
  const debug = debugLib('snyk-fix:python:Pipfile');
213
230
  const limiter = new bottleneck_1.default({
@@ -232,7 +249,7 @@ async function runPipenvInstall(projectPath, requirements, config) {
232
249
  }
233
250
  let res;
234
251
  try {
235
- res = await child_process_1.execute('pipenv', args, {
252
+ res = await (0, child_process_1.execute)('pipenv', args, {
236
253
  cwd: projectPath,
237
254
  });
238
255
  }
@@ -245,837 +262,6 @@ async function runPipenvInstall(projectPath, requirements, config) {
245
262
  exports.pipenvInstall = limiter.wrap(runPipenvInstall);
246
263
  //# sourceMappingURL=pipenv-install.js.map
247
264
 
248
- /***/ }),
249
-
250
- /***/ 35535:
251
- /***/ ((module, exports, __webpack_require__) => {
252
-
253
- /* eslint-env browser */
254
-
255
- /**
256
- * This is the web browser implementation of `debug()`.
257
- */
258
-
259
- exports.formatArgs = formatArgs;
260
- exports.save = save;
261
- exports.load = load;
262
- exports.useColors = useColors;
263
- exports.storage = localstorage();
264
- exports.destroy = (() => {
265
- let warned = false;
266
-
267
- return () => {
268
- if (!warned) {
269
- warned = true;
270
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
271
- }
272
- };
273
- })();
274
-
275
- /**
276
- * Colors.
277
- */
278
-
279
- exports.colors = [
280
- '#0000CC',
281
- '#0000FF',
282
- '#0033CC',
283
- '#0033FF',
284
- '#0066CC',
285
- '#0066FF',
286
- '#0099CC',
287
- '#0099FF',
288
- '#00CC00',
289
- '#00CC33',
290
- '#00CC66',
291
- '#00CC99',
292
- '#00CCCC',
293
- '#00CCFF',
294
- '#3300CC',
295
- '#3300FF',
296
- '#3333CC',
297
- '#3333FF',
298
- '#3366CC',
299
- '#3366FF',
300
- '#3399CC',
301
- '#3399FF',
302
- '#33CC00',
303
- '#33CC33',
304
- '#33CC66',
305
- '#33CC99',
306
- '#33CCCC',
307
- '#33CCFF',
308
- '#6600CC',
309
- '#6600FF',
310
- '#6633CC',
311
- '#6633FF',
312
- '#66CC00',
313
- '#66CC33',
314
- '#9900CC',
315
- '#9900FF',
316
- '#9933CC',
317
- '#9933FF',
318
- '#99CC00',
319
- '#99CC33',
320
- '#CC0000',
321
- '#CC0033',
322
- '#CC0066',
323
- '#CC0099',
324
- '#CC00CC',
325
- '#CC00FF',
326
- '#CC3300',
327
- '#CC3333',
328
- '#CC3366',
329
- '#CC3399',
330
- '#CC33CC',
331
- '#CC33FF',
332
- '#CC6600',
333
- '#CC6633',
334
- '#CC9900',
335
- '#CC9933',
336
- '#CCCC00',
337
- '#CCCC33',
338
- '#FF0000',
339
- '#FF0033',
340
- '#FF0066',
341
- '#FF0099',
342
- '#FF00CC',
343
- '#FF00FF',
344
- '#FF3300',
345
- '#FF3333',
346
- '#FF3366',
347
- '#FF3399',
348
- '#FF33CC',
349
- '#FF33FF',
350
- '#FF6600',
351
- '#FF6633',
352
- '#FF9900',
353
- '#FF9933',
354
- '#FFCC00',
355
- '#FFCC33'
356
- ];
357
-
358
- /**
359
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
360
- * and the Firebug extension (any Firefox version) are known
361
- * to support "%c" CSS customizations.
362
- *
363
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
364
- */
365
-
366
- // eslint-disable-next-line complexity
367
- function useColors() {
368
- // NB: In an Electron preload script, document will be defined but not fully
369
- // initialized. Since we know we're in Chrome, we'll just detect this case
370
- // explicitly
371
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
372
- return true;
373
- }
374
-
375
- // Internet Explorer and Edge do not support colors.
376
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
377
- return false;
378
- }
379
-
380
- // Is webkit? http://stackoverflow.com/a/16459606/376773
381
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
382
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
383
- // Is firebug? http://stackoverflow.com/a/398120/376773
384
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
385
- // Is firefox >= v31?
386
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
387
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
388
- // Double check webkit in userAgent just in case we are in a worker
389
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
390
- }
391
-
392
- /**
393
- * Colorize log arguments if enabled.
394
- *
395
- * @api public
396
- */
397
-
398
- function formatArgs(args) {
399
- args[0] = (this.useColors ? '%c' : '') +
400
- this.namespace +
401
- (this.useColors ? ' %c' : ' ') +
402
- args[0] +
403
- (this.useColors ? '%c ' : ' ') +
404
- '+' + module.exports.humanize(this.diff);
405
-
406
- if (!this.useColors) {
407
- return;
408
- }
409
-
410
- const c = 'color: ' + this.color;
411
- args.splice(1, 0, c, 'color: inherit');
412
-
413
- // The final "%c" is somewhat tricky, because there could be other
414
- // arguments passed either before or after the %c, so we need to
415
- // figure out the correct index to insert the CSS into
416
- let index = 0;
417
- let lastC = 0;
418
- args[0].replace(/%[a-zA-Z%]/g, match => {
419
- if (match === '%%') {
420
- return;
421
- }
422
- index++;
423
- if (match === '%c') {
424
- // We only are interested in the *last* %c
425
- // (the user may have provided their own)
426
- lastC = index;
427
- }
428
- });
429
-
430
- args.splice(lastC, 0, c);
431
- }
432
-
433
- /**
434
- * Invokes `console.debug()` when available.
435
- * No-op when `console.debug` is not a "function".
436
- * If `console.debug` is not available, falls back
437
- * to `console.log`.
438
- *
439
- * @api public
440
- */
441
- exports.log = console.debug || console.log || (() => {});
442
-
443
- /**
444
- * Save `namespaces`.
445
- *
446
- * @param {String} namespaces
447
- * @api private
448
- */
449
- function save(namespaces) {
450
- try {
451
- if (namespaces) {
452
- exports.storage.setItem('debug', namespaces);
453
- } else {
454
- exports.storage.removeItem('debug');
455
- }
456
- } catch (error) {
457
- // Swallow
458
- // XXX (@Qix-) should we be logging these?
459
- }
460
- }
461
-
462
- /**
463
- * Load `namespaces`.
464
- *
465
- * @return {String} returns the previously persisted debug modes
466
- * @api private
467
- */
468
- function load() {
469
- let r;
470
- try {
471
- r = exports.storage.getItem('debug');
472
- } catch (error) {
473
- // Swallow
474
- // XXX (@Qix-) should we be logging these?
475
- }
476
-
477
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
478
- if (!r && typeof process !== 'undefined' && 'env' in process) {
479
- r = process.env.DEBUG;
480
- }
481
-
482
- return r;
483
- }
484
-
485
- /**
486
- * Localstorage attempts to return the localstorage.
487
- *
488
- * This is necessary because safari throws
489
- * when a user disables cookies/localstorage
490
- * and you attempt to access it.
491
- *
492
- * @return {LocalStorage}
493
- * @api private
494
- */
495
-
496
- function localstorage() {
497
- try {
498
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
499
- // The Browser also has localStorage in the global context.
500
- return localStorage;
501
- } catch (error) {
502
- // Swallow
503
- // XXX (@Qix-) should we be logging these?
504
- }
505
- }
506
-
507
- module.exports = __webpack_require__(97977)(exports);
508
-
509
- const {formatters} = module.exports;
510
-
511
- /**
512
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
513
- */
514
-
515
- formatters.j = function (v) {
516
- try {
517
- return JSON.stringify(v);
518
- } catch (error) {
519
- return '[UnexpectedJSONParseError]: ' + error.message;
520
- }
521
- };
522
-
523
-
524
- /***/ }),
525
-
526
- /***/ 97977:
527
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
528
-
529
-
530
- /**
531
- * This is the common logic for both the Node.js and web browser
532
- * implementations of `debug()`.
533
- */
534
-
535
- function setup(env) {
536
- createDebug.debug = createDebug;
537
- createDebug.default = createDebug;
538
- createDebug.coerce = coerce;
539
- createDebug.disable = disable;
540
- createDebug.enable = enable;
541
- createDebug.enabled = enabled;
542
- createDebug.humanize = __webpack_require__(57824);
543
- createDebug.destroy = destroy;
544
-
545
- Object.keys(env).forEach(key => {
546
- createDebug[key] = env[key];
547
- });
548
-
549
- /**
550
- * The currently active debug mode names, and names to skip.
551
- */
552
-
553
- createDebug.names = [];
554
- createDebug.skips = [];
555
-
556
- /**
557
- * Map of special "%n" handling functions, for the debug "format" argument.
558
- *
559
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
560
- */
561
- createDebug.formatters = {};
562
-
563
- /**
564
- * Selects a color for a debug namespace
565
- * @param {String} namespace The namespace string for the for the debug instance to be colored
566
- * @return {Number|String} An ANSI color code for the given namespace
567
- * @api private
568
- */
569
- function selectColor(namespace) {
570
- let hash = 0;
571
-
572
- for (let i = 0; i < namespace.length; i++) {
573
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
574
- hash |= 0; // Convert to 32bit integer
575
- }
576
-
577
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
578
- }
579
- createDebug.selectColor = selectColor;
580
-
581
- /**
582
- * Create a debugger with the given `namespace`.
583
- *
584
- * @param {String} namespace
585
- * @return {Function}
586
- * @api public
587
- */
588
- function createDebug(namespace) {
589
- let prevTime;
590
- let enableOverride = null;
591
-
592
- function debug(...args) {
593
- // Disabled?
594
- if (!debug.enabled) {
595
- return;
596
- }
597
-
598
- const self = debug;
599
-
600
- // Set `diff` timestamp
601
- const curr = Number(new Date());
602
- const ms = curr - (prevTime || curr);
603
- self.diff = ms;
604
- self.prev = prevTime;
605
- self.curr = curr;
606
- prevTime = curr;
607
-
608
- args[0] = createDebug.coerce(args[0]);
609
-
610
- if (typeof args[0] !== 'string') {
611
- // Anything else let's inspect with %O
612
- args.unshift('%O');
613
- }
614
-
615
- // Apply any `formatters` transformations
616
- let index = 0;
617
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
618
- // If we encounter an escaped % then don't increase the array index
619
- if (match === '%%') {
620
- return '%';
621
- }
622
- index++;
623
- const formatter = createDebug.formatters[format];
624
- if (typeof formatter === 'function') {
625
- const val = args[index];
626
- match = formatter.call(self, val);
627
-
628
- // Now we need to remove `args[index]` since it's inlined in the `format`
629
- args.splice(index, 1);
630
- index--;
631
- }
632
- return match;
633
- });
634
-
635
- // Apply env-specific formatting (colors, etc.)
636
- createDebug.formatArgs.call(self, args);
637
-
638
- const logFn = self.log || createDebug.log;
639
- logFn.apply(self, args);
640
- }
641
-
642
- debug.namespace = namespace;
643
- debug.useColors = createDebug.useColors();
644
- debug.color = createDebug.selectColor(namespace);
645
- debug.extend = extend;
646
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
647
-
648
- Object.defineProperty(debug, 'enabled', {
649
- enumerable: true,
650
- configurable: false,
651
- get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
652
- set: v => {
653
- enableOverride = v;
654
- }
655
- });
656
-
657
- // Env-specific initialization logic for debug instances
658
- if (typeof createDebug.init === 'function') {
659
- createDebug.init(debug);
660
- }
661
-
662
- return debug;
663
- }
664
-
665
- function extend(namespace, delimiter) {
666
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
667
- newDebug.log = this.log;
668
- return newDebug;
669
- }
670
-
671
- /**
672
- * Enables a debug mode by namespaces. This can include modes
673
- * separated by a colon and wildcards.
674
- *
675
- * @param {String} namespaces
676
- * @api public
677
- */
678
- function enable(namespaces) {
679
- createDebug.save(namespaces);
680
-
681
- createDebug.names = [];
682
- createDebug.skips = [];
683
-
684
- let i;
685
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
686
- const len = split.length;
687
-
688
- for (i = 0; i < len; i++) {
689
- if (!split[i]) {
690
- // ignore empty strings
691
- continue;
692
- }
693
-
694
- namespaces = split[i].replace(/\*/g, '.*?');
695
-
696
- if (namespaces[0] === '-') {
697
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
698
- } else {
699
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
700
- }
701
- }
702
- }
703
-
704
- /**
705
- * Disable debug output.
706
- *
707
- * @return {String} namespaces
708
- * @api public
709
- */
710
- function disable() {
711
- const namespaces = [
712
- ...createDebug.names.map(toNamespace),
713
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
714
- ].join(',');
715
- createDebug.enable('');
716
- return namespaces;
717
- }
718
-
719
- /**
720
- * Returns true if the given mode name is enabled, false otherwise.
721
- *
722
- * @param {String} name
723
- * @return {Boolean}
724
- * @api public
725
- */
726
- function enabled(name) {
727
- if (name[name.length - 1] === '*') {
728
- return true;
729
- }
730
-
731
- let i;
732
- let len;
733
-
734
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
735
- if (createDebug.skips[i].test(name)) {
736
- return false;
737
- }
738
- }
739
-
740
- for (i = 0, len = createDebug.names.length; i < len; i++) {
741
- if (createDebug.names[i].test(name)) {
742
- return true;
743
- }
744
- }
745
-
746
- return false;
747
- }
748
-
749
- /**
750
- * Convert regexp to namespace
751
- *
752
- * @param {RegExp} regxep
753
- * @return {String} namespace
754
- * @api private
755
- */
756
- function toNamespace(regexp) {
757
- return regexp.toString()
758
- .substring(2, regexp.toString().length - 2)
759
- .replace(/\.\*\?$/, '*');
760
- }
761
-
762
- /**
763
- * Coerce `val`.
764
- *
765
- * @param {Mixed} val
766
- * @return {Mixed}
767
- * @api private
768
- */
769
- function coerce(val) {
770
- if (val instanceof Error) {
771
- return val.stack || val.message;
772
- }
773
- return val;
774
- }
775
-
776
- /**
777
- * XXX DO NOT USE. This is a temporary stub function.
778
- * XXX It WILL be removed in the next major release.
779
- */
780
- function destroy() {
781
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
782
- }
783
-
784
- createDebug.enable(createDebug.load());
785
-
786
- return createDebug;
787
- }
788
-
789
- module.exports = setup;
790
-
791
-
792
- /***/ }),
793
-
794
- /***/ 92259:
795
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
796
-
797
- /**
798
- * Detect Electron renderer / nwjs process, which is node, but we should
799
- * treat as a browser.
800
- */
801
-
802
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
803
- module.exports = __webpack_require__(35535);
804
- } else {
805
- module.exports = __webpack_require__(66862);
806
- }
807
-
808
-
809
- /***/ }),
810
-
811
- /***/ 66862:
812
- /***/ ((module, exports, __webpack_require__) => {
813
-
814
- /**
815
- * Module dependencies.
816
- */
817
-
818
- const tty = __webpack_require__(76224);
819
- const util = __webpack_require__(73837);
820
-
821
- /**
822
- * This is the Node.js implementation of `debug()`.
823
- */
824
-
825
- exports.init = init;
826
- exports.log = log;
827
- exports.formatArgs = formatArgs;
828
- exports.save = save;
829
- exports.load = load;
830
- exports.useColors = useColors;
831
- exports.destroy = util.deprecate(
832
- () => {},
833
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
834
- );
835
-
836
- /**
837
- * Colors.
838
- */
839
-
840
- exports.colors = [6, 2, 3, 4, 5, 1];
841
-
842
- try {
843
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
844
- // eslint-disable-next-line import/no-extraneous-dependencies
845
- const supportsColor = __webpack_require__(92130);
846
-
847
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
848
- exports.colors = [
849
- 20,
850
- 21,
851
- 26,
852
- 27,
853
- 32,
854
- 33,
855
- 38,
856
- 39,
857
- 40,
858
- 41,
859
- 42,
860
- 43,
861
- 44,
862
- 45,
863
- 56,
864
- 57,
865
- 62,
866
- 63,
867
- 68,
868
- 69,
869
- 74,
870
- 75,
871
- 76,
872
- 77,
873
- 78,
874
- 79,
875
- 80,
876
- 81,
877
- 92,
878
- 93,
879
- 98,
880
- 99,
881
- 112,
882
- 113,
883
- 128,
884
- 129,
885
- 134,
886
- 135,
887
- 148,
888
- 149,
889
- 160,
890
- 161,
891
- 162,
892
- 163,
893
- 164,
894
- 165,
895
- 166,
896
- 167,
897
- 168,
898
- 169,
899
- 170,
900
- 171,
901
- 172,
902
- 173,
903
- 178,
904
- 179,
905
- 184,
906
- 185,
907
- 196,
908
- 197,
909
- 198,
910
- 199,
911
- 200,
912
- 201,
913
- 202,
914
- 203,
915
- 204,
916
- 205,
917
- 206,
918
- 207,
919
- 208,
920
- 209,
921
- 214,
922
- 215,
923
- 220,
924
- 221
925
- ];
926
- }
927
- } catch (error) {
928
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
929
- }
930
-
931
- /**
932
- * Build up the default `inspectOpts` object from the environment variables.
933
- *
934
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
935
- */
936
-
937
- exports.inspectOpts = Object.keys(process.env).filter(key => {
938
- return /^debug_/i.test(key);
939
- }).reduce((obj, key) => {
940
- // Camel-case
941
- const prop = key
942
- .substring(6)
943
- .toLowerCase()
944
- .replace(/_([a-z])/g, (_, k) => {
945
- return k.toUpperCase();
946
- });
947
-
948
- // Coerce string value into JS value
949
- let val = process.env[key];
950
- if (/^(yes|on|true|enabled)$/i.test(val)) {
951
- val = true;
952
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
953
- val = false;
954
- } else if (val === 'null') {
955
- val = null;
956
- } else {
957
- val = Number(val);
958
- }
959
-
960
- obj[prop] = val;
961
- return obj;
962
- }, {});
963
-
964
- /**
965
- * Is stdout a TTY? Colored output is enabled when `true`.
966
- */
967
-
968
- function useColors() {
969
- return 'colors' in exports.inspectOpts ?
970
- Boolean(exports.inspectOpts.colors) :
971
- tty.isatty(process.stderr.fd);
972
- }
973
-
974
- /**
975
- * Adds ANSI color escape codes if enabled.
976
- *
977
- * @api public
978
- */
979
-
980
- function formatArgs(args) {
981
- const {namespace: name, useColors} = this;
982
-
983
- if (useColors) {
984
- const c = this.color;
985
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
986
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
987
-
988
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
989
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
990
- } else {
991
- args[0] = getDate() + name + ' ' + args[0];
992
- }
993
- }
994
-
995
- function getDate() {
996
- if (exports.inspectOpts.hideDate) {
997
- return '';
998
- }
999
- return new Date().toISOString() + ' ';
1000
- }
1001
-
1002
- /**
1003
- * Invokes `util.format()` with the specified arguments and writes to stderr.
1004
- */
1005
-
1006
- function log(...args) {
1007
- return process.stderr.write(util.format(...args) + '\n');
1008
- }
1009
-
1010
- /**
1011
- * Save `namespaces`.
1012
- *
1013
- * @param {String} namespaces
1014
- * @api private
1015
- */
1016
- function save(namespaces) {
1017
- if (namespaces) {
1018
- process.env.DEBUG = namespaces;
1019
- } else {
1020
- // If you set a process.env field to null or undefined, it gets cast to the
1021
- // string 'null' or 'undefined'. Just delete instead.
1022
- delete process.env.DEBUG;
1023
- }
1024
- }
1025
-
1026
- /**
1027
- * Load `namespaces`.
1028
- *
1029
- * @return {String} returns the previously persisted debug modes
1030
- * @api private
1031
- */
1032
-
1033
- function load() {
1034
- return process.env.DEBUG;
1035
- }
1036
-
1037
- /**
1038
- * Init logic for `debug` instances.
1039
- *
1040
- * Create a new `inspectOpts` object in case `useColors` is set
1041
- * differently for a particular `debug` instance.
1042
- */
1043
-
1044
- function init(debug) {
1045
- debug.inspectOpts = {};
1046
-
1047
- const keys = Object.keys(exports.inspectOpts);
1048
- for (let i = 0; i < keys.length; i++) {
1049
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
1050
- }
1051
- }
1052
-
1053
- module.exports = __webpack_require__(97977)(exports);
1054
-
1055
- const {formatters} = module.exports;
1056
-
1057
- /**
1058
- * Map %o to `util.inspect()`, all on a single line.
1059
- */
1060
-
1061
- formatters.o = function (v) {
1062
- this.inspectOpts.colors = this.useColors;
1063
- return util.inspect(v, this.inspectOpts)
1064
- .split('\n')
1065
- .map(str => str.trim())
1066
- .join(' ');
1067
- };
1068
-
1069
- /**
1070
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
1071
- */
1072
-
1073
- formatters.O = function (v) {
1074
- this.inspectOpts.colors = this.useColors;
1075
- return util.inspect(v, this.inspectOpts);
1076
- };
1077
-
1078
-
1079
265
  /***/ }),
1080
266
 
1081
267
  /***/ 42925:
@@ -1104,7 +290,7 @@ exports.extractPoetryVersion = extractPoetryVersion;
1104
290
  async function isPoetryInstalled() {
1105
291
  let res;
1106
292
  try {
1107
- res = await child_process_1.execute('poetry', ['--version'], {});
293
+ res = await (0, child_process_1.execute)('poetry', ['--version'], {});
1108
294
  }
1109
295
  catch (e) {
1110
296
  debug('Execute failed with', e);
@@ -1126,6 +312,7 @@ exports.isPoetryInstalled = isPoetryInstalled;
1126
312
  "use strict";
1127
313
 
1128
314
  Object.defineProperty(exports, "__esModule", ({ value: true }));
315
+ exports.poetryAdd = exports.isPoetrySupportedVersion = exports.isPoetryInstalled = void 0;
1129
316
  var check_poetry_is_installed_1 = __webpack_require__(42925);
1130
317
  Object.defineProperty(exports, "isPoetryInstalled", ({ enumerable: true, get: function () { return check_poetry_is_installed_1.isPoetryInstalled; } }));
1131
318
  var is_poetry_supported_version_1 = __webpack_require__(29257);
@@ -1180,8 +367,8 @@ exports.isPoetrySupportedVersion = isPoetrySupportedVersion;
1180
367
 
1181
368
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1182
369
  exports.poetryAdd = void 0;
1183
- const debugLib = __webpack_require__(15158);
1184
370
  const bottleneck_1 = __webpack_require__(35861);
371
+ const debugLib = __webpack_require__(15158);
1185
372
  const child_process_1 = __webpack_require__(74262);
1186
373
  const debug = debugLib('snyk-fix:poetry');
1187
374
  const limiter = new bottleneck_1.default({
@@ -1197,7 +384,7 @@ async function runPoetryAdd(projectPath, dependencyUpdates, config) {
1197
384
  try {
1198
385
  // tell poetry to use the given interpreter
1199
386
  // https://python-poetry.org/docs/managing-environments/
1200
- await child_process_1.execute('poetry', ['env', 'use', config.python], {
387
+ await (0, child_process_1.execute)('poetry', ['env', 'use', config.python], {
1201
388
  cwd: projectPath,
1202
389
  });
1203
390
  }
@@ -1206,7 +393,7 @@ async function runPoetryAdd(projectPath, dependencyUpdates, config) {
1206
393
  }
1207
394
  }
1208
395
  try {
1209
- res = await child_process_1.execute('poetry', args, {
396
+ res = await (0, child_process_1.execute)('poetry', args, {
1210
397
  cwd: projectPath,
1211
398
  });
1212
399
  }
@@ -1217,7 +404,7 @@ async function runPoetryAdd(projectPath, dependencyUpdates, config) {
1217
404
  if (config.python) {
1218
405
  try {
1219
406
  // set it back to system python
1220
- await child_process_1.execute('poetry', ['env', 'use', 'system'], {
407
+ await (0, child_process_1.execute)('poetry', ['env', 'use', 'system'], {
1221
408
  cwd: projectPath,
1222
409
  });
1223
410
  }