@emulsify/cli 1.11.4 → 1.12.1

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 (148) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/node_modules/.package-lock.json +34 -24
  3. package/dist/node_modules/@types/node/README.md +2 -2
  4. package/dist/node_modules/@types/node/assert.d.ts +23 -1
  5. package/dist/node_modules/@types/node/async_hooks.d.ts +64 -0
  6. package/dist/node_modules/@types/node/buffer.buffer.d.ts +124 -38
  7. package/dist/node_modules/@types/node/buffer.d.ts +19 -17
  8. package/dist/node_modules/@types/node/child_process.d.ts +88 -161
  9. package/dist/node_modules/@types/node/cluster.d.ts +5 -6
  10. package/dist/node_modules/@types/node/constants.d.ts +14 -12
  11. package/dist/node_modules/@types/node/crypto.d.ts +237 -166
  12. package/dist/node_modules/@types/node/dgram.d.ts +15 -14
  13. package/dist/node_modules/@types/node/diagnostics_channel.d.ts +39 -15
  14. package/dist/node_modules/@types/node/dns/promises.d.ts +11 -9
  15. package/dist/node_modules/@types/node/dns.d.ts +28 -21
  16. package/dist/node_modules/@types/node/events.d.ts +81 -35
  17. package/dist/node_modules/@types/node/fs/promises.d.ts +61 -36
  18. package/dist/node_modules/@types/node/fs.d.ts +251 -193
  19. package/dist/node_modules/@types/node/globals.d.ts +146 -442
  20. package/dist/node_modules/@types/node/globals.typedarray.d.ts +17 -0
  21. package/dist/node_modules/@types/node/http.d.ts +136 -31
  22. package/dist/node_modules/@types/node/http2.d.ts +102 -26
  23. package/dist/node_modules/@types/node/https.d.ts +94 -60
  24. package/dist/node_modules/@types/node/index.d.ts +5 -3
  25. package/dist/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +272 -2
  26. package/dist/node_modules/@types/node/module.d.ts +362 -138
  27. package/dist/node_modules/@types/node/net.d.ts +27 -20
  28. package/dist/node_modules/@types/node/os.d.ts +14 -3
  29. package/dist/node_modules/@types/node/package.json +4 -89
  30. package/dist/node_modules/@types/node/perf_hooks.d.ts +37 -10
  31. package/dist/node_modules/@types/node/process.d.ts +108 -35
  32. package/dist/node_modules/@types/node/querystring.d.ts +2 -3
  33. package/dist/node_modules/@types/node/readline/promises.d.ts +1 -1
  34. package/dist/node_modules/@types/node/stream/consumers.d.ts +33 -7
  35. package/dist/node_modules/@types/node/stream/web.d.ts +13 -4
  36. package/dist/node_modules/@types/node/stream.d.ts +963 -1014
  37. package/dist/node_modules/@types/node/string_decoder.d.ts +2 -2
  38. package/dist/node_modules/@types/node/test.d.ts +1504 -1655
  39. package/dist/node_modules/@types/node/timers/promises.d.ts +28 -17
  40. package/dist/node_modules/@types/node/timers.d.ts +157 -111
  41. package/dist/node_modules/@types/node/tls.d.ts +105 -67
  42. package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +120 -37
  43. package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
  44. package/dist/node_modules/@types/node/ts5.6/index.d.ts +5 -3
  45. package/dist/node_modules/@types/node/url.d.ts +10 -1
  46. package/dist/node_modules/@types/node/util.d.ts +28 -3
  47. package/dist/node_modules/@types/node/v8.d.ts +6 -5
  48. package/dist/node_modules/@types/node/vm.d.ts +147 -68
  49. package/dist/node_modules/@types/node/wasi.d.ts +1 -1
  50. package/dist/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  51. package/dist/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  52. package/dist/node_modules/@types/node/web-globals/events.d.ts +97 -0
  53. package/dist/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
  54. package/dist/node_modules/@types/node/worker_threads.d.ts +60 -39
  55. package/dist/node_modules/@types/node/zlib.d.ts +21 -20
  56. package/dist/node_modules/debug/package.json +7 -3
  57. package/dist/node_modules/debug/src/browser.js +2 -1
  58. package/dist/node_modules/debug/src/common.js +57 -39
  59. package/dist/node_modules/fast-uri/.github/dependabot.yml +1 -1
  60. package/dist/node_modules/fast-uri/.github/workflows/ci.yml +81 -3
  61. package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +6 -2
  62. package/dist/node_modules/fast-uri/LICENSE +3 -1
  63. package/dist/node_modules/fast-uri/README.md +55 -37
  64. package/dist/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
  65. package/dist/node_modules/fast-uri/benchmark/equal.mjs +51 -0
  66. package/dist/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
  67. package/dist/node_modules/fast-uri/benchmark/package.json +17 -0
  68. package/dist/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
  69. package/dist/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
  70. package/dist/node_modules/fast-uri/eslint.config.js +6 -0
  71. package/dist/node_modules/fast-uri/index.js +98 -61
  72. package/dist/node_modules/fast-uri/lib/schemes.js +160 -81
  73. package/dist/node_modules/fast-uri/lib/utils.js +217 -123
  74. package/dist/node_modules/fast-uri/package.json +44 -14
  75. package/dist/node_modules/fast-uri/test/ajv.test.js +7 -3
  76. package/dist/node_modules/fast-uri/test/equal.test.js +7 -2
  77. package/dist/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
  78. package/dist/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
  79. package/dist/node_modules/fast-uri/test/parse.test.js +31 -31
  80. package/dist/node_modules/fast-uri/test/resolve.test.js +52 -49
  81. package/dist/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
  82. package/dist/node_modules/fast-uri/test/serialize.test.js +55 -47
  83. package/dist/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
  84. package/dist/node_modules/fast-uri/test/uri-js.test.js +230 -230
  85. package/dist/node_modules/fast-uri/test/util.test.js +23 -8
  86. package/dist/node_modules/fast-uri/tsconfig.json +9 -0
  87. package/dist/node_modules/fast-uri/types/index.d.ts +16 -9
  88. package/dist/node_modules/fast-uri/types/index.test-d.ts +9 -9
  89. package/dist/node_modules/fs-extra/LICENSE +1 -1
  90. package/dist/node_modules/fs-extra/README.md +3 -1
  91. package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +11 -1
  92. package/dist/node_modules/fs-extra/lib/copy/copy.js +13 -15
  93. package/dist/node_modules/fs-extra/lib/fs/index.js +6 -0
  94. package/dist/node_modules/fs-extra/lib/util/async.js +29 -0
  95. package/dist/node_modules/fs-extra/lib/util/stat.js +2 -1
  96. package/dist/node_modules/fs-extra/package.json +1 -1
  97. package/dist/node_modules/jsonfile/README.md +1 -1
  98. package/dist/node_modules/jsonfile/index.js +3 -3
  99. package/dist/node_modules/jsonfile/package.json +1 -1
  100. package/dist/node_modules/simple-git/dist/cjs/index.js +235 -235
  101. package/dist/node_modules/simple-git/dist/cjs/index.js.map +3 -3
  102. package/dist/node_modules/simple-git/dist/esm/index.js +229 -233
  103. package/dist/node_modules/simple-git/dist/esm/index.js.map +3 -3
  104. package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +1 -1
  105. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +1 -1
  106. package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +2 -3
  107. package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +2 -3
  108. package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +0 -1
  109. package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -1
  110. package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +2 -2
  111. package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +1 -1
  112. package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +1 -1
  113. package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +1 -1
  114. package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -3
  115. package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +1 -1
  116. package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +4 -2
  117. package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +3 -3
  118. package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +1 -1
  119. package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +2 -2
  120. package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +1 -1
  121. package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +9 -13
  122. package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +5 -6
  123. package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +5 -7
  124. package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +0 -1
  125. package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -1
  126. package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +1 -1
  127. package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +11 -10
  128. package/dist/node_modules/simple-git/package.json +6 -6
  129. package/dist/node_modules/simple-git/readme.md +8 -0
  130. package/dist/node_modules/undici-types/dispatcher.d.ts +1 -0
  131. package/dist/node_modules/undici-types/eventsource.d.ts +0 -2
  132. package/dist/node_modules/undici-types/filereader.d.ts +1 -1
  133. package/dist/node_modules/undici-types/interceptors.d.ts +3 -1
  134. package/dist/node_modules/undici-types/package.json +1 -1
  135. package/dist/node_modules/undici-types/patch.d.ts +0 -38
  136. package/dist/node_modules/undici-types/readable.d.ts +5 -0
  137. package/dist/node_modules/undici-types/webidl.d.ts +6 -0
  138. package/dist/node_modules/undici-types/websocket.d.ts +0 -2
  139. package/dist/package-lock.json +912 -813
  140. package/dist/package.json +2 -2
  141. package/dist/util/getAvailableStarters.js +3 -3
  142. package/package.json +2 -2
  143. package/dist/node_modules/@types/node/dom-events.d.ts +0 -124
  144. package/dist/node_modules/fast-uri/benchmark.js +0 -105
  145. package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
  146. package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
  147. package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
  148. package/dist/node_modules/jsonfile/CHANGELOG.md +0 -171
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __esm = (fn, res) => function __init() {
26
9
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
27
10
  };
