@digipair/skill-git 0.92.2 → 0.93.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/{index.cjs.js → dist/index.cjs.js} +1242 -1271
- package/{index.esm.js → dist/index.esm.js} +1242 -1262
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{libs/skill-git → dist}/src/lib/skill-git.d.ts +1 -0
- package/dist/src/lib/skill-git.d.ts.map +1 -0
- package/dist/src/lib/skill-git.spec.d.ts +2 -0
- package/dist/src/lib/skill-git.spec.d.ts.map +1 -0
- package/package.json +21 -5
- package/index.d.ts +0 -1
- package/libs/skill-git/src/index.d.ts +0 -1
- /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
- /package/{schema.fr.json → dist/schema.fr.json} +0 -0
- /package/{schema.json → dist/schema.json} +0 -0
@@ -1,11 +1,14 @@
|
|
1
|
+
import { Buffer as Buffer$1 } from 'node:buffer';
|
1
2
|
import require$$0$1 from 'fs';
|
2
|
-
import require$$
|
3
|
-
import require$$1
|
4
|
-
import require$$0 from 'os';
|
3
|
+
import require$$0 from 'tty';
|
4
|
+
import require$$1 from 'util';
|
5
5
|
import { spawn } from 'child_process';
|
6
6
|
import { EventEmitter } from 'node:events';
|
7
7
|
|
8
|
-
var commonjsGlobal = typeof globalThis !==
|
8
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
9
|
+
function getDefaultExportFromCjs(x) {
|
10
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
11
|
+
}
|
9
12
|
|
10
13
|
var dist$1 = {};
|
11
14
|
|
@@ -15,7 +18,7 @@ var src = {
|
|
15
18
|
exports: {}
|
16
19
|
};
|
17
20
|
|
18
|
-
var browser = {
|
21
|
+
var browser$1 = {
|
19
22
|
exports: {}
|
20
23
|
};
|
21
24
|
|
@@ -23,147 +26,155 @@ var browser = {
|
|
23
26
|
* Helpers.
|
24
27
|
*/
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
*
|
39
|
-
*
|
40
|
-
*
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
29
|
+
var ms;
|
30
|
+
var hasRequiredMs;
|
31
|
+
|
32
|
+
function requireMs () {
|
33
|
+
if (hasRequiredMs) return ms;
|
34
|
+
hasRequiredMs = 1;
|
35
|
+
function _type_of(obj) {
|
36
|
+
"@swc/helpers - typeof";
|
37
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
38
|
+
}
|
39
|
+
var s = 1000;
|
40
|
+
var m = s * 60;
|
41
|
+
var h = m * 60;
|
42
|
+
var d = h * 24;
|
43
|
+
var w = d * 7;
|
44
|
+
var y = d * 365.25;
|
45
|
+
/**
|
46
|
+
* Parse or format the given `val`.
|
47
|
+
*
|
48
|
+
* Options:
|
49
|
+
*
|
50
|
+
* - `long` verbose formatting [false]
|
51
|
+
*
|
52
|
+
* @param {String|Number} val
|
53
|
+
* @param {Object} [options]
|
54
|
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
55
|
+
* @return {String|Number}
|
56
|
+
* @api public
|
57
|
+
*/ ms = function(val, options) {
|
58
|
+
options = options || {};
|
59
|
+
var type = typeof val === "undefined" ? "undefined" : _type_of(val);
|
60
|
+
if (type === 'string' && val.length > 0) {
|
61
|
+
return parse(val);
|
62
|
+
} else if (type === 'number' && isFinite(val)) {
|
63
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
64
|
+
}
|
65
|
+
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
66
|
+
};
|
67
|
+
/**
|
68
|
+
* Parse the given `str` and return milliseconds.
|
69
|
+
*
|
70
|
+
* @param {String} str
|
71
|
+
* @return {Number}
|
72
|
+
* @api private
|
73
|
+
*/ function parse(str) {
|
74
|
+
str = String(str);
|
75
|
+
if (str.length > 100) {
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
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);
|
79
|
+
if (!match) {
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
var n = parseFloat(match[1]);
|
83
|
+
var type = (match[2] || 'ms').toLowerCase();
|
84
|
+
switch(type){
|
85
|
+
case 'years':
|
86
|
+
case 'year':
|
87
|
+
case 'yrs':
|
88
|
+
case 'yr':
|
89
|
+
case 'y':
|
90
|
+
return n * y;
|
91
|
+
case 'weeks':
|
92
|
+
case 'week':
|
93
|
+
case 'w':
|
94
|
+
return n * w;
|
95
|
+
case 'days':
|
96
|
+
case 'day':
|
97
|
+
case 'd':
|
98
|
+
return n * d;
|
99
|
+
case 'hours':
|
100
|
+
case 'hour':
|
101
|
+
case 'hrs':
|
102
|
+
case 'hr':
|
103
|
+
case 'h':
|
104
|
+
return n * h;
|
105
|
+
case 'minutes':
|
106
|
+
case 'minute':
|
107
|
+
case 'mins':
|
108
|
+
case 'min':
|
109
|
+
case 'm':
|
110
|
+
return n * m;
|
111
|
+
case 'seconds':
|
112
|
+
case 'second':
|
113
|
+
case 'secs':
|
114
|
+
case 'sec':
|
115
|
+
case 's':
|
116
|
+
return n * s;
|
117
|
+
case 'milliseconds':
|
118
|
+
case 'millisecond':
|
119
|
+
case 'msecs':
|
120
|
+
case 'msec':
|
121
|
+
case 'ms':
|
122
|
+
return n;
|
123
|
+
default:
|
124
|
+
return undefined;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
/**
|
128
|
+
* Short format for `ms`.
|
129
|
+
*
|
130
|
+
* @param {Number} ms
|
131
|
+
* @return {String}
|
132
|
+
* @api private
|
133
|
+
*/ function fmtShort(ms) {
|
134
|
+
var msAbs = Math.abs(ms);
|
135
|
+
if (msAbs >= d) {
|
136
|
+
return Math.round(ms / d) + 'd';
|
137
|
+
}
|
138
|
+
if (msAbs >= h) {
|
139
|
+
return Math.round(ms / h) + 'h';
|
140
|
+
}
|
141
|
+
if (msAbs >= m) {
|
142
|
+
return Math.round(ms / m) + 'm';
|
143
|
+
}
|
144
|
+
if (msAbs >= s) {
|
145
|
+
return Math.round(ms / s) + 's';
|
146
|
+
}
|
147
|
+
return ms + 'ms';
|
148
|
+
}
|
149
|
+
/**
|
150
|
+
* Long format for `ms`.
|
151
|
+
*
|
152
|
+
* @param {Number} ms
|
153
|
+
* @return {String}
|
154
|
+
* @api private
|
155
|
+
*/ function fmtLong(ms) {
|
156
|
+
var msAbs = Math.abs(ms);
|
157
|
+
if (msAbs >= d) {
|
158
|
+
return plural(ms, msAbs, d, 'day');
|
159
|
+
}
|
160
|
+
if (msAbs >= h) {
|
161
|
+
return plural(ms, msAbs, h, 'hour');
|
162
|
+
}
|
163
|
+
if (msAbs >= m) {
|
164
|
+
return plural(ms, msAbs, m, 'minute');
|
165
|
+
}
|
166
|
+
if (msAbs >= s) {
|
167
|
+
return plural(ms, msAbs, s, 'second');
|
168
|
+
}
|
169
|
+
return ms + ' ms';
|
170
|
+
}
|
171
|
+
/**
|
172
|
+
* Pluralization helper.
|
173
|
+
*/ function plural(ms, msAbs, n, name) {
|
174
|
+
var isPlural = msAbs >= n * 1.5;
|
175
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
176
|
+
}
|
177
|
+
return ms;
|
167
178
|
}
|
168
179
|
|
169
180
|
/**
|
@@ -171,1006 +182,942 @@ var y = d * 365.25;
|
|
171
182
|
* implementations of `debug()`.
|
172
183
|
*/
|
173
184
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
|
194
|
-
}
|
195
|
-
function
|
196
|
-
|
197
|
-
}
|
198
|
-
function
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
185
|
+
var common;
|
186
|
+
var hasRequiredCommon;
|
187
|
+
|
188
|
+
function requireCommon () {
|
189
|
+
if (hasRequiredCommon) return common;
|
190
|
+
hasRequiredCommon = 1;
|
191
|
+
function _array_like_to_array(arr, len) {
|
192
|
+
if (len == null || len > arr.length) len = arr.length;
|
193
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
194
|
+
return arr2;
|
195
|
+
}
|
196
|
+
function _array_without_holes(arr) {
|
197
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
198
|
+
}
|
199
|
+
function _instanceof(left, right) {
|
200
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
201
|
+
return !!right[Symbol.hasInstance](left);
|
202
|
+
} else {
|
203
|
+
return left instanceof right;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
function _iterable_to_array(iter) {
|
207
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
208
|
+
}
|
209
|
+
function _non_iterable_spread() {
|
210
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
211
|
+
}
|
212
|
+
function _to_consumable_array(arr) {
|
213
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
214
|
+
}
|
215
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
216
|
+
if (!o) return;
|
217
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
218
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
219
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
220
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
221
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
222
|
+
}
|
223
|
+
function setup(env) {
|
224
|
+
createDebug.debug = createDebug;
|
225
|
+
createDebug.default = createDebug;
|
226
|
+
createDebug.coerce = coerce;
|
227
|
+
createDebug.disable = disable;
|
228
|
+
createDebug.enable = enable;
|
229
|
+
createDebug.enabled = enabled;
|
230
|
+
createDebug.humanize = requireMs();
|
231
|
+
createDebug.destroy = destroy;
|
232
|
+
Object.keys(env).forEach(function(key) {
|
233
|
+
createDebug[key] = env[key];
|
234
|
+
});
|
235
|
+
/**
|
236
|
+
* The currently active debug mode names, and names to skip.
|
237
|
+
*/ createDebug.names = [];
|
238
|
+
createDebug.skips = [];
|
239
|
+
/**
|
240
|
+
* Map of special "%n" handling functions, for the debug "format" argument.
|
241
|
+
*
|
242
|
+
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
243
|
+
*/ createDebug.formatters = {};
|
244
|
+
/**
|
245
|
+
* Selects a color for a debug namespace
|
246
|
+
* @param {String} namespace The namespace string for the debug instance to be colored
|
247
|
+
* @return {Number|String} An ANSI color code for the given namespace
|
248
|
+
* @api private
|
249
|
+
*/ function selectColor(namespace) {
|
250
|
+
var hash = 0;
|
251
|
+
for(var i = 0; i < namespace.length; i++){
|
252
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
253
|
+
hash |= 0; // Convert to 32bit integer
|
254
|
+
}
|
255
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
256
|
+
}
|
257
|
+
createDebug.selectColor = selectColor;
|
258
|
+
/**
|
259
|
+
* Create a debugger with the given `namespace`.
|
260
|
+
*
|
261
|
+
* @param {String} namespace
|
262
|
+
* @return {Function}
|
263
|
+
* @api public
|
264
|
+
*/ function createDebug(namespace) {
|
265
|
+
var prevTime;
|
266
|
+
var enableOverride = null;
|
267
|
+
var namespacesCache;
|
268
|
+
var enabledCache;
|
269
|
+
function debug() {
|
270
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
271
|
+
args[_key] = arguments[_key];
|
272
|
+
}
|
273
|
+
// Disabled?
|
274
|
+
if (!debug.enabled) {
|
275
|
+
return;
|
276
|
+
}
|
277
|
+
var self = debug;
|
278
|
+
// Set `diff` timestamp
|
279
|
+
var curr = Number(new Date());
|
280
|
+
var ms = curr - (prevTime || curr);
|
281
|
+
self.diff = ms;
|
282
|
+
self.prev = prevTime;
|
283
|
+
self.curr = curr;
|
284
|
+
prevTime = curr;
|
285
|
+
args[0] = createDebug.coerce(args[0]);
|
286
|
+
if (typeof args[0] !== 'string') {
|
287
|
+
// Anything else let's inspect with %O
|
288
|
+
args.unshift('%O');
|
289
|
+
}
|
290
|
+
// Apply any `formatters` transformations
|
291
|
+
var index = 0;
|
292
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
|
293
|
+
// If we encounter an escaped % then don't increase the array index
|
294
|
+
if (match === '%%') {
|
295
|
+
return '%';
|
296
|
+
}
|
297
|
+
index++;
|
298
|
+
var formatter = createDebug.formatters[format];
|
299
|
+
if (typeof formatter === 'function') {
|
300
|
+
var val = args[index];
|
301
|
+
match = formatter.call(self, val);
|
302
|
+
// Now we need to remove `args[index]` since it's inlined in the `format`
|
303
|
+
args.splice(index, 1);
|
304
|
+
index--;
|
305
|
+
}
|
306
|
+
return match;
|
307
|
+
});
|
308
|
+
// Apply env-specific formatting (colors, etc.)
|
309
|
+
createDebug.formatArgs.call(self, args);
|
310
|
+
var logFn = self.log || createDebug.log;
|
311
|
+
logFn.apply(self, args);
|
312
|
+
}
|
313
|
+
debug.namespace = namespace;
|
314
|
+
debug.useColors = createDebug.useColors();
|
315
|
+
debug.color = createDebug.selectColor(namespace);
|
316
|
+
debug.extend = extend;
|
317
|
+
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
318
|
+
Object.defineProperty(debug, 'enabled', {
|
319
|
+
enumerable: true,
|
320
|
+
configurable: false,
|
321
|
+
get: function() {
|
322
|
+
if (enableOverride !== null) {
|
323
|
+
return enableOverride;
|
324
|
+
}
|
325
|
+
if (namespacesCache !== createDebug.namespaces) {
|
326
|
+
namespacesCache = createDebug.namespaces;
|
327
|
+
enabledCache = createDebug.enabled(namespace);
|
328
|
+
}
|
329
|
+
return enabledCache;
|
330
|
+
},
|
331
|
+
set: function(v) {
|
332
|
+
enableOverride = v;
|
333
|
+
}
|
334
|
+
});
|
335
|
+
// Env-specific initialization logic for debug instances
|
336
|
+
if (typeof createDebug.init === 'function') {
|
337
|
+
createDebug.init(debug);
|
338
|
+
}
|
339
|
+
return debug;
|
340
|
+
}
|
341
|
+
function extend(namespace, delimiter) {
|
342
|
+
var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
343
|
+
newDebug.log = this.log;
|
344
|
+
return newDebug;
|
345
|
+
}
|
346
|
+
/**
|
347
|
+
* Enables a debug mode by namespaces. This can include modes
|
348
|
+
* separated by a colon and wildcards.
|
349
|
+
*
|
350
|
+
* @param {String} namespaces
|
351
|
+
* @api public
|
352
|
+
*/ function enable(namespaces) {
|
353
|
+
createDebug.save(namespaces);
|
354
|
+
createDebug.namespaces = namespaces;
|
355
|
+
createDebug.names = [];
|
356
|
+
createDebug.skips = [];
|
357
|
+
var split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean);
|
358
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
359
|
+
try {
|
360
|
+
for(var _iterator = split[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
361
|
+
var ns = _step.value;
|
362
|
+
if (ns[0] === '-') {
|
363
|
+
createDebug.skips.push(ns.slice(1));
|
364
|
+
} else {
|
365
|
+
createDebug.names.push(ns);
|
366
|
+
}
|
367
|
+
}
|
368
|
+
} catch (err) {
|
369
|
+
_didIteratorError = true;
|
370
|
+
_iteratorError = err;
|
371
|
+
} finally{
|
372
|
+
try {
|
373
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
374
|
+
_iterator.return();
|
375
|
+
}
|
376
|
+
} finally{
|
377
|
+
if (_didIteratorError) {
|
378
|
+
throw _iteratorError;
|
379
|
+
}
|
380
|
+
}
|
381
|
+
}
|
382
|
+
}
|
383
|
+
/**
|
384
|
+
* Checks if the given string matches a namespace template, honoring
|
385
|
+
* asterisks as wildcards.
|
386
|
+
*
|
387
|
+
* @param {String} search
|
388
|
+
* @param {String} template
|
389
|
+
* @return {Boolean}
|
390
|
+
*/ function matchesTemplate(search, template) {
|
391
|
+
var searchIndex = 0;
|
392
|
+
var templateIndex = 0;
|
393
|
+
var starIndex = -1;
|
394
|
+
var matchIndex = 0;
|
395
|
+
while(searchIndex < search.length){
|
396
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
397
|
+
// Match character or proceed with wildcard
|
398
|
+
if (template[templateIndex] === '*') {
|
399
|
+
starIndex = templateIndex;
|
400
|
+
matchIndex = searchIndex;
|
401
|
+
templateIndex++; // Skip the '*'
|
402
|
+
} else {
|
403
|
+
searchIndex++;
|
404
|
+
templateIndex++;
|
405
|
+
}
|
406
|
+
} else if (starIndex !== -1) {
|
407
|
+
// Backtrack to the last '*' and try to match more characters
|
408
|
+
templateIndex = starIndex + 1;
|
409
|
+
matchIndex++;
|
410
|
+
searchIndex = matchIndex;
|
411
|
+
} else {
|
412
|
+
return false; // No match
|
413
|
+
}
|
414
|
+
}
|
415
|
+
// Handle trailing '*' in template
|
416
|
+
while(templateIndex < template.length && template[templateIndex] === '*'){
|
417
|
+
templateIndex++;
|
418
|
+
}
|
419
|
+
return templateIndex === template.length;
|
420
|
+
}
|
421
|
+
/**
|
422
|
+
* Disable debug output.
|
423
|
+
*
|
424
|
+
* @return {String} namespaces
|
425
|
+
* @api public
|
426
|
+
*/ function disable() {
|
427
|
+
var namespaces = _to_consumable_array(createDebug.names).concat(_to_consumable_array(createDebug.skips.map(function(namespace) {
|
428
|
+
return '-' + namespace;
|
429
|
+
}))).join(',');
|
430
|
+
createDebug.enable('');
|
431
|
+
return namespaces;
|
432
|
+
}
|
433
|
+
/**
|
434
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
435
|
+
*
|
436
|
+
* @param {String} name
|
437
|
+
* @return {Boolean}
|
438
|
+
* @api public
|
439
|
+
*/ function enabled(name) {
|
440
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
441
|
+
try {
|
442
|
+
for(var _iterator = createDebug.skips[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
443
|
+
var skip = _step.value;
|
444
|
+
if (matchesTemplate(name, skip)) {
|
445
|
+
return false;
|
446
|
+
}
|
447
|
+
}
|
448
|
+
} catch (err) {
|
449
|
+
_didIteratorError = true;
|
450
|
+
_iteratorError = err;
|
451
|
+
} finally{
|
452
|
+
try {
|
453
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
454
|
+
_iterator.return();
|
455
|
+
}
|
456
|
+
} finally{
|
457
|
+
if (_didIteratorError) {
|
458
|
+
throw _iteratorError;
|
459
|
+
}
|
460
|
+
}
|
461
|
+
}
|
462
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
463
|
+
try {
|
464
|
+
for(var _iterator1 = createDebug.names[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
465
|
+
var ns = _step1.value;
|
466
|
+
if (matchesTemplate(name, ns)) {
|
467
|
+
return true;
|
468
|
+
}
|
469
|
+
}
|
470
|
+
} catch (err) {
|
471
|
+
_didIteratorError1 = true;
|
472
|
+
_iteratorError1 = err;
|
473
|
+
} finally{
|
474
|
+
try {
|
475
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
476
|
+
_iterator1.return();
|
477
|
+
}
|
478
|
+
} finally{
|
479
|
+
if (_didIteratorError1) {
|
480
|
+
throw _iteratorError1;
|
481
|
+
}
|
482
|
+
}
|
483
|
+
}
|
484
|
+
return false;
|
485
|
+
}
|
486
|
+
/**
|
487
|
+
* Coerce `val`.
|
488
|
+
*
|
489
|
+
* @param {Mixed} val
|
490
|
+
* @return {Mixed}
|
491
|
+
* @api private
|
492
|
+
*/ function coerce(val) {
|
493
|
+
if (_instanceof(val, Error)) {
|
494
|
+
return val.stack || val.message;
|
495
|
+
}
|
496
|
+
return val;
|
497
|
+
}
|
498
|
+
/**
|
499
|
+
* XXX DO NOT USE. This is a temporary stub function.
|
500
|
+
* XXX It WILL be removed in the next major release.
|
501
|
+
*/ function destroy() {
|
502
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
503
|
+
}
|
504
|
+
createDebug.enable(createDebug.load());
|
505
|
+
return createDebug;
|
506
|
+
}
|
507
|
+
common = setup;
|
508
|
+
return common;
|
489
509
|
}
|
490
|
-
var common = setup;
|
491
510
|
|
492
511
|
/* eslint-env browser */
|
493
512
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
exports
|
500
|
-
|
501
|
-
|
502
|
-
exports.
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
}
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
513
|
+
var hasRequiredBrowser$1;
|
514
|
+
|
515
|
+
function requireBrowser$1 () {
|
516
|
+
if (hasRequiredBrowser$1) return browser$1.exports;
|
517
|
+
hasRequiredBrowser$1 = 1;
|
518
|
+
(function (module, exports) {
|
519
|
+
/**
|
520
|
+
* This is the web browser implementation of `debug()`.
|
521
|
+
*/ exports.formatArgs = formatArgs;
|
522
|
+
exports.save = save;
|
523
|
+
exports.load = load;
|
524
|
+
exports.useColors = useColors;
|
525
|
+
exports.storage = localstorage();
|
526
|
+
exports.destroy = function() {
|
527
|
+
var warned = false;
|
528
|
+
return function() {
|
529
|
+
if (!warned) {
|
530
|
+
warned = true;
|
531
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
532
|
+
}
|
533
|
+
};
|
534
|
+
}();
|
535
|
+
/**
|
536
|
+
* Colors.
|
537
|
+
*/ exports.colors = [
|
538
|
+
'#0000CC',
|
539
|
+
'#0000FF',
|
540
|
+
'#0033CC',
|
541
|
+
'#0033FF',
|
542
|
+
'#0066CC',
|
543
|
+
'#0066FF',
|
544
|
+
'#0099CC',
|
545
|
+
'#0099FF',
|
546
|
+
'#00CC00',
|
547
|
+
'#00CC33',
|
548
|
+
'#00CC66',
|
549
|
+
'#00CC99',
|
550
|
+
'#00CCCC',
|
551
|
+
'#00CCFF',
|
552
|
+
'#3300CC',
|
553
|
+
'#3300FF',
|
554
|
+
'#3333CC',
|
555
|
+
'#3333FF',
|
556
|
+
'#3366CC',
|
557
|
+
'#3366FF',
|
558
|
+
'#3399CC',
|
559
|
+
'#3399FF',
|
560
|
+
'#33CC00',
|
561
|
+
'#33CC33',
|
562
|
+
'#33CC66',
|
563
|
+
'#33CC99',
|
564
|
+
'#33CCCC',
|
565
|
+
'#33CCFF',
|
566
|
+
'#6600CC',
|
567
|
+
'#6600FF',
|
568
|
+
'#6633CC',
|
569
|
+
'#6633FF',
|
570
|
+
'#66CC00',
|
571
|
+
'#66CC33',
|
572
|
+
'#9900CC',
|
573
|
+
'#9900FF',
|
574
|
+
'#9933CC',
|
575
|
+
'#9933FF',
|
576
|
+
'#99CC00',
|
577
|
+
'#99CC33',
|
578
|
+
'#CC0000',
|
579
|
+
'#CC0033',
|
580
|
+
'#CC0066',
|
581
|
+
'#CC0099',
|
582
|
+
'#CC00CC',
|
583
|
+
'#CC00FF',
|
584
|
+
'#CC3300',
|
585
|
+
'#CC3333',
|
586
|
+
'#CC3366',
|
587
|
+
'#CC3399',
|
588
|
+
'#CC33CC',
|
589
|
+
'#CC33FF',
|
590
|
+
'#CC6600',
|
591
|
+
'#CC6633',
|
592
|
+
'#CC9900',
|
593
|
+
'#CC9933',
|
594
|
+
'#CCCC00',
|
595
|
+
'#CCCC33',
|
596
|
+
'#FF0000',
|
597
|
+
'#FF0033',
|
598
|
+
'#FF0066',
|
599
|
+
'#FF0099',
|
600
|
+
'#FF00CC',
|
601
|
+
'#FF00FF',
|
602
|
+
'#FF3300',
|
603
|
+
'#FF3333',
|
604
|
+
'#FF3366',
|
605
|
+
'#FF3399',
|
606
|
+
'#FF33CC',
|
607
|
+
'#FF33FF',
|
608
|
+
'#FF6600',
|
609
|
+
'#FF6633',
|
610
|
+
'#FF9900',
|
611
|
+
'#FF9933',
|
612
|
+
'#FFCC00',
|
613
|
+
'#FFCC33'
|
614
|
+
];
|
615
|
+
/**
|
616
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
617
|
+
* and the Firebug extension (any Firefox version) are known
|
618
|
+
* to support "%c" CSS customizations.
|
619
|
+
*
|
620
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
621
|
+
*/ // eslint-disable-next-line complexity
|
622
|
+
function useColors() {
|
623
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
624
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
625
|
+
// explicitly
|
626
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
627
|
+
return true;
|
628
|
+
}
|
629
|
+
// Internet Explorer and Edge do not support colors.
|
630
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
631
|
+
return false;
|
632
|
+
}
|
633
|
+
var m;
|
634
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
635
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
636
|
+
// eslint-disable-next-line no-return-assign
|
637
|
+
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
638
|
+
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
639
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
640
|
+
typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
641
|
+
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
642
|
+
}
|
643
|
+
/**
|
644
|
+
* Colorize log arguments if enabled.
|
645
|
+
*
|
646
|
+
* @api public
|
647
|
+
*/ function formatArgs(args) {
|
648
|
+
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
649
|
+
if (!this.useColors) {
|
650
|
+
return;
|
651
|
+
}
|
652
|
+
var c = 'color: ' + this.color;
|
653
|
+
args.splice(1, 0, c, 'color: inherit');
|
654
|
+
// The final "%c" is somewhat tricky, because there could be other
|
655
|
+
// arguments passed either before or after the %c, so we need to
|
656
|
+
// figure out the correct index to insert the CSS into
|
657
|
+
var index = 0;
|
658
|
+
var lastC = 0;
|
659
|
+
args[0].replace(/%[a-zA-Z%]/g, function(match) {
|
660
|
+
if (match === '%%') {
|
661
|
+
return;
|
662
|
+
}
|
663
|
+
index++;
|
664
|
+
if (match === '%c') {
|
665
|
+
// We only are interested in the *last* %c
|
666
|
+
// (the user may have provided their own)
|
667
|
+
lastC = index;
|
668
|
+
}
|
669
|
+
});
|
670
|
+
args.splice(lastC, 0, c);
|
671
|
+
}
|
672
|
+
/**
|
673
|
+
* Invokes `console.debug()` when available.
|
674
|
+
* No-op when `console.debug` is not a "function".
|
675
|
+
* If `console.debug` is not available, falls back
|
676
|
+
* to `console.log`.
|
677
|
+
*
|
678
|
+
* @api public
|
679
|
+
*/ exports.log = console.debug || console.log || function() {};
|
680
|
+
/**
|
681
|
+
* Save `namespaces`.
|
682
|
+
*
|
683
|
+
* @param {String} namespaces
|
684
|
+
* @api private
|
685
|
+
*/ function save(namespaces) {
|
686
|
+
try {
|
687
|
+
if (namespaces) {
|
688
|
+
exports.storage.setItem('debug', namespaces);
|
689
|
+
} else {
|
690
|
+
exports.storage.removeItem('debug');
|
691
|
+
}
|
692
|
+
} catch (error) {
|
693
|
+
// Swallow
|
694
|
+
// XXX (@Qix-) should we be logging these?
|
695
|
+
}
|
696
|
+
}
|
697
|
+
/**
|
698
|
+
* Load `namespaces`.
|
699
|
+
*
|
700
|
+
* @return {String} returns the previously persisted debug modes
|
701
|
+
* @api private
|
702
|
+
*/ function load() {
|
703
|
+
var r;
|
704
|
+
try {
|
705
|
+
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG');
|
706
|
+
} catch (error) {
|
707
|
+
// Swallow
|
708
|
+
// XXX (@Qix-) should we be logging these?
|
709
|
+
}
|
710
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
711
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
712
|
+
r = process.env.DEBUG;
|
713
|
+
}
|
714
|
+
return r;
|
715
|
+
}
|
716
|
+
/**
|
717
|
+
* Localstorage attempts to return the localstorage.
|
718
|
+
*
|
719
|
+
* This is necessary because safari throws
|
720
|
+
* when a user disables cookies/localstorage
|
721
|
+
* and you attempt to access it.
|
722
|
+
*
|
723
|
+
* @return {LocalStorage}
|
724
|
+
* @api private
|
725
|
+
*/ function localstorage() {
|
726
|
+
try {
|
727
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
728
|
+
// The Browser also has localStorage in the global context.
|
729
|
+
return localStorage;
|
730
|
+
} catch (error) {
|
731
|
+
// Swallow
|
732
|
+
// XXX (@Qix-) should we be logging these?
|
733
|
+
}
|
734
|
+
}
|
735
|
+
module.exports = requireCommon()(exports);
|
736
|
+
var formatters = module.exports.formatters;
|
737
|
+
/**
|
738
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
739
|
+
*/ formatters.j = function(v) {
|
740
|
+
try {
|
741
|
+
return JSON.stringify(v);
|
742
|
+
} catch (error) {
|
743
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
744
|
+
}
|
745
|
+
};
|
746
|
+
} (browser$1, browser$1.exports));
|
747
|
+
return browser$1.exports;
|
710
748
|
}
|
711
|
-
module.exports = common(exports);
|
712
|
-
var formatters = module.exports.formatters;
|
713
|
-
/**
|
714
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
715
|
-
*/ formatters.j = function(v) {
|
716
|
-
try {
|
717
|
-
return JSON.stringify(v);
|
718
|
-
} catch (error) {
|
719
|
-
return "[UnexpectedJSONParseError]: " + error.message;
|
720
|
-
}
|
721
|
-
};
|
722
|
-
}(browser, browser.exports));
|
723
749
|
|
724
750
|
var node = {
|
725
751
|
exports: {}
|
726
752
|
};
|
727
753
|
|
728
|
-
|
729
|
-
var argv = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : process.argv;
|
730
|
-
var prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
731
|
-
var position = argv.indexOf(prefix + flag);
|
732
|
-
var terminatorPosition = argv.indexOf("--");
|
733
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
734
|
-
};
|
754
|
+
/* eslint-env browser */
|
735
755
|
|
736
|
-
var
|
737
|
-
var
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
}
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
level: level,
|
761
|
-
hasBasic: true,
|
762
|
-
has256: level >= 2,
|
763
|
-
has16m: level >= 3
|
764
|
-
};
|
765
|
-
}
|
766
|
-
function supportsColor(haveStream, streamIsTTY) {
|
767
|
-
if (forceColor === 0) {
|
768
|
-
return 0;
|
769
|
-
}
|
770
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
771
|
-
return 3;
|
772
|
-
}
|
773
|
-
if (hasFlag("color=256")) {
|
774
|
-
return 2;
|
775
|
-
}
|
776
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
777
|
-
return 0;
|
778
|
-
}
|
779
|
-
var min = forceColor || 0;
|
780
|
-
if (env.TERM === "dumb") {
|
781
|
-
return min;
|
782
|
-
}
|
783
|
-
if (process.platform === "win32") {
|
784
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
785
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
786
|
-
var osRelease = os.release().split(".");
|
787
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
788
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
789
|
-
}
|
790
|
-
return 1;
|
791
|
-
}
|
792
|
-
if ("CI" in env) {
|
793
|
-
if ([
|
794
|
-
"TRAVIS",
|
795
|
-
"CIRCLECI",
|
796
|
-
"APPVEYOR",
|
797
|
-
"GITLAB_CI",
|
798
|
-
"GITHUB_ACTIONS",
|
799
|
-
"BUILDKITE"
|
800
|
-
].some(function(sign) {
|
801
|
-
return sign in env;
|
802
|
-
}) || env.CI_NAME === "codeship") {
|
803
|
-
return 1;
|
804
|
-
}
|
805
|
-
return min;
|
806
|
-
}
|
807
|
-
if ("TEAMCITY_VERSION" in env) {
|
808
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
809
|
-
}
|
810
|
-
if (env.COLORTERM === "truecolor") {
|
811
|
-
return 3;
|
812
|
-
}
|
813
|
-
if ("TERM_PROGRAM" in env) {
|
814
|
-
var version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
815
|
-
switch(env.TERM_PROGRAM){
|
816
|
-
case "iTerm.app":
|
817
|
-
return version >= 3 ? 3 : 2;
|
818
|
-
case "Apple_Terminal":
|
819
|
-
return 2;
|
820
|
-
}
|
821
|
-
}
|
822
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
823
|
-
return 2;
|
824
|
-
}
|
825
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
826
|
-
return 1;
|
827
|
-
}
|
828
|
-
if ("COLORTERM" in env) {
|
829
|
-
return 1;
|
830
|
-
}
|
831
|
-
return min;
|
832
|
-
}
|
833
|
-
function getSupportLevel(stream) {
|
834
|
-
var level = supportsColor(stream, stream && stream.isTTY);
|
835
|
-
return translateLevel(level);
|
756
|
+
var browser;
|
757
|
+
var hasRequiredBrowser;
|
758
|
+
|
759
|
+
function requireBrowser () {
|
760
|
+
if (hasRequiredBrowser) return browser;
|
761
|
+
hasRequiredBrowser = 1;
|
762
|
+
function getChromeVersion() {
|
763
|
+
var matches = RegExp("(Chrome|Chromium)\\/(?<chromeVersion>\\d+)\\.").exec(navigator.userAgent);
|
764
|
+
if (!matches) {
|
765
|
+
return;
|
766
|
+
}
|
767
|
+
return Number.parseInt(matches.groups.chromeVersion, 10);
|
768
|
+
}
|
769
|
+
var colorSupport = getChromeVersion() >= 69 ? {
|
770
|
+
level: 1,
|
771
|
+
hasBasic: true,
|
772
|
+
has256: false,
|
773
|
+
has16m: false
|
774
|
+
} : false;
|
775
|
+
browser = {
|
776
|
+
stdout: colorSupport,
|
777
|
+
stderr: colorSupport
|
778
|
+
};
|
779
|
+
return browser;
|
836
780
|
}
|
837
|
-
var supportsColor_1 = {
|
838
|
-
supportsColor: getSupportLevel,
|
839
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
840
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
841
|
-
};
|
842
781
|
|
843
782
|
/**
|
844
783
|
* Module dependencies.
|
845
784
|
*/
|
846
785
|
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
function
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
var
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
exports.
|
883
|
-
exports.
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
}
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
}
|
1011
|
-
/**
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
}
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
}
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
786
|
+
var hasRequiredNode;
|
787
|
+
|
788
|
+
function requireNode () {
|
789
|
+
if (hasRequiredNode) return node.exports;
|
790
|
+
hasRequiredNode = 1;
|
791
|
+
(function (module, exports) {
|
792
|
+
function _array_like_to_array(arr, len) {
|
793
|
+
if (len == null || len > arr.length) len = arr.length;
|
794
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
795
|
+
return arr2;
|
796
|
+
}
|
797
|
+
function _array_without_holes(arr) {
|
798
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
799
|
+
}
|
800
|
+
function _iterable_to_array(iter) {
|
801
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
802
|
+
}
|
803
|
+
function _non_iterable_spread() {
|
804
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
805
|
+
}
|
806
|
+
function _to_consumable_array(arr) {
|
807
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
808
|
+
}
|
809
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
810
|
+
if (!o) return;
|
811
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
812
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
813
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
814
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
815
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
816
|
+
}
|
817
|
+
var tty = require$$0;
|
818
|
+
var util = require$$1;
|
819
|
+
/**
|
820
|
+
* This is the Node.js implementation of `debug()`.
|
821
|
+
*/ exports.init = init;
|
822
|
+
exports.log = log;
|
823
|
+
exports.formatArgs = formatArgs;
|
824
|
+
exports.save = save;
|
825
|
+
exports.load = load;
|
826
|
+
exports.useColors = useColors;
|
827
|
+
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`.');
|
828
|
+
/**
|
829
|
+
* Colors.
|
830
|
+
*/ exports.colors = [
|
831
|
+
6,
|
832
|
+
2,
|
833
|
+
3,
|
834
|
+
4,
|
835
|
+
5,
|
836
|
+
1
|
837
|
+
];
|
838
|
+
try {
|
839
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
840
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
841
|
+
var supportsColor = requireBrowser();
|
842
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
843
|
+
exports.colors = [
|
844
|
+
20,
|
845
|
+
21,
|
846
|
+
26,
|
847
|
+
27,
|
848
|
+
32,
|
849
|
+
33,
|
850
|
+
38,
|
851
|
+
39,
|
852
|
+
40,
|
853
|
+
41,
|
854
|
+
42,
|
855
|
+
43,
|
856
|
+
44,
|
857
|
+
45,
|
858
|
+
56,
|
859
|
+
57,
|
860
|
+
62,
|
861
|
+
63,
|
862
|
+
68,
|
863
|
+
69,
|
864
|
+
74,
|
865
|
+
75,
|
866
|
+
76,
|
867
|
+
77,
|
868
|
+
78,
|
869
|
+
79,
|
870
|
+
80,
|
871
|
+
81,
|
872
|
+
92,
|
873
|
+
93,
|
874
|
+
98,
|
875
|
+
99,
|
876
|
+
112,
|
877
|
+
113,
|
878
|
+
128,
|
879
|
+
129,
|
880
|
+
134,
|
881
|
+
135,
|
882
|
+
148,
|
883
|
+
149,
|
884
|
+
160,
|
885
|
+
161,
|
886
|
+
162,
|
887
|
+
163,
|
888
|
+
164,
|
889
|
+
165,
|
890
|
+
166,
|
891
|
+
167,
|
892
|
+
168,
|
893
|
+
169,
|
894
|
+
170,
|
895
|
+
171,
|
896
|
+
172,
|
897
|
+
173,
|
898
|
+
178,
|
899
|
+
179,
|
900
|
+
184,
|
901
|
+
185,
|
902
|
+
196,
|
903
|
+
197,
|
904
|
+
198,
|
905
|
+
199,
|
906
|
+
200,
|
907
|
+
201,
|
908
|
+
202,
|
909
|
+
203,
|
910
|
+
204,
|
911
|
+
205,
|
912
|
+
206,
|
913
|
+
207,
|
914
|
+
208,
|
915
|
+
209,
|
916
|
+
214,
|
917
|
+
215,
|
918
|
+
220,
|
919
|
+
221
|
920
|
+
];
|
921
|
+
}
|
922
|
+
} catch (error) {
|
923
|
+
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
924
|
+
}
|
925
|
+
/**
|
926
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
927
|
+
*
|
928
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
929
|
+
*/ exports.inspectOpts = Object.keys(process.env).filter(function(key) {
|
930
|
+
return /^debug_/i.test(key);
|
931
|
+
}).reduce(function(obj, key) {
|
932
|
+
// Camel-case
|
933
|
+
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
|
934
|
+
return k.toUpperCase();
|
935
|
+
});
|
936
|
+
// Coerce string value into JS value
|
937
|
+
var val = process.env[key];
|
938
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
939
|
+
val = true;
|
940
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
941
|
+
val = false;
|
942
|
+
} else if (val === 'null') {
|
943
|
+
val = null;
|
944
|
+
} else {
|
945
|
+
val = Number(val);
|
946
|
+
}
|
947
|
+
obj[prop] = val;
|
948
|
+
return obj;
|
949
|
+
}, {});
|
950
|
+
/**
|
951
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
952
|
+
*/ function useColors() {
|
953
|
+
return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
954
|
+
}
|
955
|
+
/**
|
956
|
+
* Adds ANSI color escape codes if enabled.
|
957
|
+
*
|
958
|
+
* @api public
|
959
|
+
*/ function formatArgs(args) {
|
960
|
+
var _this = this, name = _this.namespace, _$useColors = _this.useColors;
|
961
|
+
if (_$useColors) {
|
962
|
+
var c = this.color;
|
963
|
+
var colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
964
|
+
var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1b[0m");
|
965
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
966
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
967
|
+
} else {
|
968
|
+
args[0] = getDate() + name + ' ' + args[0];
|
969
|
+
}
|
970
|
+
}
|
971
|
+
function getDate() {
|
972
|
+
if (exports.inspectOpts.hideDate) {
|
973
|
+
return '';
|
974
|
+
}
|
975
|
+
return new Date().toISOString() + ' ';
|
976
|
+
}
|
977
|
+
/**
|
978
|
+
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
979
|
+
*/ function log() {
|
980
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
981
|
+
args[_key] = arguments[_key];
|
982
|
+
}
|
983
|
+
var _util;
|
984
|
+
return process.stderr.write((_util = util).formatWithOptions.apply(_util, [
|
985
|
+
exports.inspectOpts
|
986
|
+
].concat(_to_consumable_array(args))) + '\n');
|
987
|
+
}
|
988
|
+
/**
|
989
|
+
* Save `namespaces`.
|
990
|
+
*
|
991
|
+
* @param {String} namespaces
|
992
|
+
* @api private
|
993
|
+
*/ function save(namespaces) {
|
994
|
+
if (namespaces) {
|
995
|
+
process.env.DEBUG = namespaces;
|
996
|
+
} else {
|
997
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
998
|
+
// string 'null' or 'undefined'. Just delete instead.
|
999
|
+
delete process.env.DEBUG;
|
1000
|
+
}
|
1001
|
+
}
|
1002
|
+
/**
|
1003
|
+
* Load `namespaces`.
|
1004
|
+
*
|
1005
|
+
* @return {String} returns the previously persisted debug modes
|
1006
|
+
* @api private
|
1007
|
+
*/ function load() {
|
1008
|
+
return process.env.DEBUG;
|
1009
|
+
}
|
1010
|
+
/**
|
1011
|
+
* Init logic for `debug` instances.
|
1012
|
+
*
|
1013
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
1014
|
+
* differently for a particular `debug` instance.
|
1015
|
+
*/ function init(debug) {
|
1016
|
+
debug.inspectOpts = {};
|
1017
|
+
var keys = Object.keys(exports.inspectOpts);
|
1018
|
+
for(var i = 0; i < keys.length; i++){
|
1019
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
1020
|
+
}
|
1021
|
+
}
|
1022
|
+
module.exports = requireCommon()(exports);
|
1023
|
+
var formatters = module.exports.formatters;
|
1024
|
+
/**
|
1025
|
+
* Map %o to `util.inspect()`, all on a single line.
|
1026
|
+
*/ formatters.o = function(v) {
|
1027
|
+
this.inspectOpts.colors = this.useColors;
|
1028
|
+
return util.inspect(v, this.inspectOpts).split('\n').map(function(str) {
|
1029
|
+
return str.trim();
|
1030
|
+
}).join(' ');
|
1031
|
+
};
|
1032
|
+
/**
|
1033
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
1034
|
+
*/ formatters.O = function(v) {
|
1035
|
+
this.inspectOpts.colors = this.useColors;
|
1036
|
+
return util.inspect(v, this.inspectOpts);
|
1037
|
+
};
|
1038
|
+
} (node, node.exports));
|
1039
|
+
return node.exports;
|
1077
1040
|
}
|
1078
|
-
module.exports = common(exports);
|
1079
|
-
var formatters = module.exports.formatters;
|
1080
|
-
/**
|
1081
|
-
* Map %o to `util.inspect()`, all on a single line.
|
1082
|
-
*/ formatters.o = function(v) {
|
1083
|
-
this.inspectOpts.colors = this.useColors;
|
1084
|
-
return util.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
1085
|
-
return str.trim();
|
1086
|
-
}).join(" ");
|
1087
|
-
};
|
1088
|
-
/**
|
1089
|
-
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
1090
|
-
*/ formatters.O = function(v) {
|
1091
|
-
this.inspectOpts.colors = this.useColors;
|
1092
|
-
return util.inspect(v, this.inspectOpts);
|
1093
|
-
};
|
1094
|
-
}(node, node.exports));
|
1095
1041
|
|
1096
1042
|
/**
|
1097
1043
|
* Detect Electron renderer / nwjs process, which is node, but we should
|
1098
1044
|
* treat as a browser.
|
1099
1045
|
*/
|
1100
1046
|
|
1101
|
-
if (typeof process ===
|
1102
|
-
src.exports =
|
1047
|
+
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
1048
|
+
src.exports = requireBrowser$1();
|
1103
1049
|
} else {
|
1104
|
-
src.exports =
|
1050
|
+
src.exports = requireNode();
|
1105
1051
|
}
|
1106
1052
|
|
1107
|
-
var
|
1053
|
+
var srcExports = src.exports;
|
1054
|
+
var debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
1108
1055
|
|
1109
1056
|
(function (exports) {
|
1110
|
-
var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
};
|
1115
|
-
Object.defineProperty(exports, "__esModule", {
|
1116
|
-
|
1117
|
-
});
|
1118
|
-
var fs_1 = require$$0$1;
|
1119
|
-
var debug_1 = __importDefault(
|
1120
|
-
var log = debug_1.default(
|
1121
|
-
function check(path, isFile, isDirectory) {
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
}
|
1144
|
-
/**
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
}
|
1153
|
-
exports.exists = exists;
|
1154
|
-
/**
|
1155
|
-
|
1156
|
-
|
1157
|
-
/**
|
1158
|
-
|
1159
|
-
|
1160
|
-
/**
|
1161
|
-
|
1162
|
-
|
1163
|
-
}(src$1));
|
1057
|
+
var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
1058
|
+
return mod && mod.__esModule ? mod : {
|
1059
|
+
"default": mod
|
1060
|
+
};
|
1061
|
+
};
|
1062
|
+
Object.defineProperty(exports, "__esModule", {
|
1063
|
+
value: true
|
1064
|
+
});
|
1065
|
+
var fs_1 = require$$0$1;
|
1066
|
+
var debug_1 = __importDefault(srcExports);
|
1067
|
+
var log = debug_1.default('@kwsites/file-exists');
|
1068
|
+
function check(path, isFile, isDirectory) {
|
1069
|
+
log("checking %s", path);
|
1070
|
+
try {
|
1071
|
+
var stat = fs_1.statSync(path);
|
1072
|
+
if (stat.isFile() && isFile) {
|
1073
|
+
log("[OK] path represents a file");
|
1074
|
+
return true;
|
1075
|
+
}
|
1076
|
+
if (stat.isDirectory() && isDirectory) {
|
1077
|
+
log("[OK] path represents a directory");
|
1078
|
+
return true;
|
1079
|
+
}
|
1080
|
+
log("[FAIL] path represents something other than a file or directory");
|
1081
|
+
return false;
|
1082
|
+
} catch (e) {
|
1083
|
+
if (e.code === 'ENOENT') {
|
1084
|
+
log("[FAIL] path is not accessible: %o", e);
|
1085
|
+
return false;
|
1086
|
+
}
|
1087
|
+
log("[FATAL] %o", e);
|
1088
|
+
throw e;
|
1089
|
+
}
|
1090
|
+
}
|
1091
|
+
/**
|
1092
|
+
* Synchronous validation of a path existing either as a file or as a directory.
|
1093
|
+
*
|
1094
|
+
* @param {string} path The path to check
|
1095
|
+
* @param {number} type One or both of the exported numeric constants
|
1096
|
+
*/ function exists(path) {
|
1097
|
+
var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : exports.READABLE;
|
1098
|
+
return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
|
1099
|
+
}
|
1100
|
+
exports.exists = exists;
|
1101
|
+
/**
|
1102
|
+
* Constant representing a file
|
1103
|
+
*/ exports.FILE = 1;
|
1104
|
+
/**
|
1105
|
+
* Constant representing a folder
|
1106
|
+
*/ exports.FOLDER = 2;
|
1107
|
+
/**
|
1108
|
+
* Constant representing either a file or a folder
|
1109
|
+
*/ exports.READABLE = exports.FILE + exports.FOLDER;
|
1110
|
+
} (src$1));
|
1164
1111
|
|
1165
1112
|
(function (exports) {
|
1166
|
-
function __export(m) {
|
1167
|
-
|
1168
|
-
}
|
1169
|
-
Object.defineProperty(exports, "__esModule", {
|
1170
|
-
|
1171
|
-
});
|
1172
|
-
__export(src$1);
|
1173
|
-
}(dist$1));
|
1113
|
+
function __export(m) {
|
1114
|
+
for(var p in m)if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
1115
|
+
}
|
1116
|
+
Object.defineProperty(exports, "__esModule", {
|
1117
|
+
value: true
|
1118
|
+
});
|
1119
|
+
__export(src$1);
|
1120
|
+
} (dist$1));
|
1174
1121
|
|
1175
1122
|
var dist = {};
|
1176
1123
|
|
@@ -1187,7 +1134,7 @@ var createDeferred = dist.createDeferred = deferred_1 = dist.deferred = void 0;
|
|
1187
1134
|
*/ function deferred() {
|
1188
1135
|
var done;
|
1189
1136
|
var fail;
|
1190
|
-
var status =
|
1137
|
+
var status = 'pending';
|
1191
1138
|
var promise = new Promise(function(_done, _fail) {
|
1192
1139
|
done = _done;
|
1193
1140
|
fail = _fail;
|
@@ -1195,19 +1142,19 @@ var createDeferred = dist.createDeferred = deferred_1 = dist.deferred = void 0;
|
|
1195
1142
|
return {
|
1196
1143
|
promise: promise,
|
1197
1144
|
done: function done1(result) {
|
1198
|
-
if (status ===
|
1199
|
-
status =
|
1145
|
+
if (status === 'pending') {
|
1146
|
+
status = 'resolved';
|
1200
1147
|
done(result);
|
1201
1148
|
}
|
1202
1149
|
},
|
1203
1150
|
fail: function fail1(error) {
|
1204
|
-
if (status ===
|
1205
|
-
status =
|
1151
|
+
if (status === 'pending') {
|
1152
|
+
status = 'rejected';
|
1206
1153
|
fail(error);
|
1207
1154
|
}
|
1208
1155
|
},
|
1209
1156
|
get fulfilled () {
|
1210
|
-
return status !==
|
1157
|
+
return status !== 'pending';
|
1211
1158
|
},
|
1212
1159
|
get status () {
|
1213
1160
|
return status;
|
@@ -1248,6 +1195,35 @@ function _assert_this_initialized(self) {
|
|
1248
1195
|
}
|
1249
1196
|
return self;
|
1250
1197
|
}
|
1198
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
1199
|
+
try {
|
1200
|
+
var info = gen[key](arg);
|
1201
|
+
var value = info.value;
|
1202
|
+
} catch (error) {
|
1203
|
+
reject(error);
|
1204
|
+
return;
|
1205
|
+
}
|
1206
|
+
if (info.done) {
|
1207
|
+
resolve(value);
|
1208
|
+
} else {
|
1209
|
+
Promise.resolve(value).then(_next, _throw);
|
1210
|
+
}
|
1211
|
+
}
|
1212
|
+
function _async_to_generator(fn) {
|
1213
|
+
return function() {
|
1214
|
+
var self = this, args = arguments;
|
1215
|
+
return new Promise(function(resolve, reject) {
|
1216
|
+
var gen = fn.apply(self, args);
|
1217
|
+
function _next(value) {
|
1218
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
1219
|
+
}
|
1220
|
+
function _throw(err) {
|
1221
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
1222
|
+
}
|
1223
|
+
_next(undefined);
|
1224
|
+
});
|
1225
|
+
};
|
1226
|
+
}
|
1251
1227
|
function _class_call_check(instance, Constructor) {
|
1252
1228
|
if (!(instance instanceof Constructor)) {
|
1253
1229
|
throw new TypeError("Cannot call a class as a function");
|
@@ -1375,6 +1351,40 @@ function _non_iterable_rest() {
|
|
1375
1351
|
function _non_iterable_spread() {
|
1376
1352
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1377
1353
|
}
|
1354
|
+
function _object_spread(target) {
|
1355
|
+
for(var i = 1; i < arguments.length; i++){
|
1356
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
1357
|
+
var ownKeys = Object.keys(source);
|
1358
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
1359
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
1360
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
1361
|
+
}));
|
1362
|
+
}
|
1363
|
+
ownKeys.forEach(function(key) {
|
1364
|
+
_define_property(target, key, source[key]);
|
1365
|
+
});
|
1366
|
+
}
|
1367
|
+
return target;
|
1368
|
+
}
|
1369
|
+
function ownKeys(object, enumerableOnly) {
|
1370
|
+
var keys = Object.keys(object);
|
1371
|
+
if (Object.getOwnPropertySymbols) {
|
1372
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
1373
|
+
keys.push.apply(keys, symbols);
|
1374
|
+
}
|
1375
|
+
return keys;
|
1376
|
+
}
|
1377
|
+
function _object_spread_props(target, source) {
|
1378
|
+
source = source != null ? source : {};
|
1379
|
+
if (Object.getOwnPropertyDescriptors) {
|
1380
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
1381
|
+
} else {
|
1382
|
+
ownKeys(Object(source)).forEach(function(key) {
|
1383
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
1384
|
+
});
|
1385
|
+
}
|
1386
|
+
return target;
|
1387
|
+
}
|
1378
1388
|
function _possible_constructor_return(self, call) {
|
1379
1389
|
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
1380
1390
|
return call;
|
@@ -1559,48 +1569,9 @@ function _ts_generator(thisArg, body) {
|
|
1559
1569
|
}
|
1560
1570
|
}
|
1561
1571
|
var __defProp = Object.defineProperty;
|
1562
|
-
var __defProps = Object.defineProperties;
|
1563
1572
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
1564
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
1565
1573
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
1566
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
1567
1574
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
1568
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
1569
|
-
var __defNormalProp = function(obj, key, value) {
|
1570
|
-
return key in obj ? __defProp(obj, key, {
|
1571
|
-
enumerable: true,
|
1572
|
-
configurable: true,
|
1573
|
-
writable: true,
|
1574
|
-
value: value
|
1575
|
-
}) : obj[key] = value;
|
1576
|
-
};
|
1577
|
-
var __spreadValues = function(a, b) {
|
1578
|
-
for(var prop in b || (b = {}))if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
1579
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
1580
|
-
if (__getOwnPropSymbols) try {
|
1581
|
-
for(var _iterator = __getOwnPropSymbols(b)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
1582
|
-
var prop = _step.value;
|
1583
|
-
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
1584
|
-
}
|
1585
|
-
} catch (err) {
|
1586
|
-
_didIteratorError = true;
|
1587
|
-
_iteratorError = err;
|
1588
|
-
} finally{
|
1589
|
-
try {
|
1590
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
1591
|
-
_iterator.return();
|
1592
|
-
}
|
1593
|
-
} finally{
|
1594
|
-
if (_didIteratorError) {
|
1595
|
-
throw _iteratorError;
|
1596
|
-
}
|
1597
|
-
}
|
1598
|
-
}
|
1599
|
-
return a;
|
1600
|
-
};
|
1601
|
-
var __spreadProps = function(a, b) {
|
1602
|
-
return __defProps(a, __getOwnPropDescs(b));
|
1603
|
-
};
|
1604
1575
|
var __esm = function(fn, res) {
|
1605
1576
|
return function __init() {
|
1606
1577
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
@@ -1620,7 +1591,7 @@ var __export = function(target, all) {
|
|
1620
1591
|
});
|
1621
1592
|
};
|
1622
1593
|
var __copyProps = function(to, from, except, desc) {
|
1623
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
1594
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
1624
1595
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
1625
1596
|
try {
|
1626
1597
|
var _loop = function() {
|
@@ -1655,28 +1626,6 @@ var __toCommonJS = function(mod) {
|
|
1655
1626
|
value: true
|
1656
1627
|
}), mod);
|
1657
1628
|
};
|
1658
|
-
var __async = function(__this, __arguments, generator) {
|
1659
|
-
return new Promise(function(resolve, reject) {
|
1660
|
-
var fulfilled = function(value) {
|
1661
|
-
try {
|
1662
|
-
step(generator.next(value));
|
1663
|
-
} catch (e) {
|
1664
|
-
reject(e);
|
1665
|
-
}
|
1666
|
-
};
|
1667
|
-
var rejected = function(value) {
|
1668
|
-
try {
|
1669
|
-
step(generator.throw(value));
|
1670
|
-
} catch (e) {
|
1671
|
-
reject(e);
|
1672
|
-
}
|
1673
|
-
};
|
1674
|
-
var step = function(x) {
|
1675
|
-
return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
1676
|
-
};
|
1677
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
1678
|
-
});
|
1679
|
-
};
|
1680
1629
|
// src/lib/args/pathspec.ts
|
1681
1630
|
function pathspec() {
|
1682
1631
|
for(var _len = arguments.length, paths = new Array(_len), _key = 0; _key < _len; _key++){
|
@@ -1753,7 +1702,10 @@ var init_task_configuration_error = __esm({
|
|
1753
1702
|
}
|
1754
1703
|
});
|
1755
1704
|
function asFunction(source) {
|
1756
|
-
|
1705
|
+
if (typeof source !== "function") {
|
1706
|
+
return NOOP;
|
1707
|
+
}
|
1708
|
+
return source;
|
1757
1709
|
}
|
1758
1710
|
function isUserFunction(source) {
|
1759
1711
|
return typeof source === "function" && source !== NOOP;
|
@@ -1858,7 +1810,7 @@ function prefixedArray(input, prefix) {
|
|
1858
1810
|
return output;
|
1859
1811
|
}
|
1860
1812
|
function bufferToString(input) {
|
1861
|
-
return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
|
1813
|
+
return (Array.isArray(input) ? Buffer$1.concat(input) : input).toString("utf-8");
|
1862
1814
|
}
|
1863
1815
|
function pick(source, properties) {
|
1864
1816
|
var _Object;
|
@@ -1948,20 +1900,20 @@ var GitOutputStreams;
|
|
1948
1900
|
var init_git_output_streams = __esm({
|
1949
1901
|
"src/lib/utils/git-output-streams.ts": function() {
|
1950
1902
|
GitOutputStreams = /*#__PURE__*/ function() {
|
1951
|
-
function
|
1952
|
-
_class_call_check(this,
|
1903
|
+
function _GitOutputStreams(stdOut, stdErr) {
|
1904
|
+
_class_call_check(this, _GitOutputStreams);
|
1953
1905
|
this.stdOut = stdOut;
|
1954
1906
|
this.stdErr = stdErr;
|
1955
1907
|
}
|
1956
|
-
_create_class(
|
1908
|
+
_create_class(_GitOutputStreams, [
|
1957
1909
|
{
|
1958
1910
|
key: "asStrings",
|
1959
1911
|
value: function asStrings() {
|
1960
|
-
return new
|
1912
|
+
return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
|
1961
1913
|
}
|
1962
1914
|
}
|
1963
1915
|
]);
|
1964
|
-
return
|
1916
|
+
return _GitOutputStreams;
|
1965
1917
|
}();
|
1966
1918
|
}
|
1967
1919
|
});
|
@@ -1992,6 +1944,7 @@ var init_line_parser = __esm({
|
|
1992
1944
|
}
|
1993
1945
|
_create_class(LineParser, [
|
1994
1946
|
{
|
1947
|
+
// @ts-ignore
|
1995
1948
|
key: "useMatches",
|
1996
1949
|
value: function useMatches(target, match) {
|
1997
1950
|
throw new Error("LineParser:useMatches not implemented");
|
@@ -2064,11 +2017,11 @@ function createInstanceConfig() {
|
|
2064
2017
|
var _Object;
|
2065
2018
|
var baseDir = process.cwd();
|
2066
2019
|
var config = (_Object = Object).assign.apply(_Object, [
|
2067
|
-
|
2020
|
+
_object_spread({
|
2068
2021
|
baseDir: baseDir
|
2069
2022
|
}, defaultOptions)
|
2070
2023
|
].concat(_to_consumable_array(options.filter(function(o) {
|
2071
|
-
return typeof o === "object" && o;
|
2024
|
+
return (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object" && o;
|
2072
2025
|
}))));
|
2073
2026
|
config.baseDir = config.baseDir || baseDir;
|
2074
2027
|
config.trimmed = config.trimmed === true;
|
@@ -2099,6 +2052,32 @@ function appendTaskOptions(options) {
|
|
2099
2052
|
"boolean"
|
2100
2053
|
])) {
|
2101
2054
|
commands2.push(key + "=" + value);
|
2055
|
+
} else if (Array.isArray(value)) {
|
2056
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
2057
|
+
try {
|
2058
|
+
for(var _iterator = value[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
2059
|
+
var v = _step.value;
|
2060
|
+
if (!filterPrimitives(v, [
|
2061
|
+
"string",
|
2062
|
+
"number"
|
2063
|
+
])) {
|
2064
|
+
commands2.push(key + "=" + v);
|
2065
|
+
}
|
2066
|
+
}
|
2067
|
+
} catch (err) {
|
2068
|
+
_didIteratorError = true;
|
2069
|
+
_iteratorError = err;
|
2070
|
+
} finally{
|
2071
|
+
try {
|
2072
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
2073
|
+
_iterator.return();
|
2074
|
+
}
|
2075
|
+
} finally{
|
2076
|
+
if (_didIteratorError) {
|
2077
|
+
throw _iteratorError;
|
2078
|
+
}
|
2079
|
+
}
|
2080
|
+
}
|
2102
2081
|
} else {
|
2103
2082
|
commands2.push(key);
|
2104
2083
|
}
|
@@ -3221,19 +3200,20 @@ var init_git_logger = __esm({
|
|
3221
3200
|
}
|
3222
3201
|
});
|
3223
3202
|
// src/lib/runners/tasks-pending-queue.ts
|
3224
|
-
var
|
3203
|
+
var TasksPendingQueue;
|
3225
3204
|
var init_tasks_pending_queue = __esm({
|
3226
3205
|
"src/lib/runners/tasks-pending-queue.ts": function() {
|
3206
|
+
var __TasksPendingQueue;
|
3227
3207
|
init_git_error();
|
3228
3208
|
init_git_logger();
|
3229
|
-
|
3230
|
-
function
|
3209
|
+
TasksPendingQueue = (__TasksPendingQueue = /*#__PURE__*/ function() {
|
3210
|
+
function _TasksPendingQueue() {
|
3231
3211
|
var logLabel = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "GitExecutor";
|
3232
|
-
_class_call_check(this,
|
3212
|
+
_class_call_check(this, _TasksPendingQueue);
|
3233
3213
|
this.logLabel = logLabel;
|
3234
3214
|
this._queue = /* @__PURE__ */ new Map();
|
3235
3215
|
}
|
3236
|
-
_create_class(
|
3216
|
+
_create_class(_TasksPendingQueue, [
|
3237
3217
|
{
|
3238
3218
|
key: "withProgress",
|
3239
3219
|
value: function withProgress(task) {
|
@@ -3324,10 +3304,8 @@ var init_tasks_pending_queue = __esm({
|
|
3324
3304
|
}
|
3325
3305
|
}
|
3326
3306
|
]);
|
3327
|
-
return
|
3328
|
-
}();
|
3329
|
-
TasksPendingQueue = _TasksPendingQueue;
|
3330
|
-
TasksPendingQueue.counter = 0;
|
3307
|
+
return _TasksPendingQueue;
|
3308
|
+
}(), __TasksPendingQueue.counter = 0, __TasksPendingQueue);
|
3331
3309
|
}
|
3332
3310
|
});
|
3333
3311
|
function pluginContext(task, commands) {
|
@@ -3406,15 +3384,15 @@ var init_git_executor_chain = __esm({
|
|
3406
3384
|
{
|
3407
3385
|
key: "attemptTask",
|
3408
3386
|
value: function attemptTask(task) {
|
3409
|
-
|
3410
|
-
|
3387
|
+
var _this = this;
|
3388
|
+
return _async_to_generator(function() {
|
3389
|
+
var onScheduleComplete, onQueueComplete, logger, e;
|
3411
3390
|
return _ts_generator(this, function(_state) {
|
3412
3391
|
switch(_state.label){
|
3413
3392
|
case 0:
|
3414
|
-
_this = this;
|
3415
3393
|
return [
|
3416
3394
|
4,
|
3417
|
-
|
3395
|
+
_this._scheduler.next()
|
3418
3396
|
];
|
3419
3397
|
case 1:
|
3420
3398
|
onScheduleComplete = _state.sent();
|
@@ -3429,10 +3407,10 @@ var init_git_executor_chain = __esm({
|
|
3429
3407
|
5,
|
3430
3408
|
6
|
3431
3409
|
]);
|
3432
|
-
logger =
|
3410
|
+
logger = _this._queue.attempt(task).logger;
|
3433
3411
|
return [
|
3434
3412
|
4,
|
3435
|
-
isEmptyTask(task) ?
|
3413
|
+
isEmptyTask(task) ? _this.attemptEmptyTask(task, logger) : _this.attemptRemoteTask(task, logger)
|
3436
3414
|
];
|
3437
3415
|
case 3:
|
3438
3416
|
return [
|
@@ -3441,7 +3419,7 @@ var init_git_executor_chain = __esm({
|
|
3441
3419
|
];
|
3442
3420
|
case 4:
|
3443
3421
|
e = _state.sent();
|
3444
|
-
throw
|
3422
|
+
throw _this.onFatalException(task, e);
|
3445
3423
|
case 5:
|
3446
3424
|
onQueueComplete();
|
3447
3425
|
onScheduleComplete();
|
@@ -3454,7 +3432,7 @@ var init_git_executor_chain = __esm({
|
|
3454
3432
|
];
|
3455
3433
|
}
|
3456
3434
|
});
|
3457
|
-
});
|
3435
|
+
})();
|
3458
3436
|
}
|
3459
3437
|
},
|
3460
3438
|
{
|
@@ -3471,22 +3449,23 @@ var init_git_executor_chain = __esm({
|
|
3471
3449
|
{
|
3472
3450
|
key: "attemptRemoteTask",
|
3473
3451
|
value: function attemptRemoteTask(task, logger) {
|
3474
|
-
|
3452
|
+
var _this = this;
|
3453
|
+
return _async_to_generator(function() {
|
3475
3454
|
var binary, args, raw, outputStreams;
|
3476
3455
|
return _ts_generator(this, function(_state) {
|
3477
3456
|
switch(_state.label){
|
3478
3457
|
case 0:
|
3479
|
-
binary =
|
3480
|
-
args =
|
3458
|
+
binary = _this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
|
3459
|
+
args = _this._plugins.exec("spawn.args", _to_consumable_array(task.commands), pluginContext(task, task.commands));
|
3481
3460
|
return [
|
3482
3461
|
4,
|
3483
|
-
|
3462
|
+
_this.gitResponse(task, binary, args, _this.outputHandler, logger.step("SPAWN"))
|
3484
3463
|
];
|
3485
3464
|
case 1:
|
3486
3465
|
raw = _state.sent();
|
3487
3466
|
return [
|
3488
3467
|
4,
|
3489
|
-
|
3468
|
+
_this.handleTaskData(task, args, raw, logger.step("HANDLE"))
|
3490
3469
|
];
|
3491
3470
|
case 2:
|
3492
3471
|
outputStreams = _state.sent();
|
@@ -3503,21 +3482,22 @@ var init_git_executor_chain = __esm({
|
|
3503
3482
|
];
|
3504
3483
|
}
|
3505
3484
|
});
|
3506
|
-
});
|
3485
|
+
})();
|
3507
3486
|
}
|
3508
3487
|
},
|
3509
3488
|
{
|
3510
3489
|
key: "attemptEmptyTask",
|
3511
3490
|
value: function attemptEmptyTask(task, logger) {
|
3512
|
-
|
3491
|
+
var _this = this;
|
3492
|
+
return _async_to_generator(function() {
|
3513
3493
|
return _ts_generator(this, function(_state) {
|
3514
3494
|
logger("empty task bypassing child process to call to task's parser");
|
3515
3495
|
return [
|
3516
3496
|
2,
|
3517
|
-
task.parser(
|
3497
|
+
task.parser(_this)
|
3518
3498
|
];
|
3519
3499
|
});
|
3520
|
-
});
|
3500
|
+
})();
|
3521
3501
|
}
|
3522
3502
|
},
|
3523
3503
|
{
|
@@ -3529,7 +3509,7 @@ var init_git_executor_chain = __esm({
|
|
3529
3509
|
logger("Preparing to handle process response exitCode=%d stdOut=", exitCode);
|
3530
3510
|
var error = _this._plugins.exec("task.error", {
|
3531
3511
|
error: rejection
|
3532
|
-
},
|
3512
|
+
}, _object_spread({}, pluginContext(task, args), result)).error;
|
3533
3513
|
if (error && task.onError) {
|
3534
3514
|
logger.info("exitCode=%s handling with custom error handler");
|
3535
3515
|
return task.onError(result, error, function(newStdOut) {
|
@@ -3550,14 +3530,14 @@ var init_git_executor_chain = __esm({
|
|
3550
3530
|
{
|
3551
3531
|
key: "gitResponse",
|
3552
3532
|
value: function gitResponse(task, command, args, outputHandler, logger) {
|
3553
|
-
|
3554
|
-
|
3533
|
+
var _this = this;
|
3534
|
+
return _async_to_generator(function() {
|
3535
|
+
var outputLogger, spawnOptions;
|
3555
3536
|
return _ts_generator(this, function(_state) {
|
3556
|
-
_this = this;
|
3557
3537
|
outputLogger = logger.sibling("output");
|
3558
|
-
spawnOptions =
|
3559
|
-
cwd:
|
3560
|
-
env:
|
3538
|
+
spawnOptions = _this._plugins.exec("spawn.options", {
|
3539
|
+
cwd: _this.cwd,
|
3540
|
+
env: _this.env,
|
3561
3541
|
windowsHide: true
|
3562
3542
|
}, pluginContext(task, task.commands));
|
3563
3543
|
return [
|
@@ -3576,7 +3556,7 @@ var init_git_executor_chain = __esm({
|
|
3576
3556
|
rejection: rejection
|
3577
3557
|
});
|
3578
3558
|
}
|
3579
|
-
_this._plugins.exec("spawn.before", void 0,
|
3559
|
+
_this._plugins.exec("spawn.before", void 0, _object_spread_props(_object_spread({}, pluginContext(task, args)), {
|
3580
3560
|
kill: function kill(reason) {
|
3581
3561
|
rejection = reason || rejection;
|
3582
3562
|
}
|
@@ -3589,7 +3569,7 @@ var init_git_executor_chain = __esm({
|
|
3589
3569
|
logger("Passing child process stdOut/stdErr to custom outputHandler");
|
3590
3570
|
outputHandler(command, spawned.stdout, spawned.stderr, _to_consumable_array(args));
|
3591
3571
|
}
|
3592
|
-
_this._plugins.exec("spawn.after", void 0,
|
3572
|
+
_this._plugins.exec("spawn.after", void 0, _object_spread_props(_object_spread({}, pluginContext(task, args)), {
|
3593
3573
|
spawned: spawned,
|
3594
3574
|
close: function close(exitCode, reason) {
|
3595
3575
|
done({
|
@@ -3610,14 +3590,14 @@ var init_git_executor_chain = __esm({
|
|
3610
3590
|
})
|
3611
3591
|
];
|
3612
3592
|
});
|
3613
|
-
});
|
3593
|
+
})();
|
3614
3594
|
}
|
3615
3595
|
},
|
3616
3596
|
{
|
3617
3597
|
key: "_beforeSpawn",
|
3618
3598
|
value: function _beforeSpawn(task, args) {
|
3619
3599
|
var rejection;
|
3620
|
-
this._plugins.exec("spawn.before", void 0,
|
3600
|
+
this._plugins.exec("spawn.before", void 0, _object_spread_props(_object_spread({}, pluginContext(task, args)), {
|
3621
3601
|
kill: function kill(reason) {
|
3622
3602
|
rejection = reason || rejection;
|
3623
3603
|
}
|
@@ -3674,7 +3654,7 @@ function taskCallback(task, response) {
|
|
3674
3654
|
callback(null, data);
|
3675
3655
|
};
|
3676
3656
|
var onError2 = function(err) {
|
3677
|
-
if ((err
|
3657
|
+
if ((err === null || err === void 0 ? void 0 : err.task) === task) {
|
3678
3658
|
callback(_instanceof(err, GitResponseError) ? addDeprecationNoticeToError(err) : err, void 0);
|
3679
3659
|
}
|
3680
3660
|
};
|
@@ -4062,8 +4042,8 @@ var init_parse_diff_summary = __esm({
|
|
4062
4042
|
var inserted = /(\d+) i/.exec(summary);
|
4063
4043
|
var deleted = /(\d+) d/.exec(summary);
|
4064
4044
|
result.changed = asNumber(changed);
|
4065
|
-
result.insertions = asNumber(inserted
|
4066
|
-
result.deletions = asNumber(deleted
|
4045
|
+
result.insertions = asNumber(inserted === null || inserted === void 0 ? void 0 : inserted[1]);
|
4046
|
+
result.deletions = asNumber(deleted === null || deleted === void 0 ? void 0 : deleted[1]);
|
4067
4047
|
})
|
4068
4048
|
];
|
4069
4049
|
numStatParser = [
|
@@ -4111,7 +4091,7 @@ var init_parse_diff_summary = __esm({
|
|
4111
4091
|
var _param = _sliced_to_array(param, 5), status = _param[0], similarity = _param[1], from = _param[2]; _param[3]; var to = _param[4];
|
4112
4092
|
result.changed++;
|
4113
4093
|
result.files.push({
|
4114
|
-
file: to
|
4094
|
+
file: to !== null && to !== void 0 ? to : from,
|
4115
4095
|
changes: 0,
|
4116
4096
|
insertions: 0,
|
4117
4097
|
deletions: 0,
|
@@ -4160,9 +4140,9 @@ var init_parse_list_log_summary = __esm({
|
|
4160
4140
|
init_utils();
|
4161
4141
|
init_parse_diff_summary();
|
4162
4142
|
init_log_format();
|
4163
|
-
START_BOUNDARY = "\
|
4164
|
-
COMMIT_BOUNDARY = " \
|
4165
|
-
SPLITTER = " \
|
4143
|
+
START_BOUNDARY = "\xF2\xF2\xF2\xF2\xF2\xF2 ";
|
4144
|
+
COMMIT_BOUNDARY = " \xF2\xF2";
|
4145
|
+
SPLITTER = " \xF2 ";
|
4166
4146
|
defaultFieldNames = [
|
4167
4147
|
"hash",
|
4168
4148
|
"date",
|
@@ -4240,7 +4220,7 @@ function userOptions(input) {
|
|
4240
4220
|
function parseLogOptions() {
|
4241
4221
|
var opt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, customArgs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
4242
4222
|
var splitter = filterType(opt.splitter, filterString, SPLITTER);
|
4243
|
-
var format =
|
4223
|
+
var format = filterPlainObject(opt.format) ? opt.format : {
|
4244
4224
|
hash: "%H",
|
4245
4225
|
date: opt.strictDate === false ? "%ai" : "%aI",
|
4246
4226
|
message: "%s",
|
@@ -4689,7 +4669,7 @@ var init_parse_push = __esm({
|
|
4689
4669
|
}),
|
4690
4670
|
new LineParser(/^updating local tracking ref '(.+)'/, function(result, param) {
|
4691
4671
|
var _param = _sliced_to_array(param, 1), local = _param[0];
|
4692
|
-
result.ref =
|
4672
|
+
result.ref = _object_spread_props(_object_spread({}, result.ref || {}), {
|
4693
4673
|
local: local
|
4694
4674
|
});
|
4695
4675
|
}),
|
@@ -4699,7 +4679,7 @@ var init_parse_push = __esm({
|
|
4699
4679
|
}),
|
4700
4680
|
new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, function(result, param) {
|
4701
4681
|
var _param = _sliced_to_array(param, 3), local = _param[0], remote = _param[1], remoteName = _param[2];
|
4702
|
-
result.branch =
|
4682
|
+
result.branch = _object_spread_props(_object_spread({}, result.branch || {}), {
|
4703
4683
|
local: local,
|
4704
4684
|
remote: remote,
|
4705
4685
|
remoteName: remoteName
|
@@ -4722,7 +4702,7 @@ var init_parse_push = __esm({
|
|
4722
4702
|
parsePushResult = function(stdOut, stdErr) {
|
4723
4703
|
var pushDetail = parsePushDetail(stdOut, stdErr);
|
4724
4704
|
var responseDetail = parseRemoteMessages(stdOut, stdErr);
|
4725
|
-
return
|
4705
|
+
return _object_spread({}, pushDetail, responseDetail);
|
4726
4706
|
};
|
4727
4707
|
parsePushDetail = function(stdOut, stdErr) {
|
4728
4708
|
return parseStringResponse({
|
@@ -5135,7 +5115,7 @@ var init_simple_git_api = __esm({
|
|
5135
5115
|
if (typeof directory === "string") {
|
5136
5116
|
return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);
|
5137
5117
|
}
|
5138
|
-
if (typeof (directory
|
5118
|
+
if (typeof (directory === null || directory === void 0 ? void 0 : directory.path) === "string") {
|
5139
5119
|
return this._runTask(changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next);
|
5140
5120
|
}
|
5141
5121
|
return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next);
|
@@ -5220,7 +5200,7 @@ var init_scheduler = __esm({
|
|
5220
5200
|
"src/lib/runners/scheduler.ts": function() {
|
5221
5201
|
init_utils();
|
5222
5202
|
init_git_logger();
|
5223
|
-
createScheduledTask = function() {
|
5203
|
+
createScheduledTask = /* @__PURE__ */ function() {
|
5224
5204
|
var id = 0;
|
5225
5205
|
return function() {
|
5226
5206
|
id++;
|
@@ -5414,7 +5394,7 @@ var init_parse_branch = __esm({
|
|
5414
5394
|
var _param = _sliced_to_array(param, 4), current = _param[0], name = _param[1], commit = _param[2], label = _param[3];
|
5415
5395
|
result.push(branchStatus(current), true, name, commit, label);
|
5416
5396
|
}),
|
5417
|
-
new LineParser(
|
5397
|
+
new LineParser(RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$", "s"), function(result, param) {
|
5418
5398
|
var _param = _sliced_to_array(param, 4), current = _param[0], name = _param[1], commit = _param[2], label = _param[3];
|
5419
5399
|
result.push(branchStatus(current), false, name, commit, label);
|
5420
5400
|
})
|
@@ -6113,7 +6093,7 @@ var require_git = __commonJS({
|
|
6113
6093
|
return this;
|
6114
6094
|
};
|
6115
6095
|
Git2.prototype.env = function(name, value) {
|
6116
|
-
if (arguments.length === 1 && typeof name === "object") {
|
6096
|
+
if (arguments.length === 1 && (typeof name === "undefined" ? "undefined" : _type_of(name)) === "object") {
|
6117
6097
|
this._executor.env = name;
|
6118
6098
|
} else {
|
6119
6099
|
(this._executor.env = this._executor.env || {})[name] = value;
|
@@ -6513,20 +6493,20 @@ function completionDetectionPlugin() {
|
|
6513
6493
|
}
|
6514
6494
|
return {
|
6515
6495
|
type: "spawn.after",
|
6516
|
-
action: function action(
|
6517
|
-
|
6518
|
-
|
6496
|
+
action: function action(_data, param) {
|
6497
|
+
var spawned = param.spawned, close = param.close;
|
6498
|
+
return _async_to_generator(function() {
|
6499
|
+
var _spawned_stdout, _spawned_stderr, events, deferClose, quickClose, err;
|
6519
6500
|
return _ts_generator(this, function(_state) {
|
6520
6501
|
switch(_state.label){
|
6521
6502
|
case 0:
|
6522
|
-
spawned = param.spawned, close = param.close;
|
6523
6503
|
events = createEvents();
|
6524
6504
|
deferClose = true;
|
6525
6505
|
quickClose = function() {
|
6526
6506
|
return void (deferClose = false);
|
6527
6507
|
};
|
6528
|
-
(
|
6529
|
-
(
|
6508
|
+
(_spawned_stdout = spawned.stdout) === null || _spawned_stdout === void 0 ? void 0 : _spawned_stdout.on("data", quickClose);
|
6509
|
+
(_spawned_stderr = spawned.stderr) === null || _spawned_stderr === void 0 ? void 0 : _spawned_stderr.on("data", quickClose);
|
6530
6510
|
spawned.on("error", quickClose);
|
6531
6511
|
spawned.on("close", function(code) {
|
6532
6512
|
return events.close(code);
|
@@ -6578,7 +6558,7 @@ function completionDetectionPlugin() {
|
|
6578
6558
|
];
|
6579
6559
|
}
|
6580
6560
|
});
|
6581
|
-
});
|
6561
|
+
})();
|
6582
6562
|
}
|
6583
6563
|
};
|
6584
6564
|
}
|
@@ -6757,11 +6737,11 @@ function progressMonitorPlugin(progress) {
|
|
6757
6737
|
var onProgress = {
|
6758
6738
|
type: "spawn.after",
|
6759
6739
|
action: function action(_data, context) {
|
6760
|
-
var
|
6740
|
+
var _context_spawned_stderr;
|
6761
6741
|
if (!context.commands.includes(progressCommand)) {
|
6762
6742
|
return;
|
6763
6743
|
}
|
6764
|
-
(
|
6744
|
+
(_context_spawned_stderr = context.spawned.stderr) === null || _context_spawned_stderr === void 0 ? void 0 : _context_spawned_stderr.on("data", function(chunk) {
|
6765
6745
|
var message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8"));
|
6766
6746
|
if (!message) {
|
6767
6747
|
return;
|
@@ -6803,7 +6783,7 @@ function spawnOptionsPlugin(spawnOptions) {
|
|
6803
6783
|
return {
|
6804
6784
|
type: "spawn.options",
|
6805
6785
|
action: function action(data) {
|
6806
|
-
return
|
6786
|
+
return _object_spread({}, options, data);
|
6807
6787
|
}
|
6808
6788
|
};
|
6809
6789
|
}
|
@@ -6814,16 +6794,16 @@ function timeoutPlugin(param) {
|
|
6814
6794
|
return {
|
6815
6795
|
type: "spawn.after",
|
6816
6796
|
action: function action(_data, context) {
|
6817
|
-
var
|
6797
|
+
var _context_spawned_stdout, _context_spawned_stderr;
|
6818
6798
|
var timeout;
|
6819
6799
|
function wait() {
|
6820
6800
|
timeout && clearTimeout(timeout);
|
6821
6801
|
timeout = setTimeout(kill, block);
|
6822
6802
|
}
|
6823
6803
|
function stop() {
|
6824
|
-
var
|
6825
|
-
(
|
6826
|
-
(
|
6804
|
+
var _context_spawned_stdout, _context_spawned_stderr;
|
6805
|
+
(_context_spawned_stdout = context.spawned.stdout) === null || _context_spawned_stdout === void 0 ? void 0 : _context_spawned_stdout.off("data", wait);
|
6806
|
+
(_context_spawned_stderr = context.spawned.stderr) === null || _context_spawned_stderr === void 0 ? void 0 : _context_spawned_stderr.off("data", wait);
|
6827
6807
|
context.spawned.off("exit", stop);
|
6828
6808
|
context.spawned.off("close", stop);
|
6829
6809
|
timeout && clearTimeout(timeout);
|
@@ -6832,8 +6812,8 @@ function timeoutPlugin(param) {
|
|
6832
6812
|
stop();
|
6833
6813
|
context.kill(new GitPluginError(void 0, "timeout", "block timeout reached"));
|
6834
6814
|
}
|
6835
|
-
stdOut && ((
|
6836
|
-
stdErr && ((
|
6815
|
+
stdOut && ((_context_spawned_stdout = context.spawned.stdout) === null || _context_spawned_stdout === void 0 ? void 0 : _context_spawned_stdout.on("data", wait));
|
6816
|
+
stdErr && ((_context_spawned_stderr = context.spawned.stderr) === null || _context_spawned_stderr === void 0 ? void 0 : _context_spawned_stderr.on("data", wait));
|
6837
6817
|
context.spawned.on("exit", stop);
|
6838
6818
|
context.spawned.on("close", stop);
|
6839
6819
|
wait();
|
@@ -6877,7 +6857,7 @@ function suffixPathsPlugin() {
|
|
6877
6857
|
init_utils();
|
6878
6858
|
var Git = require_git();
|
6879
6859
|
function gitInstanceFactory(baseDir, options) {
|
6880
|
-
var
|
6860
|
+
var _config_unsafe;
|
6881
6861
|
var plugins = new PluginStore();
|
6882
6862
|
var config = createInstanceConfig(baseDir && (typeof baseDir === "string" ? {
|
6883
6863
|
baseDir: baseDir
|
@@ -6897,7 +6877,7 @@ function gitInstanceFactory(baseDir, options) {
|
|
6897
6877
|
config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
|
6898
6878
|
plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
|
6899
6879
|
config.errors && plugins.add(errorDetectionPlugin(config.errors));
|
6900
|
-
customBinaryPlugin(plugins, config.binary, (
|
6880
|
+
customBinaryPlugin(plugins, config.binary, (_config_unsafe = config.unsafe) === null || _config_unsafe === void 0 ? void 0 : _config_unsafe.allowUnsafeCustomBinary);
|
6901
6881
|
return new Git(config, plugins);
|
6902
6882
|
}
|
6903
6883
|
// src/lib/runners/promise-wrapped.ts
|