@digipair/skill-git 0.22.2 → 0.23.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.cjs.js +192 -999
  2. package/index.esm.js +188 -996
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -3,28 +3,30 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var require$$0$1 = require('fs');
6
- var require$$0 = require('tty');
7
- var require$$1 = require('util');
6
+ var require$$1 = require('tty');
7
+ var require$$1$1 = require('util');
8
+ var require$$0 = require('os');
8
9
  var child_process = require('child_process');
9
10
  var node_events = require('node:events');
10
11
 
11
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
13
 
13
14
  var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
14
- var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
15
15
  var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
16
+ var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
17
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
16
18
 
17
19
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
18
20
 
19
21
  var dist$1 = {};
20
22
 
21
- var src$2 = {};
23
+ var src$1 = {};
22
24
 
23
- var src$1 = {
25
+ var src = {
24
26
  exports: {}
25
27
  };
26
28
 
27
- var browser$2 = {
29
+ var browser = {
28
30
  exports: {}
29
31
  };
30
32
 
@@ -32,16 +34,16 @@ var browser$2 = {
32
34
  * Helpers.
33
35
  */
34
36
 
35
- function _type_of$2(obj) {
37
+ function _type_of$1(obj) {
36
38
  "@swc/helpers - typeof";
37
39
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
38
40
  }
39
- var s$1 = 1000;
40
- var m$1 = s$1 * 60;
41
- var h$1 = m$1 * 60;
42
- var d$1 = h$1 * 24;
43
- var w$1 = d$1 * 7;
44
- var y$1 = d$1 * 365.25;
41
+ var s = 1000;
42
+ var m = s * 60;
43
+ var h = m * 60;
44
+ var d = h * 24;
45
+ var w = d * 7;
46
+ var y = d * 365.25;
45
47
  /**
46
48
  * Parse or format the given `val`.
47
49
  *
@@ -54,13 +56,13 @@ var y$1 = d$1 * 365.25;
54
56
  * @throws {Error} throw an error if val is not a non-empty string or a number
55
57
  * @return {String|Number}
56
58
  * @api public
57
- */ var ms$1 = function(val, options) {
59
+ */ var ms = function(val, options) {
58
60
  options = options || {};
59
- var type = typeof val === "undefined" ? "undefined" : _type_of$2(val);
61
+ var type = typeof val === "undefined" ? "undefined" : _type_of$1(val);
60
62
  if (type === "string" && val.length > 0) {
61
- return parse$1(val);
63
+ return parse(val);
62
64
  } else if (type === "number" && isFinite(val)) {
63
- return options.long ? fmtLong$1(val) : fmtShort$1(val);
65
+ return options.long ? fmtLong(val) : fmtShort(val);
64
66
  }
65
67
  throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
66
68
  };
@@ -70,7 +72,7 @@ var y$1 = d$1 * 365.25;
70
72
  * @param {String} str
71
73
  * @return {Number}
72
74
  * @api private
73
- */ function parse$1(str) {
75
+ */ function parse(str) {
74
76
  str = String(str);
75
77
  if (str.length > 100) {
76
78
  return;
@@ -87,33 +89,33 @@ var y$1 = d$1 * 365.25;
87
89
  case "yrs":
88
90
  case "yr":
89
91
  case "y":
90
- return n * y$1;
92
+ return n * y;
91
93
  case "weeks":
92
94
  case "week":
93
95
  case "w":
94
- return n * w$1;
96
+ return n * w;
95
97
  case "days":
96
98
  case "day":
97
99
  case "d":
98
- return n * d$1;
100
+ return n * d;
99
101
  case "hours":
100
102
  case "hour":
101
103
  case "hrs":
102
104
  case "hr":
103
105
  case "h":
104
- return n * h$1;
106
+ return n * h;
105
107
  case "minutes":
106
108
  case "minute":
107
109
  case "mins":
108
110
  case "min":
109
111
  case "m":
110
- return n * m$1;
112
+ return n * m;
111
113
  case "seconds":
112
114
  case "second":
113
115
  case "secs":
114
116
  case "sec":
115
117
  case "s":
116
- return n * s$1;
118
+ return n * s;
117
119
  case "milliseconds":
118
120
  case "millisecond":
119
121
  case "msecs":
@@ -130,19 +132,19 @@ var y$1 = d$1 * 365.25;
130
132
  * @param {Number} ms
131
133
  * @return {String}
132
134
  * @api private
133
- */ function fmtShort$1(ms) {
135
+ */ function fmtShort(ms) {
134
136
  var msAbs = Math.abs(ms);
135
- if (msAbs >= d$1) {
136
- return Math.round(ms / d$1) + "d";
137
+ if (msAbs >= d) {
138
+ return Math.round(ms / d) + "d";
137
139
  }
138
- if (msAbs >= h$1) {
139
- return Math.round(ms / h$1) + "h";
140
+ if (msAbs >= h) {
141
+ return Math.round(ms / h) + "h";
140
142
  }
141
- if (msAbs >= m$1) {
142
- return Math.round(ms / m$1) + "m";
143
+ if (msAbs >= m) {
144
+ return Math.round(ms / m) + "m";
143
145
  }
144
- if (msAbs >= s$1) {
145
- return Math.round(ms / s$1) + "s";
146
+ if (msAbs >= s) {
147
+ return Math.round(ms / s) + "s";
146
148
  }
147
149
  return ms + "ms";
148
150
  }
@@ -152,25 +154,25 @@ var y$1 = d$1 * 365.25;
152
154
  * @param {Number} ms
153
155
  * @return {String}
154
156
  * @api private
155
- */ function fmtLong$1(ms) {
157
+ */ function fmtLong(ms) {
156
158
  var msAbs = Math.abs(ms);
157
- if (msAbs >= d$1) {
158
- return plural$1(ms, msAbs, d$1, "day");
159
+ if (msAbs >= d) {
160
+ return plural(ms, msAbs, d, "day");
159
161
  }
160
- if (msAbs >= h$1) {
161
- return plural$1(ms, msAbs, h$1, "hour");
162
+ if (msAbs >= h) {
163
+ return plural(ms, msAbs, h, "hour");
162
164
  }
163
- if (msAbs >= m$1) {
164
- return plural$1(ms, msAbs, m$1, "minute");
165
+ if (msAbs >= m) {
166
+ return plural(ms, msAbs, m, "minute");
165
167
  }
166
- if (msAbs >= s$1) {
167
- return plural$1(ms, msAbs, s$1, "second");
168
+ if (msAbs >= s) {
169
+ return plural(ms, msAbs, s, "second");
168
170
  }
169
171
  return ms + " ms";
170
172
  }
171
173
  /**
172
174
  * Pluralization helper.
173
- */ function plural$1(ms, msAbs, n, name) {
175
+ */ function plural(ms, msAbs, n, name) {
174
176
  var isPlural = msAbs >= n * 1.5;
175
177
  return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
176
178
  }
@@ -180,46 +182,46 @@ var y$1 = d$1 * 365.25;
180
182
  * implementations of `debug()`.
181
183
  */
182
184
 
183
- function _array_like_to_array$2(arr, len) {
185
+ function _array_like_to_array$1(arr, len) {
184
186
  if (len == null || len > arr.length) len = arr.length;
185
187
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
186
188
  return arr2;
187
189
  }
188
- function _array_without_holes$2(arr) {
189
- if (Array.isArray(arr)) return _array_like_to_array$2(arr);
190
+ function _array_without_holes$1(arr) {
191
+ if (Array.isArray(arr)) return _array_like_to_array$1(arr);
190
192
  }
191
- function _instanceof$2(left, right) {
193
+ function _instanceof$1(left, right) {
192
194
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
193
195
  return !!right[Symbol.hasInstance](left);
194
196
  } else {
195
197
  return left instanceof right;
196
198
  }
197
199
  }
198
- function _iterable_to_array$2(iter) {
200
+ function _iterable_to_array$1(iter) {
199
201
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
200
202
  }
201
- function _non_iterable_spread$2() {
203
+ function _non_iterable_spread$1() {
202
204
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
203
205
  }
204
- function _to_consumable_array$2(arr) {
205
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
206
+ function _to_consumable_array$1(arr) {
207
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
206
208
  }
207
- function _unsupported_iterable_to_array$2(o, minLen) {
209
+ function _unsupported_iterable_to_array$1(o, minLen) {
208
210
  if (!o) return;
209
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
211
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
210
212
  var n = Object.prototype.toString.call(o).slice(8, -1);
211
213
  if (n === "Object" && o.constructor) n = o.constructor.name;
212
214
  if (n === "Map" || n === "Set") return Array.from(n);
213
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
215
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
214
216
  }
215
- function setup$1(env) {
217
+ function setup(env) {
216
218
  createDebug.debug = createDebug;
217
219
  createDebug.default = createDebug;
218
220
  createDebug.coerce = coerce;
219
221
  createDebug.disable = disable;
220
222
  createDebug.enable = enable;
221
223
  createDebug.enabled = enabled;
222
- createDebug.humanize = ms$1;
224
+ createDebug.humanize = ms;
223
225
  createDebug.destroy = destroy;
224
226
  Object.keys(env).forEach(function(key) {
225
227
  createDebug[key] = env[key];
@@ -367,7 +369,7 @@ function setup$1(env) {
367
369
  * @return {String} namespaces
368
370
  * @api public
369
371
  */ function disable() {
370
- var namespaces = _to_consumable_array$2(createDebug.names.map(toNamespace)).concat(_to_consumable_array$2(createDebug.skips.map(toNamespace).map(function(namespace) {
372
+ var namespaces = _to_consumable_array$1(createDebug.names.map(toNamespace)).concat(_to_consumable_array$1(createDebug.skips.map(toNamespace).map(function(namespace) {
371
373
  return "-" + namespace;
372
374
  }))).join(",");
373
375
  createDebug.enable("");
@@ -413,7 +415,7 @@ function setup$1(env) {
413
415
  * @return {Mixed}
414
416
  * @api private
415
417
  */ function coerce(val) {
416
- if (_instanceof$2(val, Error)) {
418
+ if (_instanceof$1(val, Error)) {
417
419
  return val.stack || val.message;
418
420
  }
419
421
  return val;
@@ -427,7 +429,7 @@ function setup$1(env) {
427
429
  createDebug.enable(createDebug.load());
428
430
  return createDebug;
429
431
  }
430
- var common$1 = setup$1;
432
+ var common = setup;
431
433
 
432
434
  /* eslint-env browser */
433
435
 
@@ -646,7 +648,7 @@ function useColors() {
646
648
  // XXX (@Qix-) should we be logging these?
647
649
  }
648
650
  }
649
- module.exports = common$1(exports);
651
+ module.exports = common(exports);
650
652
  var formatters = module.exports.formatters;
651
653
  /**
652
654
  * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
@@ -657,29 +659,125 @@ var formatters = module.exports.formatters;
657
659
  return "[UnexpectedJSONParseError]: " + error.message;
658
660
  }
659
661
  };
660
- }(browser$2, browser$2.exports));
662
+ }(browser, browser.exports));
661
663
 
662
- var node$1 = {
664
+ var node = {
663
665
  exports: {}
664
666
  };
665
667
 
666
- /* eslint-env browser */
667
- function getChromeVersion() {
668
- var matches = RegExp("(Chrome|Chromium)\\/(?<chromeVersion>\\d+)\\.").exec(navigator.userAgent);
669
- if (!matches) {
670
- return;
668
+ var hasFlag$1 = function(flag) {
669
+ var argv = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.argv;
670
+ var prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
671
+ var position = argv.indexOf(prefix + flag);
672
+ var terminatorPosition = argv.indexOf("--");
673
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
674
+ };
675
+
676
+ var os = require$$0__default["default"];
677
+ var tty = require$$1__default["default"];
678
+ var hasFlag = hasFlag$1;
679
+ var env = process.env;
680
+ var forceColor;
681
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
682
+ forceColor = 0;
683
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
684
+ forceColor = 1;
685
+ }
686
+ if ("FORCE_COLOR" in env) {
687
+ if (env.FORCE_COLOR === "true") {
688
+ forceColor = 1;
689
+ } else if (env.FORCE_COLOR === "false") {
690
+ forceColor = 0;
691
+ } else {
692
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
693
+ }
694
+ }
695
+ function translateLevel(level) {
696
+ if (level === 0) {
697
+ return false;
698
+ }
699
+ return {
700
+ level: level,
701
+ hasBasic: true,
702
+ has256: level >= 2,
703
+ has16m: level >= 3
704
+ };
705
+ }
706
+ function supportsColor(haveStream, streamIsTTY) {
707
+ if (forceColor === 0) {
708
+ return 0;
709
+ }
710
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
711
+ return 3;
712
+ }
713
+ if (hasFlag("color=256")) {
714
+ return 2;
715
+ }
716
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
717
+ return 0;
718
+ }
719
+ var min = forceColor || 0;
720
+ if (env.TERM === "dumb") {
721
+ return min;
722
+ }
723
+ if (process.platform === "win32") {
724
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
725
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
726
+ var osRelease = os.release().split(".");
727
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
728
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
729
+ }
730
+ return 1;
731
+ }
732
+ if ("CI" in env) {
733
+ if ([
734
+ "TRAVIS",
735
+ "CIRCLECI",
736
+ "APPVEYOR",
737
+ "GITLAB_CI",
738
+ "GITHUB_ACTIONS",
739
+ "BUILDKITE"
740
+ ].some(function(sign) {
741
+ return sign in env;
742
+ }) || env.CI_NAME === "codeship") {
743
+ return 1;
744
+ }
745
+ return min;
746
+ }
747
+ if ("TEAMCITY_VERSION" in env) {
748
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
671
749
  }
672
- return Number.parseInt(matches.groups.chromeVersion, 10);
673
- }
674
- var colorSupport = getChromeVersion() >= 69 ? {
675
- level: 1,
676
- hasBasic: true,
677
- has256: false,
678
- has16m: false
679
- } : false;
680
- var browser$1 = {
681
- stdout: colorSupport,
682
- stderr: colorSupport
750
+ if (env.COLORTERM === "truecolor") {
751
+ return 3;
752
+ }
753
+ if ("TERM_PROGRAM" in env) {
754
+ var version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
755
+ switch(env.TERM_PROGRAM){
756
+ case "iTerm.app":
757
+ return version >= 3 ? 3 : 2;
758
+ case "Apple_Terminal":
759
+ return 2;
760
+ }
761
+ }
762
+ if (/-256(color)?$/i.test(env.TERM)) {
763
+ return 2;
764
+ }
765
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
766
+ return 1;
767
+ }
768
+ if ("COLORTERM" in env) {
769
+ return 1;
770
+ }
771
+ return min;
772
+ }
773
+ function getSupportLevel(stream) {
774
+ var level = supportsColor(stream, stream && stream.isTTY);
775
+ return translateLevel(level);
776
+ }
777
+ var supportsColor_1 = {
778
+ supportsColor: getSupportLevel,
779
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
780
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
683
781
  };
684
782
 
685
783
  /**
@@ -712,8 +810,8 @@ function _unsupported_iterable_to_array(o, minLen) {
712
810
  if (n === "Map" || n === "Set") return Array.from(n);
713
811
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
714
812
  }
715
- var tty = require$$0__default["default"];
716
- var util = require$$1__default["default"];
813
+ var tty = require$$1__default["default"];
814
+ var util = require$$1__default$1["default"];
717
815
  /**
718
816
  * This is the Node.js implementation of `debug()`.
719
817
  */ exports.init = init;
@@ -736,7 +834,7 @@ exports.destroy = util.deprecate(function() {}, "Instance method `debug.destroy(
736
834
  try {
737
835
  // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
738
836
  // eslint-disable-next-line import/no-extraneous-dependencies
739
- var supportsColor = browser$1;
837
+ var supportsColor = supportsColor_1;
740
838
  if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
741
839
  exports.colors = [
742
840
  20,
@@ -873,13 +971,15 @@ function getDate() {
873
971
  return new Date().toISOString() + " ";
874
972
  }
875
973
  /**
876
- * Invokes `util.format()` with the specified arguments and writes to stderr.
974
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
877
975
  */ function log() {
878
976
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
879
977
  args[_key] = arguments[_key];
880
978
  }
881
979
  var _util;
882
- return process.stderr.write((_util = util).format.apply(_util, _to_consumable_array(args)) + "\n");
980
+ return process.stderr.write((_util = util).formatWithOptions.apply(_util, [
981
+ exports.inspectOpts
982
+ ].concat(_to_consumable_array(args))) + "\n");
883
983
  }
884
984
  /**
885
985
  * Save `namespaces`.
@@ -915,7 +1015,7 @@ function getDate() {
915
1015
  debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
916
1016
  }
917
1017
  }
918
- module.exports = common$1(exports);
1018
+ module.exports = common(exports);
919
1019
  var formatters = module.exports.formatters;
920
1020
  /**
921
1021
  * Map %o to `util.inspect()`, all on a single line.
@@ -931,7 +1031,7 @@ var formatters = module.exports.formatters;
931
1031
  this.inspectOpts.colors = this.useColors;
932
1032
  return util.inspect(v, this.inspectOpts);
933
1033
  };
934
- }(node$1, node$1.exports));
1034
+ }(node, node.exports));
935
1035
 
936
1036
  /**
937
1037
  * Detect Electron renderer / nwjs process, which is node, but we should
@@ -939,11 +1039,13 @@ var formatters = module.exports.formatters;
939
1039
  */
940
1040
 
941
1041
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
942
- src$1.exports = browser$2.exports;
1042
+ src.exports = browser.exports;
943
1043
  } else {
944
- src$1.exports = node$1.exports;
1044
+ src.exports = node.exports;
945
1045
  }
946
1046
 
1047
+ var debug = src.exports;
1048
+
947
1049
  (function (exports) {
948
1050
  var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
949
1051
  return mod && mod.__esModule ? mod : {
@@ -954,7 +1056,7 @@ Object.defineProperty(exports, "__esModule", {
954
1056
  value: true
955
1057
  });
956
1058
  var fs_1 = require$$0__default$1["default"];
957
- var debug_1 = __importDefault(src$1.exports);
1059
+ var debug_1 = __importDefault(src.exports);
958
1060
  var log = debug_1.default("@kwsites/file-exists");
959
1061
  function check(path, isFile, isDirectory) {
960
1062
  log("checking %s", path);
@@ -998,7 +1100,7 @@ exports.exists = exists;
998
1100
  /**
999
1101
  * Constant representing either a file or a folder
1000
1102
  */ exports.READABLE = exports.FILE + exports.FOLDER;
1001
- }(src$2));
1103
+ }(src$1));
1002
1104
 
1003
1105
  (function (exports) {
1004
1106
  function __export(m) {
@@ -1007,918 +1109,9 @@ function __export(m) {
1007
1109
  Object.defineProperty(exports, "__esModule", {
1008
1110
  value: true
1009
1111
  });
1010
- __export(src$2);
1112
+ __export(src$1);
1011
1113
  }(dist$1));
1012
1114
 
1013
- var src = {
1014
- exports: {}
1015
- };
1016
-
1017
- var browser = {
1018
- exports: {}
1019
- };
1020
-
1021
- /**
1022
- * Helpers.
1023
- */
1024
-
1025
- function _type_of$1(obj) {
1026
- "@swc/helpers - typeof";
1027
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1028
- }
1029
- var s = 1000;
1030
- var m = s * 60;
1031
- var h = m * 60;
1032
- var d = h * 24;
1033
- var w = d * 7;
1034
- var y = d * 365.25;
1035
- /**
1036
- * Parse or format the given `val`.
1037
- *
1038
- * Options:
1039
- *
1040
- * - `long` verbose formatting [false]
1041
- *
1042
- * @param {String|Number} val
1043
- * @param {Object} [options]
1044
- * @throws {Error} throw an error if val is not a non-empty string or a number
1045
- * @return {String|Number}
1046
- * @api public
1047
- */ var ms = function(val, options) {
1048
- options = options || {};
1049
- var type = typeof val === "undefined" ? "undefined" : _type_of$1(val);
1050
- if (type === "string" && val.length > 0) {
1051
- return parse(val);
1052
- } else if (type === "number" && isFinite(val)) {
1053
- return options.long ? fmtLong(val) : fmtShort(val);
1054
- }
1055
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
1056
- };
1057
- /**
1058
- * Parse the given `str` and return milliseconds.
1059
- *
1060
- * @param {String} str
1061
- * @return {Number}
1062
- * @api private
1063
- */ function parse(str) {
1064
- str = String(str);
1065
- if (str.length > 100) {
1066
- return;
1067
- }
1068
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
1069
- if (!match) {
1070
- return;
1071
- }
1072
- var n = parseFloat(match[1]);
1073
- var type = (match[2] || "ms").toLowerCase();
1074
- switch(type){
1075
- case "years":
1076
- case "year":
1077
- case "yrs":
1078
- case "yr":
1079
- case "y":
1080
- return n * y;
1081
- case "weeks":
1082
- case "week":
1083
- case "w":
1084
- return n * w;
1085
- case "days":
1086
- case "day":
1087
- case "d":
1088
- return n * d;
1089
- case "hours":
1090
- case "hour":
1091
- case "hrs":
1092
- case "hr":
1093
- case "h":
1094
- return n * h;
1095
- case "minutes":
1096
- case "minute":
1097
- case "mins":
1098
- case "min":
1099
- case "m":
1100
- return n * m;
1101
- case "seconds":
1102
- case "second":
1103
- case "secs":
1104
- case "sec":
1105
- case "s":
1106
- return n * s;
1107
- case "milliseconds":
1108
- case "millisecond":
1109
- case "msecs":
1110
- case "msec":
1111
- case "ms":
1112
- return n;
1113
- default:
1114
- return undefined;
1115
- }
1116
- }
1117
- /**
1118
- * Short format for `ms`.
1119
- *
1120
- * @param {Number} ms
1121
- * @return {String}
1122
- * @api private
1123
- */ function fmtShort(ms) {
1124
- var msAbs = Math.abs(ms);
1125
- if (msAbs >= d) {
1126
- return Math.round(ms / d) + "d";
1127
- }
1128
- if (msAbs >= h) {
1129
- return Math.round(ms / h) + "h";
1130
- }
1131
- if (msAbs >= m) {
1132
- return Math.round(ms / m) + "m";
1133
- }
1134
- if (msAbs >= s) {
1135
- return Math.round(ms / s) + "s";
1136
- }
1137
- return ms + "ms";
1138
- }
1139
- /**
1140
- * Long format for `ms`.
1141
- *
1142
- * @param {Number} ms
1143
- * @return {String}
1144
- * @api private
1145
- */ function fmtLong(ms) {
1146
- var msAbs = Math.abs(ms);
1147
- if (msAbs >= d) {
1148
- return plural(ms, msAbs, d, "day");
1149
- }
1150
- if (msAbs >= h) {
1151
- return plural(ms, msAbs, h, "hour");
1152
- }
1153
- if (msAbs >= m) {
1154
- return plural(ms, msAbs, m, "minute");
1155
- }
1156
- if (msAbs >= s) {
1157
- return plural(ms, msAbs, s, "second");
1158
- }
1159
- return ms + " ms";
1160
- }
1161
- /**
1162
- * Pluralization helper.
1163
- */ function plural(ms, msAbs, n, name) {
1164
- var isPlural = msAbs >= n * 1.5;
1165
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
1166
- }
1167
-
1168
- /**
1169
- * This is the common logic for both the Node.js and web browser
1170
- * implementations of `debug()`.
1171
- */
1172
-
1173
- function _array_like_to_array$1(arr, len) {
1174
- if (len == null || len > arr.length) len = arr.length;
1175
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1176
- return arr2;
1177
- }
1178
- function _array_without_holes$1(arr) {
1179
- if (Array.isArray(arr)) return _array_like_to_array$1(arr);
1180
- }
1181
- function _instanceof$1(left, right) {
1182
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1183
- return !!right[Symbol.hasInstance](left);
1184
- } else {
1185
- return left instanceof right;
1186
- }
1187
- }
1188
- function _iterable_to_array$1(iter) {
1189
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1190
- }
1191
- function _non_iterable_spread$1() {
1192
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1193
- }
1194
- function _to_consumable_array$1(arr) {
1195
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
1196
- }
1197
- function _unsupported_iterable_to_array$1(o, minLen) {
1198
- if (!o) return;
1199
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
1200
- var n = Object.prototype.toString.call(o).slice(8, -1);
1201
- if (n === "Object" && o.constructor) n = o.constructor.name;
1202
- if (n === "Map" || n === "Set") return Array.from(n);
1203
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
1204
- }
1205
- function setup(env) {
1206
- createDebug.debug = createDebug;
1207
- createDebug.default = createDebug;
1208
- createDebug.coerce = coerce;
1209
- createDebug.disable = disable;
1210
- createDebug.enable = enable;
1211
- createDebug.enabled = enabled;
1212
- createDebug.humanize = ms;
1213
- createDebug.destroy = destroy;
1214
- Object.keys(env).forEach(function(key) {
1215
- createDebug[key] = env[key];
1216
- });
1217
- /**
1218
- * The currently active debug mode names, and names to skip.
1219
- */ createDebug.names = [];
1220
- createDebug.skips = [];
1221
- /**
1222
- * Map of special "%n" handling functions, for the debug "format" argument.
1223
- *
1224
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
1225
- */ createDebug.formatters = {};
1226
- /**
1227
- * Selects a color for a debug namespace
1228
- * @param {String} namespace The namespace string for the debug instance to be colored
1229
- * @return {Number|String} An ANSI color code for the given namespace
1230
- * @api private
1231
- */ function selectColor(namespace) {
1232
- var hash = 0;
1233
- for(var i = 0; i < namespace.length; i++){
1234
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
1235
- hash |= 0; // Convert to 32bit integer
1236
- }
1237
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
1238
- }
1239
- createDebug.selectColor = selectColor;
1240
- /**
1241
- * Create a debugger with the given `namespace`.
1242
- *
1243
- * @param {String} namespace
1244
- * @return {Function}
1245
- * @api public
1246
- */ function createDebug(namespace) {
1247
- var prevTime;
1248
- var enableOverride = null;
1249
- var namespacesCache;
1250
- var enabledCache;
1251
- function debug() {
1252
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
1253
- args[_key] = arguments[_key];
1254
- }
1255
- // Disabled?
1256
- if (!debug.enabled) {
1257
- return;
1258
- }
1259
- var self = debug;
1260
- // Set `diff` timestamp
1261
- var curr = Number(new Date());
1262
- var ms = curr - (prevTime || curr);
1263
- self.diff = ms;
1264
- self.prev = prevTime;
1265
- self.curr = curr;
1266
- prevTime = curr;
1267
- args[0] = createDebug.coerce(args[0]);
1268
- if (typeof args[0] !== "string") {
1269
- // Anything else let's inspect with %O
1270
- args.unshift("%O");
1271
- }
1272
- // Apply any `formatters` transformations
1273
- var index = 0;
1274
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
1275
- // If we encounter an escaped % then don't increase the array index
1276
- if (match === "%%") {
1277
- return "%";
1278
- }
1279
- index++;
1280
- var formatter = createDebug.formatters[format];
1281
- if (typeof formatter === "function") {
1282
- var val = args[index];
1283
- match = formatter.call(self, val);
1284
- // Now we need to remove `args[index]` since it's inlined in the `format`
1285
- args.splice(index, 1);
1286
- index--;
1287
- }
1288
- return match;
1289
- });
1290
- // Apply env-specific formatting (colors, etc.)
1291
- createDebug.formatArgs.call(self, args);
1292
- var logFn = self.log || createDebug.log;
1293
- logFn.apply(self, args);
1294
- }
1295
- debug.namespace = namespace;
1296
- debug.useColors = createDebug.useColors();
1297
- debug.color = createDebug.selectColor(namespace);
1298
- debug.extend = extend;
1299
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
1300
- Object.defineProperty(debug, "enabled", {
1301
- enumerable: true,
1302
- configurable: false,
1303
- get: function() {
1304
- if (enableOverride !== null) {
1305
- return enableOverride;
1306
- }
1307
- if (namespacesCache !== createDebug.namespaces) {
1308
- namespacesCache = createDebug.namespaces;
1309
- enabledCache = createDebug.enabled(namespace);
1310
- }
1311
- return enabledCache;
1312
- },
1313
- set: function(v) {
1314
- enableOverride = v;
1315
- }
1316
- });
1317
- // Env-specific initialization logic for debug instances
1318
- if (typeof createDebug.init === "function") {
1319
- createDebug.init(debug);
1320
- }
1321
- return debug;
1322
- }
1323
- function extend(namespace, delimiter) {
1324
- var newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
1325
- newDebug.log = this.log;
1326
- return newDebug;
1327
- }
1328
- /**
1329
- * Enables a debug mode by namespaces. This can include modes
1330
- * separated by a colon and wildcards.
1331
- *
1332
- * @param {String} namespaces
1333
- * @api public
1334
- */ function enable(namespaces) {
1335
- createDebug.save(namespaces);
1336
- createDebug.namespaces = namespaces;
1337
- createDebug.names = [];
1338
- createDebug.skips = [];
1339
- var i;
1340
- var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
1341
- var len = split.length;
1342
- for(i = 0; i < len; i++){
1343
- if (!split[i]) {
1344
- continue;
1345
- }
1346
- namespaces = split[i].replace(/\*/g, ".*?");
1347
- if (namespaces[0] === "-") {
1348
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
1349
- } else {
1350
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
1351
- }
1352
- }
1353
- }
1354
- /**
1355
- * Disable debug output.
1356
- *
1357
- * @return {String} namespaces
1358
- * @api public
1359
- */ function disable() {
1360
- var namespaces = _to_consumable_array$1(createDebug.names.map(toNamespace)).concat(_to_consumable_array$1(createDebug.skips.map(toNamespace).map(function(namespace) {
1361
- return "-" + namespace;
1362
- }))).join(",");
1363
- createDebug.enable("");
1364
- return namespaces;
1365
- }
1366
- /**
1367
- * Returns true if the given mode name is enabled, false otherwise.
1368
- *
1369
- * @param {String} name
1370
- * @return {Boolean}
1371
- * @api public
1372
- */ function enabled(name) {
1373
- if (name[name.length - 1] === "*") {
1374
- return true;
1375
- }
1376
- var i;
1377
- var len;
1378
- for(i = 0, len = createDebug.skips.length; i < len; i++){
1379
- if (createDebug.skips[i].test(name)) {
1380
- return false;
1381
- }
1382
- }
1383
- for(i = 0, len = createDebug.names.length; i < len; i++){
1384
- if (createDebug.names[i].test(name)) {
1385
- return true;
1386
- }
1387
- }
1388
- return false;
1389
- }
1390
- /**
1391
- * Convert regexp to namespace
1392
- *
1393
- * @param {RegExp} regxep
1394
- * @return {String} namespace
1395
- * @api private
1396
- */ function toNamespace(regexp) {
1397
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
1398
- }
1399
- /**
1400
- * Coerce `val`.
1401
- *
1402
- * @param {Mixed} val
1403
- * @return {Mixed}
1404
- * @api private
1405
- */ function coerce(val) {
1406
- if (_instanceof$1(val, Error)) {
1407
- return val.stack || val.message;
1408
- }
1409
- return val;
1410
- }
1411
- /**
1412
- * XXX DO NOT USE. This is a temporary stub function.
1413
- * XXX It WILL be removed in the next major release.
1414
- */ function destroy() {
1415
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
1416
- }
1417
- createDebug.enable(createDebug.load());
1418
- return createDebug;
1419
- }
1420
- var common = setup;
1421
-
1422
- /* eslint-env browser */
1423
-
1424
- (function (module, exports) {
1425
- /**
1426
- * This is the web browser implementation of `debug()`.
1427
- */ exports.formatArgs = formatArgs;
1428
- exports.save = save;
1429
- exports.load = load;
1430
- exports.useColors = useColors;
1431
- exports.storage = localstorage();
1432
- exports.destroy = function() {
1433
- var warned = false;
1434
- return function() {
1435
- if (!warned) {
1436
- warned = true;
1437
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
1438
- }
1439
- };
1440
- }();
1441
- /**
1442
- * Colors.
1443
- */ exports.colors = [
1444
- "#0000CC",
1445
- "#0000FF",
1446
- "#0033CC",
1447
- "#0033FF",
1448
- "#0066CC",
1449
- "#0066FF",
1450
- "#0099CC",
1451
- "#0099FF",
1452
- "#00CC00",
1453
- "#00CC33",
1454
- "#00CC66",
1455
- "#00CC99",
1456
- "#00CCCC",
1457
- "#00CCFF",
1458
- "#3300CC",
1459
- "#3300FF",
1460
- "#3333CC",
1461
- "#3333FF",
1462
- "#3366CC",
1463
- "#3366FF",
1464
- "#3399CC",
1465
- "#3399FF",
1466
- "#33CC00",
1467
- "#33CC33",
1468
- "#33CC66",
1469
- "#33CC99",
1470
- "#33CCCC",
1471
- "#33CCFF",
1472
- "#6600CC",
1473
- "#6600FF",
1474
- "#6633CC",
1475
- "#6633FF",
1476
- "#66CC00",
1477
- "#66CC33",
1478
- "#9900CC",
1479
- "#9900FF",
1480
- "#9933CC",
1481
- "#9933FF",
1482
- "#99CC00",
1483
- "#99CC33",
1484
- "#CC0000",
1485
- "#CC0033",
1486
- "#CC0066",
1487
- "#CC0099",
1488
- "#CC00CC",
1489
- "#CC00FF",
1490
- "#CC3300",
1491
- "#CC3333",
1492
- "#CC3366",
1493
- "#CC3399",
1494
- "#CC33CC",
1495
- "#CC33FF",
1496
- "#CC6600",
1497
- "#CC6633",
1498
- "#CC9900",
1499
- "#CC9933",
1500
- "#CCCC00",
1501
- "#CCCC33",
1502
- "#FF0000",
1503
- "#FF0033",
1504
- "#FF0066",
1505
- "#FF0099",
1506
- "#FF00CC",
1507
- "#FF00FF",
1508
- "#FF3300",
1509
- "#FF3333",
1510
- "#FF3366",
1511
- "#FF3399",
1512
- "#FF33CC",
1513
- "#FF33FF",
1514
- "#FF6600",
1515
- "#FF6633",
1516
- "#FF9900",
1517
- "#FF9933",
1518
- "#FFCC00",
1519
- "#FFCC33"
1520
- ];
1521
- /**
1522
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
1523
- * and the Firebug extension (any Firefox version) are known
1524
- * to support "%c" CSS customizations.
1525
- *
1526
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
1527
- */ // eslint-disable-next-line complexity
1528
- function useColors() {
1529
- // NB: In an Electron preload script, document will be defined but not fully
1530
- // initialized. Since we know we're in Chrome, we'll just detect this case
1531
- // explicitly
1532
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
1533
- return true;
1534
- }
1535
- // Internet Explorer and Edge do not support colors.
1536
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
1537
- return false;
1538
- }
1539
- // Is webkit? http://stackoverflow.com/a/16459606/376773
1540
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
1541
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
1542
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
1543
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
1544
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
1545
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
1546
- }
1547
- /**
1548
- * Colorize log arguments if enabled.
1549
- *
1550
- * @api public
1551
- */ function formatArgs(args) {
1552
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
1553
- if (!this.useColors) {
1554
- return;
1555
- }
1556
- var c = "color: " + this.color;
1557
- args.splice(1, 0, c, "color: inherit");
1558
- // The final "%c" is somewhat tricky, because there could be other
1559
- // arguments passed either before or after the %c, so we need to
1560
- // figure out the correct index to insert the CSS into
1561
- var index = 0;
1562
- var lastC = 0;
1563
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
1564
- if (match === "%%") {
1565
- return;
1566
- }
1567
- index++;
1568
- if (match === "%c") {
1569
- // We only are interested in the *last* %c
1570
- // (the user may have provided their own)
1571
- lastC = index;
1572
- }
1573
- });
1574
- args.splice(lastC, 0, c);
1575
- }
1576
- /**
1577
- * Invokes `console.debug()` when available.
1578
- * No-op when `console.debug` is not a "function".
1579
- * If `console.debug` is not available, falls back
1580
- * to `console.log`.
1581
- *
1582
- * @api public
1583
- */ exports.log = console.debug || console.log || function() {};
1584
- /**
1585
- * Save `namespaces`.
1586
- *
1587
- * @param {String} namespaces
1588
- * @api private
1589
- */ function save(namespaces) {
1590
- try {
1591
- if (namespaces) {
1592
- exports.storage.setItem("debug", namespaces);
1593
- } else {
1594
- exports.storage.removeItem("debug");
1595
- }
1596
- } catch (error) {
1597
- // Swallow
1598
- // XXX (@Qix-) should we be logging these?
1599
- }
1600
- }
1601
- /**
1602
- * Load `namespaces`.
1603
- *
1604
- * @return {String} returns the previously persisted debug modes
1605
- * @api private
1606
- */ function load() {
1607
- var r;
1608
- try {
1609
- r = exports.storage.getItem("debug");
1610
- } catch (error) {
1611
- // Swallow
1612
- // XXX (@Qix-) should we be logging these?
1613
- }
1614
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
1615
- if (!r && typeof process !== "undefined" && "env" in process) {
1616
- r = process.env.DEBUG;
1617
- }
1618
- return r;
1619
- }
1620
- /**
1621
- * Localstorage attempts to return the localstorage.
1622
- *
1623
- * This is necessary because safari throws
1624
- * when a user disables cookies/localstorage
1625
- * and you attempt to access it.
1626
- *
1627
- * @return {LocalStorage}
1628
- * @api private
1629
- */ function localstorage() {
1630
- try {
1631
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
1632
- // The Browser also has localStorage in the global context.
1633
- return localStorage;
1634
- } catch (error) {
1635
- // Swallow
1636
- // XXX (@Qix-) should we be logging these?
1637
- }
1638
- }
1639
- module.exports = common(exports);
1640
- var formatters = module.exports.formatters;
1641
- /**
1642
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
1643
- */ formatters.j = function(v) {
1644
- try {
1645
- return JSON.stringify(v);
1646
- } catch (error) {
1647
- return "[UnexpectedJSONParseError]: " + error.message;
1648
- }
1649
- };
1650
- }(browser, browser.exports));
1651
-
1652
- var node = {
1653
- exports: {}
1654
- };
1655
-
1656
- /**
1657
- * Module dependencies.
1658
- */
1659
-
1660
- (function (module, exports) {
1661
- function _array_like_to_array(arr, len) {
1662
- if (len == null || len > arr.length) len = arr.length;
1663
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1664
- return arr2;
1665
- }
1666
- function _array_without_holes(arr) {
1667
- if (Array.isArray(arr)) return _array_like_to_array(arr);
1668
- }
1669
- function _iterable_to_array(iter) {
1670
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1671
- }
1672
- function _non_iterable_spread() {
1673
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1674
- }
1675
- function _to_consumable_array(arr) {
1676
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1677
- }
1678
- function _unsupported_iterable_to_array(o, minLen) {
1679
- if (!o) return;
1680
- if (typeof o === "string") return _array_like_to_array(o, minLen);
1681
- var n = Object.prototype.toString.call(o).slice(8, -1);
1682
- if (n === "Object" && o.constructor) n = o.constructor.name;
1683
- if (n === "Map" || n === "Set") return Array.from(n);
1684
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
1685
- }
1686
- var tty = require$$0__default["default"];
1687
- var util = require$$1__default["default"];
1688
- /**
1689
- * This is the Node.js implementation of `debug()`.
1690
- */ exports.init = init;
1691
- exports.log = log;
1692
- exports.formatArgs = formatArgs;
1693
- exports.save = save;
1694
- exports.load = load;
1695
- exports.useColors = useColors;
1696
- exports.destroy = util.deprecate(function() {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
1697
- /**
1698
- * Colors.
1699
- */ exports.colors = [
1700
- 6,
1701
- 2,
1702
- 3,
1703
- 4,
1704
- 5,
1705
- 1
1706
- ];
1707
- try {
1708
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
1709
- // eslint-disable-next-line import/no-extraneous-dependencies
1710
- var supportsColor = browser$1;
1711
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
1712
- exports.colors = [
1713
- 20,
1714
- 21,
1715
- 26,
1716
- 27,
1717
- 32,
1718
- 33,
1719
- 38,
1720
- 39,
1721
- 40,
1722
- 41,
1723
- 42,
1724
- 43,
1725
- 44,
1726
- 45,
1727
- 56,
1728
- 57,
1729
- 62,
1730
- 63,
1731
- 68,
1732
- 69,
1733
- 74,
1734
- 75,
1735
- 76,
1736
- 77,
1737
- 78,
1738
- 79,
1739
- 80,
1740
- 81,
1741
- 92,
1742
- 93,
1743
- 98,
1744
- 99,
1745
- 112,
1746
- 113,
1747
- 128,
1748
- 129,
1749
- 134,
1750
- 135,
1751
- 148,
1752
- 149,
1753
- 160,
1754
- 161,
1755
- 162,
1756
- 163,
1757
- 164,
1758
- 165,
1759
- 166,
1760
- 167,
1761
- 168,
1762
- 169,
1763
- 170,
1764
- 171,
1765
- 172,
1766
- 173,
1767
- 178,
1768
- 179,
1769
- 184,
1770
- 185,
1771
- 196,
1772
- 197,
1773
- 198,
1774
- 199,
1775
- 200,
1776
- 201,
1777
- 202,
1778
- 203,
1779
- 204,
1780
- 205,
1781
- 206,
1782
- 207,
1783
- 208,
1784
- 209,
1785
- 214,
1786
- 215,
1787
- 220,
1788
- 221
1789
- ];
1790
- }
1791
- } catch (error) {
1792
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
1793
- }
1794
- /**
1795
- * Build up the default `inspectOpts` object from the environment variables.
1796
- *
1797
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
1798
- */ exports.inspectOpts = Object.keys(process.env).filter(function(key) {
1799
- return /^debug_/i.test(key);
1800
- }).reduce(function(obj, key) {
1801
- // Camel-case
1802
- var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
1803
- return k.toUpperCase();
1804
- });
1805
- // Coerce string value into JS value
1806
- var val = process.env[key];
1807
- if (/^(yes|on|true|enabled)$/i.test(val)) {
1808
- val = true;
1809
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
1810
- val = false;
1811
- } else if (val === "null") {
1812
- val = null;
1813
- } else {
1814
- val = Number(val);
1815
- }
1816
- obj[prop] = val;
1817
- return obj;
1818
- }, {});
1819
- /**
1820
- * Is stdout a TTY? Colored output is enabled when `true`.
1821
- */ function useColors() {
1822
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
1823
- }
1824
- /**
1825
- * Adds ANSI color escape codes if enabled.
1826
- *
1827
- * @api public
1828
- */ function formatArgs(args) {
1829
- var _this = this, name = _this.namespace, _$useColors = _this.useColors;
1830
- if (_$useColors) {
1831
- var c = this.color;
1832
- var colorCode = "\x1b[3" + (c < 8 ? c : "8;5;" + c);
1833
- var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1b[0m");
1834
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
1835
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1b[0m");
1836
- } else {
1837
- args[0] = getDate() + name + " " + args[0];
1838
- }
1839
- }
1840
- function getDate() {
1841
- if (exports.inspectOpts.hideDate) {
1842
- return "";
1843
- }
1844
- return new Date().toISOString() + " ";
1845
- }
1846
- /**
1847
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
1848
- */ function log() {
1849
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
1850
- args[_key] = arguments[_key];
1851
- }
1852
- var _util;
1853
- return process.stderr.write((_util = util).formatWithOptions.apply(_util, [
1854
- exports.inspectOpts
1855
- ].concat(_to_consumable_array(args))) + "\n");
1856
- }
1857
- /**
1858
- * Save `namespaces`.
1859
- *
1860
- * @param {String} namespaces
1861
- * @api private
1862
- */ function save(namespaces) {
1863
- if (namespaces) {
1864
- process.env.DEBUG = namespaces;
1865
- } else {
1866
- // If you set a process.env field to null or undefined, it gets cast to the
1867
- // string 'null' or 'undefined'. Just delete instead.
1868
- delete process.env.DEBUG;
1869
- }
1870
- }
1871
- /**
1872
- * Load `namespaces`.
1873
- *
1874
- * @return {String} returns the previously persisted debug modes
1875
- * @api private
1876
- */ function load() {
1877
- return process.env.DEBUG;
1878
- }
1879
- /**
1880
- * Init logic for `debug` instances.
1881
- *
1882
- * Create a new `inspectOpts` object in case `useColors` is set
1883
- * differently for a particular `debug` instance.
1884
- */ function init(debug) {
1885
- debug.inspectOpts = {};
1886
- var keys = Object.keys(exports.inspectOpts);
1887
- for(var i = 0; i < keys.length; i++){
1888
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
1889
- }
1890
- }
1891
- module.exports = common(exports);
1892
- var formatters = module.exports.formatters;
1893
- /**
1894
- * Map %o to `util.inspect()`, all on a single line.
1895
- */ formatters.o = function(v) {
1896
- this.inspectOpts.colors = this.useColors;
1897
- return util.inspect(v, this.inspectOpts).split("\n").map(function(str) {
1898
- return str.trim();
1899
- }).join(" ");
1900
- };
1901
- /**
1902
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
1903
- */ formatters.O = function(v) {
1904
- this.inspectOpts.colors = this.useColors;
1905
- return util.inspect(v, this.inspectOpts);
1906
- };
1907
- }(node, node.exports));
1908
-
1909
- /**
1910
- * Detect Electron renderer / nwjs process, which is node, but we should
1911
- * treat as a browser.
1912
- */
1913
-
1914
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
1915
- src.exports = browser.exports;
1916
- } else {
1917
- src.exports = node.exports;
1918
- }
1919
-
1920
- var debug = src.exports;
1921
-
1922
1115
  var dist = {};
1923
1116
 
1924
1117
  Object.defineProperty(dist, "__esModule", {