@@ -41,30 +24,14 @@ var __copyProps = (to, from, except, desc) => {
41
24
  return to;
42
25
  };
43
26
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
44
31
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
45
32
  mod
46
33
  ));
47
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
- var __async = (__this, __arguments, generator) => {
49
- return new Promise((resolve, reject) => {
50
- var fulfilled = (value) => {
51
- try {
52
- step(generator.next(value));
53
- } catch (e) {
54
- reject(e);
55
- }
56
- };
57
- var rejected = (value) => {
58
- try {
59
- step(generator.throw(value));
60
- } catch (e) {
61
- reject(e);
62
- }
63
- };
64
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
65
- step((generator = generator.apply(__this, __arguments)).next());
66
- });
67
- };
68
35
 
69
36
  // src/lib/errors/git-error.ts
70
37
  var GitError;
@@ -164,7 +131,10 @@ var init_task_configuration_error = __esm({
164
131
 
165
132
  // src/lib/utils/util.ts
166
133
  function asFunction(source) {
167
- return typeof source === "function" ? source : NOOP;
134
+ if (typeof source !== "function") {
135
+ return NOOP;
136
+ }
137
+ return source;
168
138
  }
169
139
  function isUserFunction(source) {
170
140
  return typeof source === "function" && source !== NOOP;
@@ -185,7 +155,7 @@ function last(input, offset = 0) {
185
155
  }
186
156
  }
187
157
  function isArrayLike(input) {
188
- return !!(input && typeof input.length === "number");
158
+ return filterHasLength(input);
189
159
  }
190
160
  function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
191
161
  return input.split(separator).reduce((output, line) => {
@@ -238,14 +208,16 @@ function asCamelCase(str) {
238
208
  });
239
209
  }
240
210
  function asStringArray(source) {
241
- return asArray(source).map(String);
211
+ return asArray(source).map((item) => {
212
+ return item instanceof String ? item : String(item);
213
+ });
242
214
  }
243
215
  function asNumber(source, onNaN = 0) {
244
216
  if (source == null) {
245
217
  return onNaN;
246
218
  }
247
219
  const num = parseInt(source, 10);
248
- return isNaN(num) ? onNaN : num;
220
+ return Number.isNaN(num) ? onNaN : num;
249
221
  }
250
222
  function prefixedArray(input, prefix) {
251
223
  const output = [];
@@ -255,13 +227,16 @@ function prefixedArray(input, prefix) {
255
227
  return output;
256
228
  }
257
229
  function bufferToString(input) {
258
- return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
230
+ return (Array.isArray(input) ? import_node_buffer.Buffer.concat(input) : input).toString("utf-8");
259
231
  }
260
232
  function pick(source, properties) {
261
- return Object.assign(
262
- {},
263
- ...properties.map((property) => property in source ? { [property]: source[property] } : {})
264
- );
233
+ const out = {};
234
+ properties.forEach((key) => {
235
+ if (source[key] !== void 0) {
236
+ out[key] = source[key];
237
+ }
238
+ });
239
+ return out;
265
240
  }
266
241
  function delay(duration = 0) {
267
242
  return new Promise((done) => setTimeout(done, duration));
@@ -272,11 +247,13 @@ function orVoid(input) {
272
247
  }
273
248
  return input;
274
249
  }
275
- var import_file_exists, NULL, NOOP, objectToString;
250
+ var import_node_buffer, import_file_exists, NULL, NOOP, objectToString;
276
251
  var init_util = __esm({
277
252
  "src/lib/utils/util.ts"() {
278
253
  "use strict";
254
+ import_node_buffer = require("node:buffer");
279
255
  import_file_exists = require("@kwsites/file-exists");
256
+ init_argument_filters();
280
257
  NULL = "\0";
281
258
  NOOP = () => {
282
259
  };
@@ -301,21 +278,21 @@ function filterPlainObject(input) {
301
278
  function filterFunction(input) {
302
279
  return typeof input === "function";
303
280
  }
304
- var filterArray, filterString, filterStringArray, filterStringOrStringArray, filterHasLength;
281
+ var filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;
305
282
  var init_argument_filters = __esm({
306
283
  "src/lib/utils/argument-filters.ts"() {
307
284
  "use strict";
308
- init_util();
309
285
  init_pathspec();
286
+ init_util();
310
287
  filterArray = (input) => {
311
288
  return Array.isArray(input);
312
289
  };
290
+ filterNumber = (input) => {
291
+ return typeof input === "number";
292
+ };
313
293
  filterString = (input) => {
314
294
  return typeof input === "string";
315
295
  };
316
- filterStringArray = (input) => {
317
- return Array.isArray(input) && input.every(filterString);
318
- };
319
296
  filterStringOrStringArray = (input) => {
320
297
  return filterString(input) || Array.isArray(input) && input.every(filterString);
321
298
  };
@@ -323,7 +300,7 @@ var init_argument_filters = __esm({
323
300
  if (input == null || "number|boolean|function".includes(typeof input)) {
324
301
  return false;
325
302
  }
326
- return Array.isArray(input) || typeof input === "string" || typeof input.length === "number";
303
+ return typeof input.length === "number";
327
304
  };
328
305
  }
329
306
  });
@@ -348,19 +325,22 @@ var GitOutputStreams;
348
325
  var init_git_output_streams = __esm({
349
326
  "src/lib/utils/git-output-streams.ts"() {
350
327
  "use strict";
351
- GitOutputStreams = class {
328
+ GitOutputStreams = class _GitOutputStreams {
352
329
  constructor(stdOut, stdErr) {
353
330
  this.stdOut = stdOut;
354
331
  this.stdErr = stdErr;
355
332
  }
356
333
  asStrings() {
357
- return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
334
+ return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
358
335
  }
359
336
  };
360
337
  }
361
338
  });
362
339
 
363
340
  // src/lib/utils/line-parser.ts
341
+ function useMatchesDefault() {
342
+ throw new Error(`LineParser:useMatches not implemented`);
343
+ }
364
344
  var LineParser, RemoteLineParser;
365
345
  var init_line_parser = __esm({
366
346
  "src/lib/utils/line-parser.ts"() {
@@ -368,6 +348,7 @@ var init_line_parser = __esm({
368
348
  LineParser = class {
369
349
  constructor(regExp, useMatches) {
370
350
  this.matches = [];
351
+ this.useMatches = useMatchesDefault;
371
352
  this.parse = (line, target) => {
372
353
  this.resetMatches();
373
354
  if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
@@ -380,9 +361,6 @@ var init_line_parser = __esm({
380
361
  this.useMatches = useMatches;
381
362
  }
382
363
  }
383
- useMatches(target, match) {
384
- throw new Error(`LineParser:useMatches not implemented`);
385
- }
386
364
  resetMatches() {
387
365
  this.matches.length = 0;
388
366
  }
@@ -417,7 +395,7 @@ var init_line_parser = __esm({
417
395
  function createInstanceConfig(...options) {
418
396
  const baseDir = process.cwd();
419
397
  const config = Object.assign(
420
- __spreadValues({ baseDir }, defaultOptions),
398
+ { baseDir, ...defaultOptions },
421
399
  ...options.filter((o) => typeof o === "object" && o)
422
400
  );
423
401
  config.baseDir = config.baseDir || baseDir;
@@ -448,6 +426,12 @@ function appendTaskOptions(options, commands = []) {
448
426
  commands2.push(value);
449
427
  } else if (filterPrimitives(value, ["boolean"])) {
450
428
  commands2.push(key + "=" + value);
429
+ } else if (Array.isArray(value)) {
430
+ for (const v of value) {
431
+ if (!filterPrimitives(v, ["string", "number"])) {
432
+ commands2.push(key + "=" + v);
433
+ }
434
+ }
451
435
  } else {
452
436
  commands2.push(key);
453
437
  }
@@ -469,7 +453,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
469
453
  }
470
454
  function trailingArrayArgument(args) {
471
455
  const hasTrailingCallback = typeof last(args) === "function";
472
- return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
456
+ return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
473
457
  }
474
458
  function trailingOptionsArgument(args) {
475
459
  const hasTrailingCallback = filterFunction(last(args));
@@ -536,10 +520,10 @@ __export(utils_exports, {
536
520
  filterArray: () => filterArray,
537
521
  filterFunction: () => filterFunction,
538
522
  filterHasLength: () => filterHasLength,
523
+ filterNumber: () => filterNumber,
539
524
  filterPlainObject: () => filterPlainObject,
540
525
  filterPrimitives: () => filterPrimitives,
541
526
  filterString: () => filterString,
542
- filterStringArray: () => filterStringArray,
543
527
  filterStringOrStringArray: () => filterStringOrStringArray,
544
528
  filterType: () => filterType,
545
529
  first: () => first,
@@ -903,7 +887,7 @@ var init_ConfigList = __esm({
903
887
  }
904
888
  addValue(file, key, value) {
905
889
  const values = this.addFile(file);
906
- if (!values.hasOwnProperty(key)) {
890
+ if (!Object.hasOwn(values, key)) {
907
891
  values[key] = value;
908
892
  } else if (Array.isArray(values[key])) {
909
893
  values[key].push(value);
@@ -918,7 +902,7 @@ var init_ConfigList = __esm({
918
902
 
919
903
  // src/lib/tasks/config.ts
920
904
  function asConfigScope(scope, fallback) {
921
- if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) {
905
+ if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
922
906
  return scope;
923
907
  }
924
908
  return fallback;
@@ -1137,12 +1121,13 @@ function getResetMode(mode) {
1137
1121
  return;
1138
1122
  }
1139
1123
  function isValidResetMode(mode) {
1140
- return ResetModes.includes(mode);
1124
+ return typeof mode === "string" && validResetModes.includes(mode);
1141
1125
  }
1142
- var ResetMode, ResetModes;
1126
+ var ResetMode, validResetModes;
1143
1127
  var init_reset = __esm({
1144
1128
  "src/lib/tasks/reset.ts"() {
1145
1129
  "use strict";
1130
+ init_utils();
1146
1131
  init_task();
1147
1132
  ResetMode = /* @__PURE__ */ ((ResetMode2) => {
1148
1133
  ResetMode2["MIXED"] = "mixed";
@@ -1152,7 +1137,7 @@ var init_reset = __esm({
1152
1137
  ResetMode2["KEEP"] = "keep";
1153
1138
  return ResetMode2;
1154
1139
  })(ResetMode || {});
1155
- ResetModes = Array.from(Object.values(ResetMode));
1140
+ validResetModes = asStringArray(Object.values(ResetMode));
1156
1141
  }
1157
1142
  });
1158
1143
 
@@ -1344,27 +1329,24 @@ function completionDetectionPlugin({
1344
1329
  }
1345
1330
  return {
1346
1331
  type: "spawn.after",
1347
- action(_0, _1) {
1348
- return __async(this, arguments, function* (_data, { spawned, close }) {
1349
- var _a3, _b;
1350
- const events = createEvents();
1351
- let deferClose = true;
1352
- let quickClose = () => void (deferClose = false);
1353
- (_a3 = spawned.stdout) == null ? void 0 : _a3.on("data", quickClose);
1354
- (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
1355
- spawned.on("error", quickClose);
1356
- spawned.on("close", (code) => events.close(code));
1357
- spawned.on("exit", (code) => events.exit(code));
1358
- try {
1359
- yield events.result;
1360
- if (deferClose) {
1361
- yield delay(50);
1362
- }
1363
- close(events.exitCode);
1364
- } catch (err) {
1365
- close(events.exitCode, err);
1332
+ async action(_data, { spawned, close }) {
1333
+ const events = createEvents();
1334
+ let deferClose = true;
1335
+ let quickClose = () => void (deferClose = false);
1336
+ spawned.stdout?.on("data", quickClose);
1337
+ spawned.stderr?.on("data", quickClose);
1338
+ spawned.on("error", quickClose);
1339
+ spawned.on("close", (code) => events.close(code));
1340
+ spawned.on("exit", (code) => events.exit(code));
1341
+ try {
1342
+ await events.result;
1343
+ if (deferClose) {
1344
+ await delay(50);
1366
1345
  }
1367
- });
1346
+ close(events.exitCode);
1347
+ } catch (err) {
1348
+ close(events.exitCode, err);
1349
+ }
1368
1350
  }
1369
1351
  };
1370
1352
  }
@@ -1513,11 +1495,10 @@ function progressMonitorPlugin(progress) {
1513
1495
  const onProgress = {
1514
1496
  type: "spawn.after",
1515
1497
  action(_data, context) {
1516
- var _a2;
1517
1498
  if (!context.commands.includes(progressCommand)) {
1518
1499
  return;
1519
1500
  }
1520
- (_a2 = context.spawned.stderr) == null ? void 0 : _a2.on("data", (chunk) => {
1501
+ context.spawned.stderr?.on("data", (chunk) => {
1521
1502
  const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8"));
1522
1503
  if (!message) {
1523
1504
  return;
@@ -1566,7 +1547,7 @@ function spawnOptionsPlugin(spawnOptions) {
1566
1547
  return {
1567
1548
  type: "spawn.options",
1568
1549
  action(data) {
1569
- return __spreadValues(__spreadValues({}, options), data);
1550
+ return { ...options, ...data };
1570
1551
  }
1571
1552
  };
1572
1553
  }
@@ -1587,16 +1568,14 @@ function timeoutPlugin({
1587
1568
  return {
1588
1569
  type: "spawn.after",
1589
1570
  action(_data, context) {
1590
- var _a2, _b;
1591
1571
  let timeout;
1592
1572
  function wait() {
1593
1573
  timeout && clearTimeout(timeout);
1594
1574
  timeout = setTimeout(kill, block);
1595
1575
  }
1596
1576
  function stop() {
1597
- var _a3, _b2;
1598
- (_a3 = context.spawned.stdout) == null ? void 0 : _a3.off("data", wait);
1599
- (_b2 = context.spawned.stderr) == null ? void 0 : _b2.off("data", wait);
1577
+ context.spawned.stdout?.off("data", wait);
1578
+ context.spawned.stderr?.off("data", wait);
1600
1579
  context.spawned.off("exit", stop);
1601
1580
  context.spawned.off("close", stop);
1602
1581
  timeout && clearTimeout(timeout);
@@ -1605,8 +1584,8 @@ function timeoutPlugin({
1605
1584
  stop();
1606
1585
  context.kill(new GitPluginError(void 0, "timeout", `block timeout reached`));
1607
1586
  }
1608
- stdOut && ((_a2 = context.spawned.stdout) == null ? void 0 : _a2.on("data", wait));
1609
- stdErr && ((_b = context.spawned.stderr) == null ? void 0 : _b.on("data", wait));
1587
+ stdOut && context.spawned.stdout?.on("data", wait);
1588
+ stdErr && context.spawned.stderr?.on("data", wait);
1610
1589
  context.spawned.on("exit", stop);
1611
1590
  context.spawned.on("close", stop);
1612
1591
  wait();
@@ -1743,13 +1722,13 @@ var init_git_logger = __esm({
1743
1722
  });
1744
1723
 
1745
1724
  // src/lib/runners/tasks-pending-queue.ts
1746
- var _TasksPendingQueue, TasksPendingQueue;
1725
+ var TasksPendingQueue;
1747
1726
  var init_tasks_pending_queue = __esm({
1748
1727
  "src/lib/runners/tasks-pending-queue.ts"() {
1749
1728
  "use strict";
1750
1729
  init_git_error();
1751
1730
  init_git_logger();
1752
- _TasksPendingQueue = class {
1731
+ TasksPendingQueue = class _TasksPendingQueue {
1753
1732
  constructor(logLabel = "GitExecutor") {
1754
1733
  this.logLabel = logLabel;
1755
1734
  this._queue = /* @__PURE__ */ new Map();
@@ -1808,9 +1787,10 @@ var init_tasks_pending_queue = __esm({
1808
1787
  static getName(name = "empty") {
1809
1788
  return `task:${name}:${++_TasksPendingQueue.counter}`;
1810
1789
  }
1790
+ static {
1791
+ this.counter = 0;
1792
+ }
1811
1793
  };
1812
- TasksPendingQueue = _TasksPendingQueue;
1813
- TasksPendingQueue.counter = 0;
1814
1794
  }
1815
1795
  });
1816
1796
 
@@ -1870,20 +1850,18 @@ var init_git_executor_chain = __esm({
1870
1850
  this._queue.push(task);
1871
1851
  return this._chain = this._chain.then(() => this.attemptTask(task));
1872
1852
  }
1873
- attemptTask(task) {
1874
- return __async(this, null, function* () {
1875
- const onScheduleComplete = yield this._scheduler.next();
1876
- const onQueueComplete = () => this._queue.complete(task);
1877
- try {
1878
- const { logger } = this._queue.attempt(task);
1879
- return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);
1880
- } catch (e) {
1881
- throw this.onFatalException(task, e);
1882
- } finally {
1883
- onQueueComplete();
1884
- onScheduleComplete();
1885
- }
1886
- });
1853
+ async attemptTask(task) {
1854
+ const onScheduleComplete = await this._scheduler.next();
1855
+ const onQueueComplete = () => this._queue.complete(task);
1856
+ try {
1857
+ const { logger } = this._queue.attempt(task);
1858
+ return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
1859
+ } catch (e) {
1860
+ throw this.onFatalException(task, e);
1861
+ } finally {
1862
+ onQueueComplete();
1863
+ onScheduleComplete();
1864
+ }
1887
1865
  }
1888
1866
  onFatalException(task, e) {
1889
1867
  const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
@@ -1891,34 +1869,30 @@ var init_git_executor_chain = __esm({
1891
1869
  this._queue.fatal(gitError);
1892
1870
  return gitError;
1893
1871
  }
1894
- attemptRemoteTask(task, logger) {
1895
- return __async(this, null, function* () {
1896
- const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
1897
- const args = this._plugins.exec(
1898
- "spawn.args",
1899
- [...task.commands],
1900
- pluginContext(task, task.commands)
1901
- );
1902
- const raw = yield this.gitResponse(
1903
- task,
1904
- binary,
1905
- args,
1906
- this.outputHandler,
1907
- logger.step("SPAWN")
1908
- );
1909
- const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE"));
1910
- logger(`passing response to task's parser as a %s`, task.format);
1911
- if (isBufferTask(task)) {
1912
- return callTaskParser(task.parser, outputStreams);
1913
- }
1914
- return callTaskParser(task.parser, outputStreams.asStrings());
1915
- });
1872
+ async attemptRemoteTask(task, logger) {
1873
+ const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
1874
+ const args = this._plugins.exec(
1875
+ "spawn.args",
1876
+ [...task.commands],
1877
+ pluginContext(task, task.commands)
1878
+ );
1879
+ const raw = await this.gitResponse(
1880
+ task,
1881
+ binary,
1882
+ args,
1883
+ this.outputHandler,
1884
+ logger.step("SPAWN")
1885
+ );
1886
+ const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
1887
+ logger(`passing response to task's parser as a %s`, task.format);
1888
+ if (isBufferTask(task)) {
1889
+ return callTaskParser(task.parser, outputStreams);
1890
+ }
1891
+ return callTaskParser(task.parser, outputStreams.asStrings());
1916
1892
  }
1917
- attemptEmptyTask(task, logger) {
1918
- return __async(this, null, function* () {
1919
- logger(`empty task bypassing child process to call to task's parser`);
1920
- return task.parser(this);
1921
- });
1893
+ async attemptEmptyTask(task, logger) {
1894
+ logger(`empty task bypassing child process to call to task's parser`);
1895
+ return task.parser(this);
1922
1896
  }
1923
1897
  handleTaskData(task, args, result, logger) {
1924
1898
  const { exitCode, rejection, stdOut, stdErr } = result;
@@ -1927,7 +1901,10 @@ var init_git_executor_chain = __esm({
1927
1901
  const { error } = this._plugins.exec(
1928
1902
  "task.error",
1929
1903
  { error: rejection },
1930
- __spreadValues(__spreadValues({}, pluginContext(task, args)), result)
1904
+ {
1905
+ ...pluginContext(task, args),
1906
+ ...result
1907
+ }
1931
1908
  );
1932
1909
  if (error && task.onError) {
1933
1910
  logger.info(`exitCode=%s handling with custom error handler`);
@@ -1960,79 +1937,80 @@ var init_git_executor_chain = __esm({
1960
1937
  done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
1961
1938
  });
1962
1939
  }
1963
- gitResponse(task, command, args, outputHandler, logger) {
1964
- return __async(this, null, function* () {
1965
- const outputLogger = logger.sibling("output");
1966
- const spawnOptions = this._plugins.exec(
1967
- "spawn.options",
1968
- {
1969
- cwd: this.cwd,
1970
- env: this.env,
1971
- windowsHide: true
1972
- },
1973
- pluginContext(task, task.commands)
1940
+ async gitResponse(task, command, args, outputHandler, logger) {
1941
+ const outputLogger = logger.sibling("output");
1942
+ const spawnOptions = this._plugins.exec(
1943
+ "spawn.options",
1944
+ {
1945
+ cwd: this.cwd,
1946
+ env: this.env,
1947
+ windowsHide: true
1948
+ },
1949
+ pluginContext(task, task.commands)
1950
+ );
1951
+ return new Promise((done) => {
1952
+ const stdOut = [];
1953
+ const stdErr = [];
1954
+ logger.info(`%s %o`, command, args);
1955
+ logger("%O", spawnOptions);
1956
+ let rejection = this._beforeSpawn(task, args);
1957
+ if (rejection) {
1958
+ return done({
1959
+ stdOut,
1960
+ stdErr,
1961
+ exitCode: 9901,
1962
+ rejection
1963
+ });
1964
+ }
1965
+ this._plugins.exec("spawn.before", void 0, {
1966
+ ...pluginContext(task, args),
1967
+ kill(reason) {
1968
+ rejection = reason || rejection;
1969
+ }
1970
+ });
1971
+ const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);
1972
+ spawned.stdout.on(
1973
+ "data",
1974
+ onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
1975
+ );
1976
+ spawned.stderr.on(
1977
+ "data",
1978
+ onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
1974
1979
  );
1975
- return new Promise((done) => {
1976
- const stdOut = [];
1977
- const stdErr = [];
1978
- logger.info(`%s %o`, command, args);
1979
- logger("%O", spawnOptions);
1980
- let rejection = this._beforeSpawn(task, args);
1981
- if (rejection) {
1982
- return done({
1980
+ spawned.on("error", onErrorReceived(stdErr, logger));
1981
+ if (outputHandler) {
1982
+ logger(`Passing child process stdOut/stdErr to custom outputHandler`);
1983
+ outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
1984
+ }
1985
+ this._plugins.exec("spawn.after", void 0, {
1986
+ ...pluginContext(task, args),
1987
+ spawned,
1988
+ close(exitCode, reason) {
1989
+ done({
1983
1990
  stdOut,
1984
1991
  stdErr,
1985
- exitCode: 9901,
1986
- rejection
1992
+ exitCode,
1993
+ rejection: rejection || reason
1987
1994
  });
1988
- }
1989
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
1990
- kill(reason) {
1991
- rejection = reason || rejection;
1995
+ },
1996
+ kill(reason) {
1997
+ if (spawned.killed) {
1998
+ return;
1992
1999
  }
1993
- }));
1994
- const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);
1995
- spawned.stdout.on(
1996
- "data",
1997
- onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
1998
- );
1999
- spawned.stderr.on(
2000
- "data",
2001
- onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
2002
- );
2003
- spawned.on("error", onErrorReceived(stdErr, logger));
2004
- if (outputHandler) {
2005
- logger(`Passing child process stdOut/stdErr to custom outputHandler`);
2006
- outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
2000
+ rejection = reason;
2001
+ spawned.kill("SIGINT");
2007
2002
  }
2008
- this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2009
- spawned,
2010
- close(exitCode, reason) {
2011
- done({
2012
- stdOut,
2013
- stdErr,
2014
- exitCode,
2015
- rejection: rejection || reason
2016
- });
2017
- },
2018
- kill(reason) {
2019
- if (spawned.killed) {
2020
- return;
2021
- }
2022
- rejection = reason;
2023
- spawned.kill("SIGINT");
2024
- }
2025
- }));
2026
2003
  });
2027
2004
  });
2028
2005
  }
2029
2006
  _beforeSpawn(task, args) {
2030
2007
  let rejection;
2031
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
2008
+ this._plugins.exec("spawn.before", void 0, {
2009
+ ...pluginContext(task, args),
2032
2010
  kill(reason) {
2033
2011
  rejection = reason || rejection;
2034
2012
  }
2035
- }));
2013
+ });
2036
2014
  return rejection;
2037
2015
  }
2038
2016
  };
@@ -2072,7 +2050,7 @@ function taskCallback(task, response, callback = NOOP) {
2072
2050
  callback(null, data);
2073
2051
  };
2074
2052
  const onError2 = (err) => {
2075
- if ((err == null ? void 0 : err.task) === task) {
2053
+ if (err?.task === task) {
2076
2054
  callback(
2077
2055
  err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err,
2078
2056
  void 0
@@ -2202,7 +2180,7 @@ var init_count_objects = __esm({
2202
2180
  /([a-z-]+): (\d+)$/,
2203
2181
  (result, [key, value]) => {
2204
2182
  const property = asCamelCase(key);
2205
- if (result.hasOwnProperty(property)) {
2183
+ if (Object.hasOwn(result, property)) {
2206
2184
  result[property] = asNumber(value);
2207
2185
  }
2208
2186
  }
@@ -2294,7 +2272,10 @@ function commit_default() {
2294
2272
  const task = rejectDeprecatedSignatures(message) || commitTask(
2295
2273
  asArray(message),
2296
2274
  asArray(filterType(rest[0], filterStringOrStringArray, [])),
2297
- [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]
2275
+ [
2276
+ ...asStringArray(filterType(rest[1], filterArray, [])),
2277
+ ...getTrailingOptions(arguments, 0, true)
2278
+ ]
2298
2279
  );
2299
2280
  return this._runTask(task, next);
2300
2281
  }
@@ -2492,8 +2473,8 @@ var init_parse_diff_summary = __esm({
2492
2473
  const inserted = /(\d+) i/.exec(summary);
2493
2474
  const deleted = /(\d+) d/.exec(summary);
2494
2475
  result.changed = asNumber(changed);
2495
- result.insertions = asNumber(inserted == null ? void 0 : inserted[1]);
2496
- result.deletions = asNumber(deleted == null ? void 0 : deleted[1]);
2476
+ result.insertions = asNumber(inserted?.[1]);
2477
+ result.deletions = asNumber(deleted?.[1]);
2497
2478
  }
2498
2479
  )
2499
2480
  ];
@@ -2543,7 +2524,7 @@ var init_parse_diff_summary = __esm({
2543
2524
  (result, [status, similarity, from, _to, to]) => {
2544
2525
  result.changed++;
2545
2526
  result.files.push({
2546
- file: to != null ? to : from,
2527
+ file: to ?? from,
2547
2528
  changes: 0,
2548
2529
  insertions: 0,
2549
2530
  deletions: 0,
@@ -2673,7 +2654,7 @@ function userOptions(input) {
2673
2654
  }
2674
2655
  function parseLogOptions(opt = {}, customArgs = []) {
2675
2656
  const splitter = filterType(opt.splitter, filterString, SPLITTER);
2676
- const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {
2657
+ const format = filterPlainObject(opt.format) ? opt.format : {
2677
2658
  hash: "%H",
2678
2659
  date: opt.strictDate === false ? "%ai" : "%aI",
2679
2660
  message: "%s",
@@ -2720,7 +2701,7 @@ function log_default() {
2720
2701
  const next = trailingFunctionArgument(arguments);
2721
2702
  const options = parseLogOptions(
2722
2703
  trailingOptionsArgument(arguments),
2723
- filterType(arguments[0], filterArray)
2704
+ asStringArray(filterType(arguments[0], filterArray, []))
2724
2705
  );
2725
2706
  const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
2726
2707
  return this._runTask(task, next);
@@ -3092,9 +3073,10 @@ var init_parse_push = __esm({
3092
3073
  result.repo = repo;
3093
3074
  }),
3094
3075
  new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
3095
- result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {
3076
+ result.ref = {
3077
+ ...result.ref || {},
3096
3078
  local
3097
- });
3079
+ };
3098
3080
  }),
3099
3081
  new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
3100
3082
  result.pushed.push(pushResultPushedItem(local, remote, type));
@@ -3102,11 +3084,12 @@ var init_parse_push = __esm({
3102
3084
  new LineParser(
3103
3085
  /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
3104
3086
  (result, [local, remote, remoteName]) => {
3105
- result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {
3087
+ result.branch = {
3088
+ ...result.branch || {},
3106
3089
  local,
3107
3090
  remote,
3108
3091
  remoteName
3109
- });
3092
+ };
3110
3093
  }
3111
3094
  ),
3112
3095
  new LineParser(
@@ -3128,7 +3111,10 @@ var init_parse_push = __esm({
3128
3111
  parsePushResult = (stdOut, stdErr) => {
3129
3112
  const pushDetail = parsePushDetail(stdOut, stdErr);
3130
3113
  const responseDetail = parseRemoteMessages(stdOut, stdErr);
3131
- return __spreadValues(__spreadValues({}, pushDetail), responseDetail);
3114
+ return {
3115
+ ...pushDetail,
3116
+ ...responseDetail
3117
+ };
3132
3118
  };
3133
3119
  parsePushDetail = (stdOut, stdErr) => {
3134
3120
  return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
@@ -3360,18 +3346,19 @@ var init_StatusSummary = __esm({
3360
3346
  const behindReg = /behind (\d+)/;
3361
3347
  const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
3362
3348
  const trackingReg = /\.{3}(\S*)/;
3363
- const onEmptyBranchReg = /\son\s([\S]+)$/;
3364
- let regexResult;
3365
- regexResult = aheadReg.exec(line);
3349
+ const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
3350
+ let regexResult = aheadReg.exec(line);
3366
3351
  result.ahead = regexResult && +regexResult[1] || 0;
3367
3352
  regexResult = behindReg.exec(line);
3368
3353
  result.behind = regexResult && +regexResult[1] || 0;
3369
3354
  regexResult = currentReg.exec(line);
3370
- result.current = regexResult && regexResult[1];
3355
+ result.current = filterType(regexResult?.[1], filterString, null);
3371
3356
  regexResult = trackingReg.exec(line);
3372
- result.tracking = regexResult && regexResult[1];
3357
+ result.tracking = filterType(regexResult?.[1], filterString, null);
3373
3358
  regexResult = onEmptyBranchReg.exec(line);
3374
- result.current = regexResult && regexResult[1] || result.current;
3359
+ if (regexResult) {
3360
+ result.current = filterType(regexResult?.[1], filterString, result.current);
3361
+ }
3375
3362
  result.detached = /\(no branch\)/.test(line);
3376
3363
  }
3377
3364
  ]
@@ -3547,7 +3534,7 @@ var init_simple_git_api = __esm({
3547
3534
  if (typeof directory === "string") {
3548
3535
  return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);
3549
3536
  }
3550
- if (typeof (directory == null ? void 0 : directory.path) === "string") {
3537
+ if (typeof directory?.path === "string") {
3551
3538
  return this._runTask(
3552
3539
  changeWorkingDirectoryTask(
3553
3540
  directory.path,
@@ -3646,7 +3633,7 @@ var init_scheduler = __esm({
3646
3633
  init_utils();
3647
3634
  import_promise_deferred2 = require("@kwsites/promise-deferred");
3648
3635
  init_git_logger();
3649
- createScheduledTask = (() => {
3636
+ createScheduledTask = /* @__PURE__ */ (() => {
3650
3637
  let id = 0;
3651
3638
  return () => {
3652
3639
  id++;
@@ -3806,10 +3793,14 @@ var init_BranchSummary = __esm({
3806
3793
  function branchStatus(input) {
3807
3794
  return input ? input.charAt(0) : "";
3808
3795
  }
3809
- function parseBranchSummary(stdOut) {
3810
- return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut);
3796
+ function parseBranchSummary(stdOut, currentOnly = false) {
3797
+ return parseStringResponse(
3798
+ new BranchSummaryResult(),
3799
+ currentOnly ? [currentBranchParser] : parsers9,
3800
+ stdOut
3801
+ );
3811
3802
  }
3812
- var parsers9;
3803
+ var parsers9, currentBranchParser;
3813
3804
  var init_parse_branch = __esm({
3814
3805
  "src/lib/parsers/parse-branch.ts"() {
3815
3806
  "use strict";
@@ -3823,12 +3814,15 @@ var init_parse_branch = __esm({
3823
3814
  }
3824
3815
  ),
3825
3816
  new LineParser(
3826
- new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$", "s"),
3817
+ /^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
3827
3818
  (result, [current, name, commit, label]) => {
3828
3819
  result.push(branchStatus(current), false, name, commit, label);
3829
3820
  }
3830
3821
  )
3831
3822
  ];
3823
+ currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
3824
+ result.push("*" /* CURRENT */, false, name, "", "");
3825
+ });
3832
3826
  }
3833
3827
  });
3834
3828
 
@@ -3847,6 +3841,7 @@ function containsDeleteBranchCommand(commands) {
3847
3841
  }
3848
3842
  function branchTask(customArgs) {
3849
3843
  const isDelete = containsDeleteBranchCommand(customArgs);
3844
+ const isCurrentOnly = customArgs.includes("--show-current");
3850
3845
  const commands = ["branch", ...customArgs];
3851
3846
  if (commands.length === 1) {
3852
3847
  commands.push("-a");
@@ -3861,16 +3856,17 @@ function branchTask(customArgs) {
3861
3856
  if (isDelete) {
3862
3857
  return parseBranchDeletions(stdOut, stdErr).all[0];
3863
3858
  }
3864
- return parseBranchSummary(stdOut);
3859
+ return parseBranchSummary(stdOut, isCurrentOnly);
3865
3860
  }
3866
3861
  };
3867
3862
  }
3868
3863
  function branchLocalTask() {
3869
- const parser4 = parseBranchSummary;
3870
3864
  return {
3871
3865
  format: "utf-8",
3872
3866
  commands: ["branch", "-v"],
3873
- parser: parser4
3867
+ parser(stdOut) {
3868
+ return parseBranchSummary(stdOut);
3869
+ }
3874
3870
  };
3875
3871
  }
3876
3872
  function deleteBranchesTask(branches, forceDelete = false) {
@@ -3918,12 +3914,17 @@ var init_branch = __esm({
3918
3914
  });
3919
3915
 
3920
3916
  // src/lib/responses/CheckIgnore.ts
3921
- var parseCheckIgnore;
3917
+ function toPath(input) {
3918
+ const path = input.trim().replace(/^["']|["']$/g, "");
3919
+ return path && (0, import_node_path.normalize)(path);
3920
+ }
3921
+ var import_node_path, parseCheckIgnore;
3922
3922
  var init_CheckIgnore = __esm({
3923
3923
  "src/lib/responses/CheckIgnore.ts"() {
3924
3924
  "use strict";
3925
+ import_node_path = require("node:path");
3925
3926
  parseCheckIgnore = (text) => {
3926
- return text.split(/\n/g).map((line) => line.trim()).filter((file) => !!file);
3927
+ return text.split(/\n/g).map(toPath).filter(Boolean);
3927
3928
  };
3928
3929
  }
3929
3930
  });
@@ -4145,7 +4146,7 @@ function parseGetRemotes(text) {
4145
4146
  function parseGetRemotesVerbose(text) {
4146
4147
  const remotes = {};
4147
4148
  forEach(text, ([name, url, purpose]) => {
4148
- if (!remotes.hasOwnProperty(name)) {
4149
+ if (!Object.hasOwn(remotes, name)) {
4149
4150
  remotes[name] = {
4150
4151
  name,
4151
4152
  refs: { fetch: "", push: "" }
@@ -4277,8 +4278,8 @@ var init_sub_module = __esm({
4277
4278
 
4278
4279
  // src/lib/responses/TagList.ts
4279
4280
  function singleSorted(a, b) {
4280
- const aIsNum = isNaN(a);
4281
- const bIsNum = isNaN(b);
4281
+ const aIsNum = Number.isNaN(a);
4282
+ const bIsNum = Number.isNaN(b);
4282
4283
  if (aIsNum !== bIsNum) {
4283
4284
  return aIsNum ? 1 : -1;
4284
4285
  }
@@ -4769,7 +4770,6 @@ function gitExportFactory(factory) {
4769
4770
  return Object.assign(factory.bind(null), api_exports);
4770
4771
  }
4771
4772
  function gitInstanceFactory(baseDir, options) {
4772
- var _a2;
4773
4773
  const plugins = new PluginStore();
4774
4774
  const config = createInstanceConfig(
4775
4775
  baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {},
@@ -4793,7 +4793,7 @@ function gitInstanceFactory(baseDir, options) {
4793
4793
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
4794
4794
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
4795
4795
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
4796
- customBinaryPlugin(plugins, config.binary, (_a2 = config.unsafe) == null ? void 0 : _a2.allowUnsafeCustomBinary);
4796
+ customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
4797
4797
  return new Git(config, plugins);
4798
4798
  }
4799
4799
  var Git;