@digipair/skill-git 0.8.37 → 0.8.40

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.
Files changed (3) hide show
  1. package/index.cjs.js +1180 -220
  2. package/index.esm.js +1177 -217
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -2,25 +2,1111 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var require$$0$1 = require('fs');
6
- var require$$1 = require('tty');
7
- var require$$1$1 = require('util');
8
- var require$$0 = require('os');
5
+ var require$$0$2 = require('fs');
6
+ var require$$0 = require('tty');
7
+ var require$$1 = require('util');
8
+ var require$$0$1 = require('os');
9
9
  var child_process = require('child_process');
10
10
  var node_events = require('node:events');
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
- var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
15
- var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
16
- var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
14
+ var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
17
15
  var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
16
+ var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
17
+ var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
18
18
 
19
19
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
20
20
 
21
21
  var dist$1 = {};
22
22
 
23
- var src$1 = {};
23
+ var src$2 = {};
24
+
25
+ var src$1 = {
26
+ exports: {}
27
+ };
28
+
29
+ var browser$1 = {
30
+ exports: {}
31
+ };
32
+
33
+ /**
34
+ * Helpers.
35
+ */
36
+
37
+ function _type_of$2(obj) {
38
+ "@swc/helpers - typeof";
39
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
40
+ }
41
+ var s$1 = 1000;
42
+ var m$1 = s$1 * 60;
43
+ var h$1 = m$1 * 60;
44
+ var d$1 = h$1 * 24;
45
+ var w$1 = d$1 * 7;
46
+ var y$1 = d$1 * 365.25;
47
+ /**
48
+ * Parse or format the given `val`.
49
+ *
50
+ * Options:
51
+ *
52
+ * - `long` verbose formatting [false]
53
+ *
54
+ * @param {String|Number} val
55
+ * @param {Object} [options]
56
+ * @throws {Error} throw an error if val is not a non-empty string or a number
57
+ * @return {String|Number}
58
+ * @api public
59
+ */ var ms$1 = function(val, options) {
60
+ options = options || {};
61
+ var type = typeof val === "undefined" ? "undefined" : _type_of$2(val);
62
+ if (type === "string" && val.length > 0) {
63
+ return parse$1(val);
64
+ } else if (type === "number" && isFinite(val)) {
65
+ return options.long ? fmtLong$1(val) : fmtShort$1(val);
66
+ }
67
+ throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
68
+ };
69
+ /**
70
+ * Parse the given `str` and return milliseconds.
71
+ *
72
+ * @param {String} str
73
+ * @return {Number}
74
+ * @api private
75
+ */ function parse$1(str) {
76
+ str = String(str);
77
+ if (str.length > 100) {
78
+ return;
79
+ }
80
+ 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);
81
+ if (!match) {
82
+ return;
83
+ }
84
+ var n = parseFloat(match[1]);
85
+ var type = (match[2] || "ms").toLowerCase();
86
+ switch(type){
87
+ case "years":
88
+ case "year":
89
+ case "yrs":
90
+ case "yr":
91
+ case "y":
92
+ return n * y$1;
93
+ case "weeks":
94
+ case "week":
95
+ case "w":
96
+ return n * w$1;
97
+ case "days":
98
+ case "day":
99
+ case "d":
100
+ return n * d$1;
101
+ case "hours":
102
+ case "hour":
103
+ case "hrs":
104
+ case "hr":
105
+ case "h":
106
+ return n * h$1;
107
+ case "minutes":
108
+ case "minute":
109
+ case "mins":
110
+ case "min":
111
+ case "m":
112
+ return n * m$1;
113
+ case "seconds":
114
+ case "second":
115
+ case "secs":
116
+ case "sec":
117
+ case "s":
118
+ return n * s$1;
119
+ case "milliseconds":
120
+ case "millisecond":
121
+ case "msecs":
122
+ case "msec":
123
+ case "ms":
124
+ return n;
125
+ default:
126
+ return undefined;
127
+ }
128
+ }
129
+ /**
130
+ * Short format for `ms`.
131
+ *
132
+ * @param {Number} ms
133
+ * @return {String}
134
+ * @api private
135
+ */ function fmtShort$1(ms) {
136
+ var msAbs = Math.abs(ms);
137
+ if (msAbs >= d$1) {
138
+ return Math.round(ms / d$1) + "d";
139
+ }
140
+ if (msAbs >= h$1) {
141
+ return Math.round(ms / h$1) + "h";
142
+ }
143
+ if (msAbs >= m$1) {
144
+ return Math.round(ms / m$1) + "m";
145
+ }
146
+ if (msAbs >= s$1) {
147
+ return Math.round(ms / s$1) + "s";
148
+ }
149
+ return ms + "ms";
150
+ }
151
+ /**
152
+ * Long format for `ms`.
153
+ *
154
+ * @param {Number} ms
155
+ * @return {String}
156
+ * @api private
157
+ */ function fmtLong$1(ms) {
158
+ var msAbs = Math.abs(ms);
159
+ if (msAbs >= d$1) {
160
+ return plural$1(ms, msAbs, d$1, "day");
161
+ }
162
+ if (msAbs >= h$1) {
163
+ return plural$1(ms, msAbs, h$1, "hour");
164
+ }
165
+ if (msAbs >= m$1) {
166
+ return plural$1(ms, msAbs, m$1, "minute");
167
+ }
168
+ if (msAbs >= s$1) {
169
+ return plural$1(ms, msAbs, s$1, "second");
170
+ }
171
+ return ms + " ms";
172
+ }
173
+ /**
174
+ * Pluralization helper.
175
+ */ function plural$1(ms, msAbs, n, name) {
176
+ var isPlural = msAbs >= n * 1.5;
177
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
178
+ }
179
+
180
+ /**
181
+ * This is the common logic for both the Node.js and web browser
182
+ * implementations of `debug()`.
183
+ */
184
+
185
+ function _array_like_to_array$2(arr, len) {
186
+ if (len == null || len > arr.length) len = arr.length;
187
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
188
+ return arr2;
189
+ }
190
+ function _array_without_holes$2(arr) {
191
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
192
+ }
193
+ function _instanceof$2(left, right) {
194
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
195
+ return !!right[Symbol.hasInstance](left);
196
+ } else {
197
+ return left instanceof right;
198
+ }
199
+ }
200
+ function _iterable_to_array$2(iter) {
201
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
202
+ }
203
+ function _non_iterable_spread$2() {
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.");
205
+ }
206
+ function _to_consumable_array$2(arr) {
207
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
208
+ }
209
+ function _unsupported_iterable_to_array$2(o, minLen) {
210
+ if (!o) return;
211
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
212
+ var n = Object.prototype.toString.call(o).slice(8, -1);
213
+ if (n === "Object" && o.constructor) n = o.constructor.name;
214
+ if (n === "Map" || n === "Set") return Array.from(n);
215
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
216
+ }
217
+ function setup$1(env) {
218
+ createDebug.debug = createDebug;
219
+ createDebug.default = createDebug;
220
+ createDebug.coerce = coerce;
221
+ createDebug.disable = disable;
222
+ createDebug.enable = enable;
223
+ createDebug.enabled = enabled;
224
+ createDebug.humanize = ms$1;
225
+ createDebug.destroy = destroy;
226
+ Object.keys(env).forEach(function(key) {
227
+ createDebug[key] = env[key];
228
+ });
229
+ /**
230
+ * The currently active debug mode names, and names to skip.
231
+ */ createDebug.names = [];
232
+ createDebug.skips = [];
233
+ /**
234
+ * Map of special "%n" handling functions, for the debug "format" argument.
235
+ *
236
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
237
+ */ createDebug.formatters = {};
238
+ /**
239
+ * Selects a color for a debug namespace
240
+ * @param {String} namespace The namespace string for the debug instance to be colored
241
+ * @return {Number|String} An ANSI color code for the given namespace
242
+ * @api private
243
+ */ function selectColor(namespace) {
244
+ var hash = 0;
245
+ for(var i = 0; i < namespace.length; i++){
246
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
247
+ hash |= 0; // Convert to 32bit integer
248
+ }
249
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
250
+ }
251
+ createDebug.selectColor = selectColor;
252
+ /**
253
+ * Create a debugger with the given `namespace`.
254
+ *
255
+ * @param {String} namespace
256
+ * @return {Function}
257
+ * @api public
258
+ */ function createDebug(namespace) {
259
+ var prevTime;
260
+ var enableOverride = null;
261
+ var namespacesCache;
262
+ var enabledCache;
263
+ function debug() {
264
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
265
+ args[_key] = arguments[_key];
266
+ }
267
+ // Disabled?
268
+ if (!debug.enabled) {
269
+ return;
270
+ }
271
+ var self = debug;
272
+ // Set `diff` timestamp
273
+ var curr = Number(new Date());
274
+ var ms = curr - (prevTime || curr);
275
+ self.diff = ms;
276
+ self.prev = prevTime;
277
+ self.curr = curr;
278
+ prevTime = curr;
279
+ args[0] = createDebug.coerce(args[0]);
280
+ if (typeof args[0] !== "string") {
281
+ // Anything else let's inspect with %O
282
+ args.unshift("%O");
283
+ }
284
+ // Apply any `formatters` transformations
285
+ var index = 0;
286
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
287
+ // If we encounter an escaped % then don't increase the array index
288
+ if (match === "%%") {
289
+ return "%";
290
+ }
291
+ index++;
292
+ var formatter = createDebug.formatters[format];
293
+ if (typeof formatter === "function") {
294
+ var val = args[index];
295
+ match = formatter.call(self, val);
296
+ // Now we need to remove `args[index]` since it's inlined in the `format`
297
+ args.splice(index, 1);
298
+ index--;
299
+ }
300
+ return match;
301
+ });
302
+ // Apply env-specific formatting (colors, etc.)
303
+ createDebug.formatArgs.call(self, args);
304
+ var logFn = self.log || createDebug.log;
305
+ logFn.apply(self, args);
306
+ }
307
+ debug.namespace = namespace;
308
+ debug.useColors = createDebug.useColors();
309
+ debug.color = createDebug.selectColor(namespace);
310
+ debug.extend = extend;
311
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
312
+ Object.defineProperty(debug, "enabled", {
313
+ enumerable: true,
314
+ configurable: false,
315
+ get: function() {
316
+ if (enableOverride !== null) {
317
+ return enableOverride;
318
+ }
319
+ if (namespacesCache !== createDebug.namespaces) {
320
+ namespacesCache = createDebug.namespaces;
321
+ enabledCache = createDebug.enabled(namespace);
322
+ }
323
+ return enabledCache;
324
+ },
325
+ set: function(v) {
326
+ enableOverride = v;
327
+ }
328
+ });
329
+ // Env-specific initialization logic for debug instances
330
+ if (typeof createDebug.init === "function") {
331
+ createDebug.init(debug);
332
+ }
333
+ return debug;
334
+ }
335
+ function extend(namespace, delimiter) {
336
+ var newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
337
+ newDebug.log = this.log;
338
+ return newDebug;
339
+ }
340
+ /**
341
+ * Enables a debug mode by namespaces. This can include modes
342
+ * separated by a colon and wildcards.
343
+ *
344
+ * @param {String} namespaces
345
+ * @api public
346
+ */ function enable(namespaces) {
347
+ createDebug.save(namespaces);
348
+ createDebug.namespaces = namespaces;
349
+ createDebug.names = [];
350
+ createDebug.skips = [];
351
+ var i;
352
+ var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
353
+ var len = split.length;
354
+ for(i = 0; i < len; i++){
355
+ if (!split[i]) {
356
+ continue;
357
+ }
358
+ namespaces = split[i].replace(/\*/g, ".*?");
359
+ if (namespaces[0] === "-") {
360
+ createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
361
+ } else {
362
+ createDebug.names.push(new RegExp("^" + namespaces + "$"));
363
+ }
364
+ }
365
+ }
366
+ /**
367
+ * Disable debug output.
368
+ *
369
+ * @return {String} namespaces
370
+ * @api public
371
+ */ function disable() {
372
+ var namespaces = _to_consumable_array$2(createDebug.names.map(toNamespace)).concat(_to_consumable_array$2(createDebug.skips.map(toNamespace).map(function(namespace) {
373
+ return "-" + namespace;
374
+ }))).join(",");
375
+ createDebug.enable("");
376
+ return namespaces;
377
+ }
378
+ /**
379
+ * Returns true if the given mode name is enabled, false otherwise.
380
+ *
381
+ * @param {String} name
382
+ * @return {Boolean}
383
+ * @api public
384
+ */ function enabled(name) {
385
+ if (name[name.length - 1] === "*") {
386
+ return true;
387
+ }
388
+ var i;
389
+ var len;
390
+ for(i = 0, len = createDebug.skips.length; i < len; i++){
391
+ if (createDebug.skips[i].test(name)) {
392
+ return false;
393
+ }
394
+ }
395
+ for(i = 0, len = createDebug.names.length; i < len; i++){
396
+ if (createDebug.names[i].test(name)) {
397
+ return true;
398
+ }
399
+ }
400
+ return false;
401
+ }
402
+ /**
403
+ * Convert regexp to namespace
404
+ *
405
+ * @param {RegExp} regxep
406
+ * @return {String} namespace
407
+ * @api private
408
+ */ function toNamespace(regexp) {
409
+ return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
410
+ }
411
+ /**
412
+ * Coerce `val`.
413
+ *
414
+ * @param {Mixed} val
415
+ * @return {Mixed}
416
+ * @api private
417
+ */ function coerce(val) {
418
+ if (_instanceof$2(val, Error)) {
419
+ return val.stack || val.message;
420
+ }
421
+ return val;
422
+ }
423
+ /**
424
+ * XXX DO NOT USE. This is a temporary stub function.
425
+ * XXX It WILL be removed in the next major release.
426
+ */ function destroy() {
427
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
428
+ }
429
+ createDebug.enable(createDebug.load());
430
+ return createDebug;
431
+ }
432
+ var common$1 = setup$1;
433
+
434
+ /* eslint-env browser */
435
+
436
+ (function (module, exports) {
437
+ /**
438
+ * This is the web browser implementation of `debug()`.
439
+ */ exports.formatArgs = formatArgs;
440
+ exports.save = save;
441
+ exports.load = load;
442
+ exports.useColors = useColors;
443
+ exports.storage = localstorage();
444
+ exports.destroy = function() {
445
+ var warned = false;
446
+ return function() {
447
+ if (!warned) {
448
+ warned = true;
449
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
450
+ }
451
+ };
452
+ }();
453
+ /**
454
+ * Colors.
455
+ */ exports.colors = [
456
+ "#0000CC",
457
+ "#0000FF",
458
+ "#0033CC",
459
+ "#0033FF",
460
+ "#0066CC",
461
+ "#0066FF",
462
+ "#0099CC",
463
+ "#0099FF",
464
+ "#00CC00",
465
+ "#00CC33",
466
+ "#00CC66",
467
+ "#00CC99",
468
+ "#00CCCC",
469
+ "#00CCFF",
470
+ "#3300CC",
471
+ "#3300FF",
472
+ "#3333CC",
473
+ "#3333FF",
474
+ "#3366CC",
475
+ "#3366FF",
476
+ "#3399CC",
477
+ "#3399FF",
478
+ "#33CC00",
479
+ "#33CC33",
480
+ "#33CC66",
481
+ "#33CC99",
482
+ "#33CCCC",
483
+ "#33CCFF",
484
+ "#6600CC",
485
+ "#6600FF",
486
+ "#6633CC",
487
+ "#6633FF",
488
+ "#66CC00",
489
+ "#66CC33",
490
+ "#9900CC",
491
+ "#9900FF",
492
+ "#9933CC",
493
+ "#9933FF",
494
+ "#99CC00",
495
+ "#99CC33",
496
+ "#CC0000",
497
+ "#CC0033",
498
+ "#CC0066",
499
+ "#CC0099",
500
+ "#CC00CC",
501
+ "#CC00FF",
502
+ "#CC3300",
503
+ "#CC3333",
504
+ "#CC3366",
505
+ "#CC3399",
506
+ "#CC33CC",
507
+ "#CC33FF",
508
+ "#CC6600",
509
+ "#CC6633",
510
+ "#CC9900",
511
+ "#CC9933",
512
+ "#CCCC00",
513
+ "#CCCC33",
514
+ "#FF0000",
515
+ "#FF0033",
516
+ "#FF0066",
517
+ "#FF0099",
518
+ "#FF00CC",
519
+ "#FF00FF",
520
+ "#FF3300",
521
+ "#FF3333",
522
+ "#FF3366",
523
+ "#FF3399",
524
+ "#FF33CC",
525
+ "#FF33FF",
526
+ "#FF6600",
527
+ "#FF6633",
528
+ "#FF9900",
529
+ "#FF9933",
530
+ "#FFCC00",
531
+ "#FFCC33"
532
+ ];
533
+ /**
534
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
535
+ * and the Firebug extension (any Firefox version) are known
536
+ * to support "%c" CSS customizations.
537
+ *
538
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
539
+ */ // eslint-disable-next-line complexity
540
+ function useColors() {
541
+ // NB: In an Electron preload script, document will be defined but not fully
542
+ // initialized. Since we know we're in Chrome, we'll just detect this case
543
+ // explicitly
544
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
545
+ return true;
546
+ }
547
+ // Internet Explorer and Edge do not support colors.
548
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
549
+ return false;
550
+ }
551
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
552
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
553
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
554
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
555
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
556
+ 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
557
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
558
+ }
559
+ /**
560
+ * Colorize log arguments if enabled.
561
+ *
562
+ * @api public
563
+ */ function formatArgs(args) {
564
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
565
+ if (!this.useColors) {
566
+ return;
567
+ }
568
+ var c = "color: " + this.color;
569
+ args.splice(1, 0, c, "color: inherit");
570
+ // The final "%c" is somewhat tricky, because there could be other
571
+ // arguments passed either before or after the %c, so we need to
572
+ // figure out the correct index to insert the CSS into
573
+ var index = 0;
574
+ var lastC = 0;
575
+ args[0].replace(/%[a-zA-Z%]/g, function(match) {
576
+ if (match === "%%") {
577
+ return;
578
+ }
579
+ index++;
580
+ if (match === "%c") {
581
+ // We only are interested in the *last* %c
582
+ // (the user may have provided their own)
583
+ lastC = index;
584
+ }
585
+ });
586
+ args.splice(lastC, 0, c);
587
+ }
588
+ /**
589
+ * Invokes `console.debug()` when available.
590
+ * No-op when `console.debug` is not a "function".
591
+ * If `console.debug` is not available, falls back
592
+ * to `console.log`.
593
+ *
594
+ * @api public
595
+ */ exports.log = console.debug || console.log || function() {};
596
+ /**
597
+ * Save `namespaces`.
598
+ *
599
+ * @param {String} namespaces
600
+ * @api private
601
+ */ function save(namespaces) {
602
+ try {
603
+ if (namespaces) {
604
+ exports.storage.setItem("debug", namespaces);
605
+ } else {
606
+ exports.storage.removeItem("debug");
607
+ }
608
+ } catch (error) {
609
+ // Swallow
610
+ // XXX (@Qix-) should we be logging these?
611
+ }
612
+ }
613
+ /**
614
+ * Load `namespaces`.
615
+ *
616
+ * @return {String} returns the previously persisted debug modes
617
+ * @api private
618
+ */ function load() {
619
+ var r;
620
+ try {
621
+ r = exports.storage.getItem("debug");
622
+ } catch (error) {
623
+ // Swallow
624
+ // XXX (@Qix-) should we be logging these?
625
+ }
626
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
627
+ if (!r && typeof process !== "undefined" && "env" in process) {
628
+ r = process.env.DEBUG;
629
+ }
630
+ return r;
631
+ }
632
+ /**
633
+ * Localstorage attempts to return the localstorage.
634
+ *
635
+ * This is necessary because safari throws
636
+ * when a user disables cookies/localstorage
637
+ * and you attempt to access it.
638
+ *
639
+ * @return {LocalStorage}
640
+ * @api private
641
+ */ function localstorage() {
642
+ try {
643
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
644
+ // The Browser also has localStorage in the global context.
645
+ return localStorage;
646
+ } catch (error) {
647
+ // Swallow
648
+ // XXX (@Qix-) should we be logging these?
649
+ }
650
+ }
651
+ module.exports = common$1(exports);
652
+ var formatters = module.exports.formatters;
653
+ /**
654
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
655
+ */ formatters.j = function(v) {
656
+ try {
657
+ return JSON.stringify(v);
658
+ } catch (error) {
659
+ return "[UnexpectedJSONParseError]: " + error.message;
660
+ }
661
+ };
662
+ }(browser$1, browser$1.exports));
663
+
664
+ var node$1 = {
665
+ exports: {}
666
+ };
667
+
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$1["default"];
677
+ var tty = require$$0__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;
749
+ }
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)))
781
+ };
782
+
783
+ /**
784
+ * Module dependencies.
785
+ */
786
+
787
+ (function (module, exports) {
788
+ function _array_like_to_array(arr, len) {
789
+ if (len == null || len > arr.length) len = arr.length;
790
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
791
+ return arr2;
792
+ }
793
+ function _array_without_holes(arr) {
794
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
795
+ }
796
+ function _iterable_to_array(iter) {
797
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
798
+ }
799
+ function _non_iterable_spread() {
800
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
801
+ }
802
+ function _to_consumable_array(arr) {
803
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
804
+ }
805
+ function _unsupported_iterable_to_array(o, minLen) {
806
+ if (!o) return;
807
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
808
+ var n = Object.prototype.toString.call(o).slice(8, -1);
809
+ if (n === "Object" && o.constructor) n = o.constructor.name;
810
+ if (n === "Map" || n === "Set") return Array.from(n);
811
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
812
+ }
813
+ var tty = require$$0__default["default"];
814
+ var util = require$$1__default["default"];
815
+ /**
816
+ * This is the Node.js implementation of `debug()`.
817
+ */ exports.init = init;
818
+ exports.log = log;
819
+ exports.formatArgs = formatArgs;
820
+ exports.save = save;
821
+ exports.load = load;
822
+ exports.useColors = useColors;
823
+ 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`.");
824
+ /**
825
+ * Colors.
826
+ */ exports.colors = [
827
+ 6,
828
+ 2,
829
+ 3,
830
+ 4,
831
+ 5,
832
+ 1
833
+ ];
834
+ try {
835
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
836
+ // eslint-disable-next-line import/no-extraneous-dependencies
837
+ var supportsColor = supportsColor_1;
838
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
839
+ exports.colors = [
840
+ 20,
841
+ 21,
842
+ 26,
843
+ 27,
844
+ 32,
845
+ 33,
846
+ 38,
847
+ 39,
848
+ 40,
849
+ 41,
850
+ 42,
851
+ 43,
852
+ 44,
853
+ 45,
854
+ 56,
855
+ 57,
856
+ 62,
857
+ 63,
858
+ 68,
859
+ 69,
860
+ 74,
861
+ 75,
862
+ 76,
863
+ 77,
864
+ 78,
865
+ 79,
866
+ 80,
867
+ 81,
868
+ 92,
869
+ 93,
870
+ 98,
871
+ 99,
872
+ 112,
873
+ 113,
874
+ 128,
875
+ 129,
876
+ 134,
877
+ 135,
878
+ 148,
879
+ 149,
880
+ 160,
881
+ 161,
882
+ 162,
883
+ 163,
884
+ 164,
885
+ 165,
886
+ 166,
887
+ 167,
888
+ 168,
889
+ 169,
890
+ 170,
891
+ 171,
892
+ 172,
893
+ 173,
894
+ 178,
895
+ 179,
896
+ 184,
897
+ 185,
898
+ 196,
899
+ 197,
900
+ 198,
901
+ 199,
902
+ 200,
903
+ 201,
904
+ 202,
905
+ 203,
906
+ 204,
907
+ 205,
908
+ 206,
909
+ 207,
910
+ 208,
911
+ 209,
912
+ 214,
913
+ 215,
914
+ 220,
915
+ 221
916
+ ];
917
+ }
918
+ } catch (error) {
919
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
920
+ }
921
+ /**
922
+ * Build up the default `inspectOpts` object from the environment variables.
923
+ *
924
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
925
+ */ exports.inspectOpts = Object.keys(process.env).filter(function(key) {
926
+ return /^debug_/i.test(key);
927
+ }).reduce(function(obj, key) {
928
+ // Camel-case
929
+ var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
930
+ return k.toUpperCase();
931
+ });
932
+ // Coerce string value into JS value
933
+ var val = process.env[key];
934
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
935
+ val = true;
936
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
937
+ val = false;
938
+ } else if (val === "null") {
939
+ val = null;
940
+ } else {
941
+ val = Number(val);
942
+ }
943
+ obj[prop] = val;
944
+ return obj;
945
+ }, {});
946
+ /**
947
+ * Is stdout a TTY? Colored output is enabled when `true`.
948
+ */ function useColors() {
949
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
950
+ }
951
+ /**
952
+ * Adds ANSI color escape codes if enabled.
953
+ *
954
+ * @api public
955
+ */ function formatArgs(args) {
956
+ var _this = this, name = _this.namespace, _$useColors = _this.useColors;
957
+ if (_$useColors) {
958
+ var c = this.color;
959
+ var colorCode = "\x1b[3" + (c < 8 ? c : "8;5;" + c);
960
+ var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1b[0m");
961
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
962
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1b[0m");
963
+ } else {
964
+ args[0] = getDate() + name + " " + args[0];
965
+ }
966
+ }
967
+ function getDate() {
968
+ if (exports.inspectOpts.hideDate) {
969
+ return "";
970
+ }
971
+ return new Date().toISOString() + " ";
972
+ }
973
+ /**
974
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
975
+ */ function log() {
976
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
977
+ args[_key] = arguments[_key];
978
+ }
979
+ var _util;
980
+ return process.stderr.write((_util = util).format.apply(_util, _to_consumable_array(args)) + "\n");
981
+ }
982
+ /**
983
+ * Save `namespaces`.
984
+ *
985
+ * @param {String} namespaces
986
+ * @api private
987
+ */ function save(namespaces) {
988
+ if (namespaces) {
989
+ process.env.DEBUG = namespaces;
990
+ } else {
991
+ // If you set a process.env field to null or undefined, it gets cast to the
992
+ // string 'null' or 'undefined'. Just delete instead.
993
+ delete process.env.DEBUG;
994
+ }
995
+ }
996
+ /**
997
+ * Load `namespaces`.
998
+ *
999
+ * @return {String} returns the previously persisted debug modes
1000
+ * @api private
1001
+ */ function load() {
1002
+ return process.env.DEBUG;
1003
+ }
1004
+ /**
1005
+ * Init logic for `debug` instances.
1006
+ *
1007
+ * Create a new `inspectOpts` object in case `useColors` is set
1008
+ * differently for a particular `debug` instance.
1009
+ */ function init(debug) {
1010
+ debug.inspectOpts = {};
1011
+ var keys = Object.keys(exports.inspectOpts);
1012
+ for(var i = 0; i < keys.length; i++){
1013
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
1014
+ }
1015
+ }
1016
+ module.exports = common$1(exports);
1017
+ var formatters = module.exports.formatters;
1018
+ /**
1019
+ * Map %o to `util.inspect()`, all on a single line.
1020
+ */ formatters.o = function(v) {
1021
+ this.inspectOpts.colors = this.useColors;
1022
+ return util.inspect(v, this.inspectOpts).split("\n").map(function(str) {
1023
+ return str.trim();
1024
+ }).join(" ");
1025
+ };
1026
+ /**
1027
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
1028
+ */ formatters.O = function(v) {
1029
+ this.inspectOpts.colors = this.useColors;
1030
+ return util.inspect(v, this.inspectOpts);
1031
+ };
1032
+ }(node$1, node$1.exports));
1033
+
1034
+ /**
1035
+ * Detect Electron renderer / nwjs process, which is node, but we should
1036
+ * treat as a browser.
1037
+ */
1038
+
1039
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
1040
+ src$1.exports = browser$1.exports;
1041
+ } else {
1042
+ src$1.exports = node$1.exports;
1043
+ }
1044
+
1045
+ (function (exports) {
1046
+ var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
1047
+ return mod && mod.__esModule ? mod : {
1048
+ "default": mod
1049
+ };
1050
+ };
1051
+ Object.defineProperty(exports, "__esModule", {
1052
+ value: true
1053
+ });
1054
+ var fs_1 = require$$0__default$2["default"];
1055
+ var debug_1 = __importDefault(src$1.exports);
1056
+ var log = debug_1.default("@kwsites/file-exists");
1057
+ function check(path, isFile, isDirectory) {
1058
+ log("checking %s", path);
1059
+ try {
1060
+ var stat = fs_1.statSync(path);
1061
+ if (stat.isFile() && isFile) {
1062
+ log("[OK] path represents a file");
1063
+ return true;
1064
+ }
1065
+ if (stat.isDirectory() && isDirectory) {
1066
+ log("[OK] path represents a directory");
1067
+ return true;
1068
+ }
1069
+ log("[FAIL] path represents something other than a file or directory");
1070
+ return false;
1071
+ } catch (e) {
1072
+ if (e.code === "ENOENT") {
1073
+ log("[FAIL] path is not accessible: %o", e);
1074
+ return false;
1075
+ }
1076
+ log("[FATAL] %o", e);
1077
+ throw e;
1078
+ }
1079
+ }
1080
+ /**
1081
+ * Synchronous validation of a path existing either as a file or as a directory.
1082
+ *
1083
+ * @param {string} path The path to check
1084
+ * @param {number} type One or both of the exported numeric constants
1085
+ */ function exists(path) {
1086
+ var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : exports.READABLE;
1087
+ return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
1088
+ }
1089
+ exports.exists = exists;
1090
+ /**
1091
+ * Constant representing a file
1092
+ */ exports.FILE = 1;
1093
+ /**
1094
+ * Constant representing a folder
1095
+ */ exports.FOLDER = 2;
1096
+ /**
1097
+ * Constant representing either a file or a folder
1098
+ */ exports.READABLE = exports.FILE + exports.FOLDER;
1099
+ }(src$2));
1100
+
1101
+ (function (exports) {
1102
+ function __export(m) {
1103
+ for(var p in m)if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1104
+ }
1105
+ Object.defineProperty(exports, "__esModule", {
1106
+ value: true
1107
+ });
1108
+ __export(src$2);
1109
+ }(dist$1));
24
1110
 
25
1111
  var src = {
26
1112
  exports: {}
@@ -665,121 +1751,6 @@ var node = {
665
1751
  exports: {}
666
1752
  };
667
1753
 
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;
749
- }
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)))
781
- };
782
-
783
1754
  /**
784
1755
  * Module dependencies.
785
1756
  */
@@ -810,8 +1781,8 @@ function _unsupported_iterable_to_array(o, minLen) {
810
1781
  if (n === "Map" || n === "Set") return Array.from(n);
811
1782
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
812
1783
  }
813
- var tty = require$$1__default["default"];
814
- var util = require$$1__default$1["default"];
1784
+ var tty = require$$0__default["default"];
1785
+ var util = require$$1__default["default"];
815
1786
  /**
816
1787
  * This is the Node.js implementation of `debug()`.
817
1788
  */ exports.init = init;
@@ -971,13 +1942,15 @@ function getDate() {
971
1942
  return new Date().toISOString() + " ";
972
1943
  }
973
1944
  /**
974
- * Invokes `util.format()` with the specified arguments and writes to stderr.
1945
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
975
1946
  */ function log() {
976
1947
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
977
1948
  args[_key] = arguments[_key];
978
1949
  }
979
1950
  var _util;
980
- return process.stderr.write((_util = util).format.apply(_util, _to_consumable_array(args)) + "\n");
1951
+ return process.stderr.write((_util = util).formatWithOptions.apply(_util, [
1952
+ exports.inspectOpts
1953
+ ].concat(_to_consumable_array(args))) + "\n");
981
1954
  }
982
1955
  /**
983
1956
  * Save `namespaces`.
@@ -1044,72 +2017,6 @@ if (typeof process === "undefined" || process.type === "renderer" || process.bro
1044
2017
 
1045
2018
  var debug = src.exports;
1046
2019
 
1047
- (function (exports) {
1048
- var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
1049
- return mod && mod.__esModule ? mod : {
1050
- "default": mod
1051
- };
1052
- };
1053
- Object.defineProperty(exports, "__esModule", {
1054
- value: true
1055
- });
1056
- var fs_1 = require$$0__default$1["default"];
1057
- var debug_1 = __importDefault(src.exports);
1058
- var log = debug_1.default("@kwsites/file-exists");
1059
- function check(path, isFile, isDirectory) {
1060
- log("checking %s", path);
1061
- try {
1062
- var stat = fs_1.statSync(path);
1063
- if (stat.isFile() && isFile) {
1064
- log("[OK] path represents a file");
1065
- return true;
1066
- }
1067
- if (stat.isDirectory() && isDirectory) {
1068
- log("[OK] path represents a directory");
1069
- return true;
1070
- }
1071
- log("[FAIL] path represents something other than a file or directory");
1072
- return false;
1073
- } catch (e) {
1074
- if (e.code === "ENOENT") {
1075
- log("[FAIL] path is not accessible: %o", e);
1076
- return false;
1077
- }
1078
- log("[FATAL] %o", e);
1079
- throw e;
1080
- }
1081
- }
1082
- /**
1083
- * Synchronous validation of a path existing either as a file or as a directory.
1084
- *
1085
- * @param {string} path The path to check
1086
- * @param {number} type One or both of the exported numeric constants
1087
- */ function exists(path) {
1088
- var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : exports.READABLE;
1089
- return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
1090
- }
1091
- exports.exists = exists;
1092
- /**
1093
- * Constant representing a file
1094
- */ exports.FILE = 1;
1095
- /**
1096
- * Constant representing a folder
1097
- */ exports.FOLDER = 2;
1098
- /**
1099
- * Constant representing either a file or a folder
1100
- */ exports.READABLE = exports.FILE + exports.FOLDER;
1101
- }(src$1));
1102
-
1103
- (function (exports) {
1104
- function __export(m) {
1105
- for(var p in m)if (!exports.hasOwnProperty(p)) exports[p] = m[p];
1106
- }
1107
- Object.defineProperty(exports, "__esModule", {
1108
- value: true
1109
- });
1110
- __export(src$1);
1111
- }(dist$1));
1112
-
1113
2020
  var dist = {};
1114
2021
 
1115
2022
  Object.defineProperty(dist, "__esModule", {
@@ -1772,6 +2679,11 @@ function asArray(source) {
1772
2679
  source
1773
2680
  ];
1774
2681
  }
2682
+ function asCamelCase(str) {
2683
+ return str.replace(/[\s-]+(.)/g, function(_all, chr) {
2684
+ return chr.toUpperCase();
2685
+ });
2686
+ }
1775
2687
  function asStringArray(source) {
1776
2688
  return asArray(source).map(String);
1777
2689
  }
@@ -2074,8 +2986,8 @@ var init_task_options = __esm({
2074
2986
  }
2075
2987
  });
2076
2988
  // src/lib/utils/task-parser.ts
2077
- function callTaskParser(parser3, streams) {
2078
- return parser3(streams.stdOut, streams.stdErr);
2989
+ function callTaskParser(parser4, streams) {
2990
+ return parser4(streams.stdOut, streams.stdErr);
2079
2991
  }
2080
2992
  function parseStringResponse(result, parsers12, texts) {
2081
2993
  var trim = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
@@ -2132,6 +3044,9 @@ __export(utils_exports, {
2132
3044
  asArray: function() {
2133
3045
  return asArray;
2134
3046
  },
3047
+ asCamelCase: function() {
3048
+ return asCamelCase;
3049
+ },
2135
3050
  asFunction: function() {
2136
3051
  return asFunction;
2137
3052
  },
@@ -2381,11 +3296,11 @@ __export(task_exports, {
2381
3296
  return straightThroughStringTask;
2382
3297
  }
2383
3298
  });
2384
- function adhocExecTask(parser3) {
3299
+ function adhocExecTask(parser4) {
2385
3300
  return {
2386
3301
  commands: EMPTY_COMMANDS,
2387
3302
  format: "empty",
2388
- parser: parser3
3303
+ parser: parser4
2389
3304
  };
2390
3305
  }
2391
3306
  function configurationErrorTask(error) {
@@ -3688,6 +4603,50 @@ var init_checkout = __esm({
3688
4603
  init_task();
3689
4604
  }
3690
4605
  });
4606
+ // src/lib/tasks/count-objects.ts
4607
+ function countObjectsResponse() {
4608
+ return {
4609
+ count: 0,
4610
+ garbage: 0,
4611
+ inPack: 0,
4612
+ packs: 0,
4613
+ prunePackable: 0,
4614
+ size: 0,
4615
+ sizeGarbage: 0,
4616
+ sizePack: 0
4617
+ };
4618
+ }
4619
+ function count_objects_default() {
4620
+ return {
4621
+ countObjects: function countObjects() {
4622
+ return this._runTask({
4623
+ commands: [
4624
+ "count-objects",
4625
+ "--verbose"
4626
+ ],
4627
+ format: "utf-8",
4628
+ parser: function parser(stdOut) {
4629
+ return parseStringResponse(countObjectsResponse(), [
4630
+ parser2
4631
+ ], stdOut);
4632
+ }
4633
+ });
4634
+ }
4635
+ };
4636
+ }
4637
+ var parser2;
4638
+ var init_count_objects = __esm({
4639
+ "src/lib/tasks/count-objects.ts": function() {
4640
+ init_utils();
4641
+ parser2 = new LineParser(/([a-z-]+): (\d+)$/, function(result, param) {
4642
+ var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
4643
+ var property = asCamelCase(key);
4644
+ if (result.hasOwnProperty(property)) {
4645
+ result[property] = asNumber(value);
4646
+ }
4647
+ });
4648
+ }
4649
+ });
3691
4650
  // src/lib/parsers/parse-commit.ts
3692
4651
  function parseCommitResult(stdOut) {
3693
4652
  var result = {
@@ -3911,9 +4870,9 @@ var init_DiffSummary = __esm({
3911
4870
  // src/lib/parsers/parse-diff-summary.ts
3912
4871
  function getDiffParser() {
3913
4872
  var format = arguments.length > 0 && arguments[0] !== void 0 /* NONE */ ? arguments[0] : "";
3914
- var parser3 = diffSummaryParsers[format];
4873
+ var parser4 = diffSummaryParsers[format];
3915
4874
  return function(stdOut) {
3916
- return parseStringResponse(new DiffSummary(), parser3, stdOut, false);
4875
+ return parseStringResponse(new DiffSummary(), parser4, stdOut, false);
3917
4876
  };
3918
4877
  }
3919
4878
  var statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers;
@@ -4157,13 +5116,13 @@ function parseLogOptions() {
4157
5116
  };
4158
5117
  }
4159
5118
  function logTask(splitter, fields, customArgs) {
4160
- var parser3 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs));
5119
+ var parser4 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs));
4161
5120
  return {
4162
5121
  commands: [
4163
5122
  "log"
4164
5123
  ].concat(_to_consumable_array(customArgs)),
4165
5124
  format: "utf-8",
4166
- parser: parser3
5125
+ parser: parser4
4167
5126
  };
4168
5127
  }
4169
5128
  function log_default() {
@@ -4715,7 +5674,7 @@ function renamedFile(line) {
4715
5674
  to: to
4716
5675
  };
4717
5676
  }
4718
- function parser2(indexX, indexY, handler) {
5677
+ function parser3(indexX, indexY, handler) {
4719
5678
  return [
4720
5679
  "".concat(indexX).concat(indexY),
4721
5680
  handler
@@ -4726,7 +5685,7 @@ function conflicts(indexX) {
4726
5685
  indexY[_key - 1] = arguments[_key];
4727
5686
  }
4728
5687
  return indexY.map(function(y) {
4729
- return parser2(indexX, y, function(result, file) {
5688
+ return parser3(indexX, y, function(result, file) {
4730
5689
  return append(result.conflicted, file);
4731
5690
  });
4732
5691
  });
@@ -4779,42 +5738,42 @@ var init_StatusSummary = __esm({
4779
5738
  };
4780
5739
  };
4781
5740
  parsers6 = new Map([
4782
- parser2(" " /* NONE */ , "A" /* ADDED */ , function(result, file) {
5741
+ parser3(" " /* NONE */ , "A" /* ADDED */ , function(result, file) {
4783
5742
  return append(result.created, file);
4784
5743
  }),
4785
- parser2(" " /* NONE */ , "D" /* DELETED */ , function(result, file) {
5744
+ parser3(" " /* NONE */ , "D" /* DELETED */ , function(result, file) {
4786
5745
  return append(result.deleted, file);
4787
5746
  }),
4788
- parser2(" " /* NONE */ , "M" /* MODIFIED */ , function(result, file) {
5747
+ parser3(" " /* NONE */ , "M" /* MODIFIED */ , function(result, file) {
4789
5748
  return append(result.modified, file);
4790
5749
  }),
4791
- parser2("A" /* ADDED */ , " " /* NONE */ , function(result, file) {
5750
+ parser3("A" /* ADDED */ , " " /* NONE */ , function(result, file) {
4792
5751
  return append(result.created, file) && append(result.staged, file);
4793
5752
  }),
4794
- parser2("A" /* ADDED */ , "M" /* MODIFIED */ , function(result, file) {
5753
+ parser3("A" /* ADDED */ , "M" /* MODIFIED */ , function(result, file) {
4795
5754
  return append(result.created, file) && append(result.staged, file) && append(result.modified, file);
4796
5755
  }),
4797
- parser2("D" /* DELETED */ , " " /* NONE */ , function(result, file) {
5756
+ parser3("D" /* DELETED */ , " " /* NONE */ , function(result, file) {
4798
5757
  return append(result.deleted, file) && append(result.staged, file);
4799
5758
  }),
4800
- parser2("M" /* MODIFIED */ , " " /* NONE */ , function(result, file) {
5759
+ parser3("M" /* MODIFIED */ , " " /* NONE */ , function(result, file) {
4801
5760
  return append(result.modified, file) && append(result.staged, file);
4802
5761
  }),
4803
- parser2("M" /* MODIFIED */ , "M" /* MODIFIED */ , function(result, file) {
5762
+ parser3("M" /* MODIFIED */ , "M" /* MODIFIED */ , function(result, file) {
4804
5763
  return append(result.modified, file) && append(result.staged, file);
4805
5764
  }),
4806
- parser2("R" /* RENAMED */ , " " /* NONE */ , function(result, file) {
5765
+ parser3("R" /* RENAMED */ , " " /* NONE */ , function(result, file) {
4807
5766
  append(result.renamed, renamedFile(file));
4808
5767
  }),
4809
- parser2("R" /* RENAMED */ , "M" /* MODIFIED */ , function(result, file) {
5768
+ parser3("R" /* RENAMED */ , "M" /* MODIFIED */ , function(result, file) {
4810
5769
  var renamed = renamedFile(file);
4811
5770
  append(result.renamed, renamed);
4812
5771
  append(result.modified, renamed.to);
4813
5772
  }),
4814
- parser2("!" /* IGNORED */ , "!" /* IGNORED */ , function(_result, _file) {
5773
+ parser3("!" /* IGNORED */ , "!" /* IGNORED */ , function(_result, _file) {
4815
5774
  append(_result.ignored = _result.ignored || [], _file);
4816
5775
  }),
4817
- parser2("?" /* UNTRACKED */ , "?" /* UNTRACKED */ , function(result, file) {
5776
+ parser3("?" /* UNTRACKED */ , "?" /* UNTRACKED */ , function(result, file) {
4818
5777
  return append(result.not_added, file);
4819
5778
  })
4820
5779
  ].concat(_to_consumable_array(conflicts("A" /* ADDED */ , "A" /* ADDED */ , "U" /* UNMERGED */ )), _to_consumable_array(conflicts("D" /* DELETED */ , "D" /* DELETED */ , "U" /* UNMERGED */ )), _to_consumable_array(conflicts("U" /* UNMERGED */ , "A" /* ADDED */ , "D" /* DELETED */ , "U" /* UNMERGED */ )), [
@@ -4962,6 +5921,7 @@ var init_simple_git_api = __esm({
4962
5921
  init_task_callback();
4963
5922
  init_change_working_directory();
4964
5923
  init_checkout();
5924
+ init_count_objects();
4965
5925
  init_commit();
4966
5926
  init_config();
4967
5927
  init_first_commit();
@@ -5088,7 +6048,7 @@ var init_simple_git_api = __esm({
5088
6048
  ]);
5089
6049
  return SimpleGitApi;
5090
6050
  }();
5091
- Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
6051
+ Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
5092
6052
  }
5093
6053
  });
5094
6054
  // src/lib/runners/scheduler.ts
@@ -5356,14 +6316,14 @@ function branchTask(customArgs) {
5356
6316
  };
5357
6317
  }
5358
6318
  function branchLocalTask() {
5359
- var parser3 = parseBranchSummary;
6319
+ var parser4 = parseBranchSummary;
5360
6320
  return {
5361
6321
  format: "utf-8",
5362
6322
  commands: [
5363
6323
  "branch",
5364
6324
  "-v"
5365
6325
  ],
5366
- parser: parser3
6326
+ parser: parser4
5367
6327
  };
5368
6328
  }
5369
6329
  function deleteBranchesTask(branches) {
@@ -5780,11 +6740,11 @@ function stashListTask() {
5780
6740
  "stash",
5781
6741
  "list"
5782
6742
  ].concat(_to_consumable_array(options.commands), _to_consumable_array(customArgs));
5783
- var parser3 = createListLogSummaryParser(options.splitter, options.fields, logFormatFromCommand(commands));
6743
+ var parser4 = createListLogSummaryParser(options.splitter, options.fields, logFormatFromCommand(commands));
5784
6744
  return validateLogFormatConfig(commands) || {
5785
6745
  commands: commands,
5786
6746
  format: "utf-8",
5787
- parser: parser3
6747
+ parser: parser4
5788
6748
  };
5789
6749
  }
5790
6750
  var init_stash_list = __esm({