@unpackjs/core 3.3.2 → 3.3.4

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.
@@ -0,0 +1,753 @@
1
+ (() => {
2
+ var __webpack_modules__ = {
3
+ 218: (module) => {
4
+ module.exports = {
5
+ atom: "atom",
6
+ Brackets: "brackets",
7
+ "code-insiders": "code-insiders",
8
+ code: "code",
9
+ vscodium: "vscodium",
10
+ codium: "codium",
11
+ trae: "trae",
12
+ emacs: "emacs",
13
+ gvim: "gvim",
14
+ idea: "idea",
15
+ "idea.sh": "idea",
16
+ phpstorm: "phpstorm",
17
+ "phpstorm.sh": "phpstorm",
18
+ pycharm: "pycharm",
19
+ "pycharm.sh": "pycharm",
20
+ rubymine: "rubymine",
21
+ "rubymine.sh": "rubymine",
22
+ sublime_text: "subl",
23
+ vim: "vim",
24
+ webstorm: "webstorm",
25
+ "webstorm.sh": "webstorm",
26
+ goland: "goland",
27
+ "goland.sh": "goland",
28
+ rider: "rider",
29
+ "rider.sh": "rider",
30
+ zed: "zed",
31
+ };
32
+ },
33
+ 193: (module) => {
34
+ module.exports = {
35
+ "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
36
+ "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":
37
+ "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta",
38
+ "/Applications/Brackets.app/Contents/MacOS/Brackets": "brackets",
39
+ "/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":
40
+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
41
+ "/Applications/Sublime Text.app/Contents/MacOS/sublime_text":
42
+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
43
+ "/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":
44
+ "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
45
+ "/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":
46
+ "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
47
+ "/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
48
+ "/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":
49
+ "code-insiders",
50
+ "/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
51
+ "/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
52
+ "/Applications/Trae.app/Contents/MacOS/Electron": "trae",
53
+ "/Applications/AppCode.app/Contents/MacOS/appcode":
54
+ "/Applications/AppCode.app/Contents/MacOS/appcode",
55
+ "/Applications/CLion.app/Contents/MacOS/clion":
56
+ "/Applications/CLion.app/Contents/MacOS/clion",
57
+ "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":
58
+ "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
59
+ "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":
60
+ "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea",
61
+ "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":
62
+ "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea",
63
+ "/Applications/PhpStorm.app/Contents/MacOS/phpstorm":
64
+ "/Applications/PhpStorm.app/Contents/MacOS/phpstorm",
65
+ "/Applications/PyCharm.app/Contents/MacOS/pycharm":
66
+ "/Applications/PyCharm.app/Contents/MacOS/pycharm",
67
+ "/Applications/PyCharm CE.app/Contents/MacOS/pycharm":
68
+ "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
69
+ "/Applications/RubyMine.app/Contents/MacOS/rubymine":
70
+ "/Applications/RubyMine.app/Contents/MacOS/rubymine",
71
+ "/Applications/WebStorm.app/Contents/MacOS/webstorm":
72
+ "/Applications/WebStorm.app/Contents/MacOS/webstorm",
73
+ "/Applications/MacVim.app/Contents/MacOS/MacVim": "mvim",
74
+ "/Applications/GoLand.app/Contents/MacOS/goland":
75
+ "/Applications/GoLand.app/Contents/MacOS/goland",
76
+ "/Applications/Rider.app/Contents/MacOS/rider":
77
+ "/Applications/Rider.app/Contents/MacOS/rider",
78
+ "/Applications/Zed.app/Contents/MacOS/zed": "zed",
79
+ };
80
+ },
81
+ 361: (module) => {
82
+ module.exports = [
83
+ "Brackets.exe",
84
+ "Code.exe",
85
+ "Code - Insiders.exe",
86
+ "VSCodium.exe",
87
+ "Cursor.exe",
88
+ "atom.exe",
89
+ "sublime_text.exe",
90
+ "notepad++.exe",
91
+ "clion.exe",
92
+ "clion64.exe",
93
+ "idea.exe",
94
+ "idea64.exe",
95
+ "phpstorm.exe",
96
+ "phpstorm64.exe",
97
+ "pycharm.exe",
98
+ "pycharm64.exe",
99
+ "rubymine.exe",
100
+ "rubymine64.exe",
101
+ "webstorm.exe",
102
+ "webstorm64.exe",
103
+ "goland.exe",
104
+ "goland64.exe",
105
+ "rider.exe",
106
+ "rider64.exe",
107
+ "trae.exe",
108
+ ];
109
+ },
110
+ 421: (module, __unused_webpack_exports, __nccwpck_require__) => {
111
+ const path = __nccwpck_require__(928);
112
+ module.exports = function getArgumentsForPosition(
113
+ editor,
114
+ fileName,
115
+ lineNumber,
116
+ columnNumber = 1,
117
+ ) {
118
+ const editorBasename = path
119
+ .basename(editor)
120
+ .replace(/\.(exe|cmd|bat)$/i, "");
121
+ switch (editorBasename) {
122
+ case "atom":
123
+ case "Atom":
124
+ case "Atom Beta":
125
+ case "subl":
126
+ case "sublime":
127
+ case "sublime_text":
128
+ case "wstorm":
129
+ case "charm":
130
+ case "zed":
131
+ return [`${fileName}:${lineNumber}:${columnNumber}`];
132
+ case "notepad++":
133
+ return ["-n" + lineNumber, "-c" + columnNumber, fileName];
134
+ case "vim":
135
+ case "mvim":
136
+ return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName];
137
+ case "joe":
138
+ case "gvim":
139
+ return ["+" + `${lineNumber}`, fileName];
140
+ case "emacs":
141
+ case "emacsclient":
142
+ return [`+${lineNumber}:${columnNumber}`, fileName];
143
+ case "rmate":
144
+ case "mate":
145
+ case "mine":
146
+ return ["--line", lineNumber, fileName];
147
+ case "code":
148
+ case "Code":
149
+ case "code-insiders":
150
+ case "Code - Insiders":
151
+ case "codium":
152
+ case "trae":
153
+ case "cursor":
154
+ case "vscodium":
155
+ case "VSCodium":
156
+ return ["-r", "-g", `${fileName}:${lineNumber}:${columnNumber}`];
157
+ case "appcode":
158
+ case "clion":
159
+ case "clion64":
160
+ case "idea":
161
+ case "idea64":
162
+ case "phpstorm":
163
+ case "phpstorm64":
164
+ case "pycharm":
165
+ case "pycharm64":
166
+ case "rubymine":
167
+ case "rubymine64":
168
+ case "webstorm":
169
+ case "webstorm64":
170
+ case "goland":
171
+ case "goland64":
172
+ case "rider":
173
+ case "rider64":
174
+ return ["--line", lineNumber, "--column", columnNumber, fileName];
175
+ }
176
+ if (process.env.LAUNCH_EDITOR) {
177
+ return [fileName, lineNumber, columnNumber];
178
+ }
179
+ return [fileName];
180
+ };
181
+ },
182
+ 346: (module, __unused_webpack_exports, __nccwpck_require__) => {
183
+ const path = __nccwpck_require__(928);
184
+ const shellQuote = __nccwpck_require__(710);
185
+ const childProcess = __nccwpck_require__(317);
186
+ const COMMON_EDITORS_MACOS = __nccwpck_require__(193);
187
+ const COMMON_EDITORS_LINUX = __nccwpck_require__(218);
188
+ const COMMON_EDITORS_WIN = __nccwpck_require__(361);
189
+ module.exports = function guessEditor(specifiedEditor) {
190
+ if (specifiedEditor) {
191
+ return shellQuote.parse(specifiedEditor);
192
+ }
193
+ if (process.env.LAUNCH_EDITOR) {
194
+ return [process.env.LAUNCH_EDITOR];
195
+ }
196
+ if (process.versions.webcontainer) {
197
+ return [process.env.EDITOR || "code"];
198
+ }
199
+ try {
200
+ if (process.platform === "darwin") {
201
+ const output = childProcess
202
+ .execSync("ps x -o comm=", { stdio: ["pipe", "pipe", "ignore"] })
203
+ .toString();
204
+ const processNames = Object.keys(COMMON_EDITORS_MACOS);
205
+ const processList = output.split("\n");
206
+ for (let i = 0; i < processNames.length; i++) {
207
+ const processName = processNames[i];
208
+ if (processList.includes(processName)) {
209
+ return [COMMON_EDITORS_MACOS[processName]];
210
+ }
211
+ const processNameWithoutApplications = processName.replace(
212
+ "/Applications",
213
+ "",
214
+ );
215
+ if (output.indexOf(processNameWithoutApplications) !== -1) {
216
+ if (processName !== COMMON_EDITORS_MACOS[processName]) {
217
+ return [COMMON_EDITORS_MACOS[processName]];
218
+ }
219
+ const runningProcess = processList.find((procName) =>
220
+ procName.endsWith(processNameWithoutApplications),
221
+ );
222
+ if (runningProcess !== undefined) {
223
+ return [runningProcess];
224
+ }
225
+ }
226
+ }
227
+ } else if (process.platform === "win32") {
228
+ const output = childProcess
229
+ .execSync(
230
+ 'powershell -NoProfile -Command "' +
231
+ "[Console]::OutputEncoding=[Text.Encoding]::UTF8;" +
232
+ 'Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }' +
233
+ '"',
234
+ { stdio: ["pipe", "pipe", "ignore"] },
235
+ )
236
+ .toString();
237
+ const runningProcesses = output.split("\r\n");
238
+ for (let i = 0; i < runningProcesses.length; i++) {
239
+ const fullProcessPath = runningProcesses[i].trim();
240
+ const shortProcessName = path.basename(fullProcessPath);
241
+ if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) {
242
+ return [fullProcessPath];
243
+ }
244
+ }
245
+ } else if (process.platform === "linux") {
246
+ const output = childProcess
247
+ .execSync("ps x --no-heading -o comm --sort=comm", {
248
+ stdio: ["pipe", "pipe", "ignore"],
249
+ })
250
+ .toString();
251
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
252
+ for (let i = 0; i < processNames.length; i++) {
253
+ const processName = processNames[i];
254
+ if (output.indexOf(processName) !== -1) {
255
+ return [COMMON_EDITORS_LINUX[processName]];
256
+ }
257
+ }
258
+ }
259
+ } catch (ignoreError) {}
260
+ if (process.env.VISUAL) {
261
+ return [process.env.VISUAL];
262
+ } else if (process.env.EDITOR) {
263
+ return [process.env.EDITOR];
264
+ }
265
+ return [null];
266
+ };
267
+ },
268
+ 719: (module, __unused_webpack_exports, __nccwpck_require__) => {
269
+ const fs = __nccwpck_require__(896);
270
+ const os = __nccwpck_require__(857);
271
+ const path = __nccwpck_require__(928);
272
+ const colors = __nccwpck_require__(456);
273
+ const childProcess = __nccwpck_require__(317);
274
+ const guessEditor = __nccwpck_require__(346);
275
+ const getArgumentsForPosition = __nccwpck_require__(421);
276
+ function wrapErrorCallback(cb) {
277
+ return (fileName, errorMessage) => {
278
+ console.log();
279
+ console.log(
280
+ colors.red(
281
+ "Could not open " + path.basename(fileName) + " in the editor.",
282
+ ),
283
+ );
284
+ if (errorMessage) {
285
+ if (errorMessage[errorMessage.length - 1] !== ".") {
286
+ errorMessage += ".";
287
+ }
288
+ console.log(
289
+ colors.red(
290
+ "The editor process exited with an error: " + errorMessage,
291
+ ),
292
+ );
293
+ }
294
+ console.log();
295
+ if (cb) cb(fileName, errorMessage);
296
+ };
297
+ }
298
+ function isTerminalEditor(editor) {
299
+ switch (editor) {
300
+ case "vim":
301
+ case "emacs":
302
+ case "nano":
303
+ return true;
304
+ }
305
+ return false;
306
+ }
307
+ const positionRE = /:(\d+)(:(\d+))?$/;
308
+ function parseFile(file) {
309
+ if (file.startsWith("file://")) {
310
+ file = __nccwpck_require__(16).fileURLToPath(file);
311
+ }
312
+ const fileName = file.replace(positionRE, "");
313
+ const match = file.match(positionRE);
314
+ const lineNumber = match && match[1];
315
+ const columnNumber = match && match[3];
316
+ return { fileName, lineNumber, columnNumber };
317
+ }
318
+ let _childProcess = null;
319
+ function launchEditor(file, specifiedEditor, onErrorCallback) {
320
+ const parsed = parseFile(file);
321
+ let { fileName } = parsed;
322
+ const { lineNumber, columnNumber } = parsed;
323
+ if (!fs.existsSync(fileName)) {
324
+ return;
325
+ }
326
+ if (typeof specifiedEditor === "function") {
327
+ onErrorCallback = specifiedEditor;
328
+ specifiedEditor = undefined;
329
+ }
330
+ onErrorCallback = wrapErrorCallback(onErrorCallback);
331
+ const [editor, ...args] = guessEditor(specifiedEditor);
332
+ if (!editor) {
333
+ onErrorCallback(fileName, null);
334
+ return;
335
+ }
336
+ if (
337
+ process.platform === "linux" &&
338
+ fileName.startsWith("/mnt/") &&
339
+ /Microsoft/i.test(os.release())
340
+ ) {
341
+ fileName = path.relative("", fileName);
342
+ }
343
+ if (lineNumber) {
344
+ const extraArgs = getArgumentsForPosition(
345
+ editor,
346
+ fileName,
347
+ lineNumber,
348
+ columnNumber,
349
+ );
350
+ args.push.apply(args, extraArgs);
351
+ } else {
352
+ args.push(fileName);
353
+ }
354
+ if (_childProcess && isTerminalEditor(editor)) {
355
+ _childProcess.kill("SIGKILL");
356
+ }
357
+ if (process.platform === "win32") {
358
+ function escapeCmdArgs(cmdArgs) {
359
+ return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
360
+ }
361
+ function doubleQuoteIfNeeded(str) {
362
+ if (str.includes("^")) {
363
+ return `^"${str}^"`;
364
+ } else if (str.includes(" ")) {
365
+ return `"${str}"`;
366
+ }
367
+ return str;
368
+ }
369
+ const launchCommand = [editor, ...args.map(escapeCmdArgs)]
370
+ .map(doubleQuoteIfNeeded)
371
+ .join(" ");
372
+ _childProcess = childProcess.exec(launchCommand, {
373
+ stdio: "inherit",
374
+ shell: true,
375
+ });
376
+ } else {
377
+ _childProcess = childProcess.spawn(editor, args, {
378
+ stdio: "inherit",
379
+ });
380
+ }
381
+ _childProcess.on("exit", function (errorCode) {
382
+ _childProcess = null;
383
+ if (errorCode) {
384
+ onErrorCallback(fileName, "(code " + errorCode + ")");
385
+ }
386
+ });
387
+ _childProcess.on("error", function (error) {
388
+ let { code, message } = error;
389
+ if ("ENOENT" === code) {
390
+ message = `${message} ('${editor}' command does not exist in 'PATH')`;
391
+ }
392
+ onErrorCallback(fileName, message);
393
+ });
394
+ }
395
+ module.exports = launchEditor;
396
+ },
397
+ 456: (module) => {
398
+ let p = process || {},
399
+ argv = p.argv || [],
400
+ env = p.env || {};
401
+ let isColorSupported =
402
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
403
+ (!!env.FORCE_COLOR ||
404
+ argv.includes("--color") ||
405
+ p.platform === "win32" ||
406
+ ((p.stdout || {}).isTTY && env.TERM !== "dumb") ||
407
+ !!env.CI);
408
+ let formatter =
409
+ (open, close, replace = open) =>
410
+ (input) => {
411
+ let string = "" + input,
412
+ index = string.indexOf(close, open.length);
413
+ return ~index
414
+ ? open + replaceClose(string, close, replace, index) + close
415
+ : open + string + close;
416
+ };
417
+ let replaceClose = (string, close, replace, index) => {
418
+ let result = "",
419
+ cursor = 0;
420
+ do {
421
+ result += string.substring(cursor, index) + replace;
422
+ cursor = index + close.length;
423
+ index = string.indexOf(close, cursor);
424
+ } while (~index);
425
+ return result + string.substring(cursor);
426
+ };
427
+ let createColors = (enabled = isColorSupported) => {
428
+ let f = enabled ? formatter : () => String;
429
+ return {
430
+ isColorSupported: enabled,
431
+ reset: f("", ""),
432
+ bold: f("", "", ""),
433
+ dim: f("", "", ""),
434
+ italic: f("", ""),
435
+ underline: f("", ""),
436
+ inverse: f("", ""),
437
+ hidden: f("", ""),
438
+ strikethrough: f("", ""),
439
+ black: f("", ""),
440
+ red: f("", ""),
441
+ green: f("", ""),
442
+ yellow: f("", ""),
443
+ blue: f("", ""),
444
+ magenta: f("", ""),
445
+ cyan: f("", ""),
446
+ white: f("", ""),
447
+ gray: f("", ""),
448
+ bgBlack: f("", ""),
449
+ bgRed: f("", ""),
450
+ bgGreen: f("", ""),
451
+ bgYellow: f("", ""),
452
+ bgBlue: f("", ""),
453
+ bgMagenta: f("", ""),
454
+ bgCyan: f("", ""),
455
+ bgWhite: f("", ""),
456
+ blackBright: f("", ""),
457
+ redBright: f("", ""),
458
+ greenBright: f("", ""),
459
+ yellowBright: f("", ""),
460
+ blueBright: f("", ""),
461
+ magentaBright: f("", ""),
462
+ cyanBright: f("", ""),
463
+ whiteBright: f("", ""),
464
+ bgBlackBright: f("", ""),
465
+ bgRedBright: f("", ""),
466
+ bgGreenBright: f("", ""),
467
+ bgYellowBright: f("", ""),
468
+ bgBlueBright: f("", ""),
469
+ bgMagentaBright: f("", ""),
470
+ bgCyanBright: f("", ""),
471
+ bgWhiteBright: f("", ""),
472
+ };
473
+ };
474
+ module.exports = createColors();
475
+ module.exports.createColors = createColors;
476
+ },
477
+ 710: (__unused_webpack_module, exports, __nccwpck_require__) => {
478
+ "use strict";
479
+ exports.quote = __nccwpck_require__(210);
480
+ exports.parse = __nccwpck_require__(885);
481
+ },
482
+ 885: (module) => {
483
+ "use strict";
484
+ var CONTROL =
485
+ "(?:" +
486
+ [
487
+ "\\|\\|",
488
+ "\\&\\&",
489
+ ";;",
490
+ "\\|\\&",
491
+ "\\<\\(",
492
+ "\\<\\<\\<",
493
+ ">>",
494
+ ">\\&",
495
+ "<\\&",
496
+ "[&;()|<>]",
497
+ ].join("|") +
498
+ ")";
499
+ var controlRE = new RegExp("^" + CONTROL + "$");
500
+ var META = "|&;()<> \\t";
501
+ var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
502
+ var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
503
+ var hash = /^#$/;
504
+ var SQ = "'";
505
+ var DQ = '"';
506
+ var DS = "$";
507
+ var TOKEN = "";
508
+ var mult = 4294967296;
509
+ for (var i = 0; i < 4; i++) {
510
+ TOKEN += (mult * Math.random()).toString(16);
511
+ }
512
+ var startsWithToken = new RegExp("^" + TOKEN);
513
+ function matchAll(s, r) {
514
+ var origIndex = r.lastIndex;
515
+ var matches = [];
516
+ var matchObj;
517
+ while ((matchObj = r.exec(s))) {
518
+ matches.push(matchObj);
519
+ if (r.lastIndex === matchObj.index) {
520
+ r.lastIndex += 1;
521
+ }
522
+ }
523
+ r.lastIndex = origIndex;
524
+ return matches;
525
+ }
526
+ function getVar(env, pre, key) {
527
+ var r = typeof env === "function" ? env(key) : env[key];
528
+ if (typeof r === "undefined" && key != "") {
529
+ r = "";
530
+ } else if (typeof r === "undefined") {
531
+ r = "$";
532
+ }
533
+ if (typeof r === "object") {
534
+ return pre + TOKEN + JSON.stringify(r) + TOKEN;
535
+ }
536
+ return pre + r;
537
+ }
538
+ function parseInternal(string, env, opts) {
539
+ if (!opts) {
540
+ opts = {};
541
+ }
542
+ var BS = opts.escape || "\\";
543
+ var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
544
+ var chunker = new RegExp(
545
+ [
546
+ "(" + CONTROL + ")",
547
+ "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+",
548
+ ].join("|"),
549
+ "g",
550
+ );
551
+ var matches = matchAll(string, chunker);
552
+ if (matches.length === 0) {
553
+ return [];
554
+ }
555
+ if (!env) {
556
+ env = {};
557
+ }
558
+ var commented = false;
559
+ return matches
560
+ .map(function (match) {
561
+ var s = match[0];
562
+ if (!s || commented) {
563
+ return void undefined;
564
+ }
565
+ if (controlRE.test(s)) {
566
+ return { op: s };
567
+ }
568
+ var quote = false;
569
+ var esc = false;
570
+ var out = "";
571
+ var isGlob = false;
572
+ var i;
573
+ function parseEnvVar() {
574
+ i += 1;
575
+ var varend;
576
+ var varname;
577
+ var char = s.charAt(i);
578
+ if (char === "{") {
579
+ i += 1;
580
+ if (s.charAt(i) === "}") {
581
+ throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
582
+ }
583
+ varend = s.indexOf("}", i);
584
+ if (varend < 0) {
585
+ throw new Error("Bad substitution: " + s.slice(i));
586
+ }
587
+ varname = s.slice(i, varend);
588
+ i = varend;
589
+ } else if (/[*@#?$!_-]/.test(char)) {
590
+ varname = char;
591
+ i += 1;
592
+ } else {
593
+ var slicedFromI = s.slice(i);
594
+ varend = slicedFromI.match(/[^\w\d_]/);
595
+ if (!varend) {
596
+ varname = slicedFromI;
597
+ i = s.length;
598
+ } else {
599
+ varname = slicedFromI.slice(0, varend.index);
600
+ i += varend.index - 1;
601
+ }
602
+ }
603
+ return getVar(env, "", varname);
604
+ }
605
+ for (i = 0; i < s.length; i++) {
606
+ var c = s.charAt(i);
607
+ isGlob = isGlob || (!quote && (c === "*" || c === "?"));
608
+ if (esc) {
609
+ out += c;
610
+ esc = false;
611
+ } else if (quote) {
612
+ if (c === quote) {
613
+ quote = false;
614
+ } else if (quote == SQ) {
615
+ out += c;
616
+ } else {
617
+ if (c === BS) {
618
+ i += 1;
619
+ c = s.charAt(i);
620
+ if (c === DQ || c === BS || c === DS) {
621
+ out += c;
622
+ } else {
623
+ out += BS + c;
624
+ }
625
+ } else if (c === DS) {
626
+ out += parseEnvVar();
627
+ } else {
628
+ out += c;
629
+ }
630
+ }
631
+ } else if (c === DQ || c === SQ) {
632
+ quote = c;
633
+ } else if (controlRE.test(c)) {
634
+ return { op: s };
635
+ } else if (hash.test(c)) {
636
+ commented = true;
637
+ var commentObj = { comment: string.slice(match.index + i + 1) };
638
+ if (out.length) {
639
+ return [out, commentObj];
640
+ }
641
+ return [commentObj];
642
+ } else if (c === BS) {
643
+ esc = true;
644
+ } else if (c === DS) {
645
+ out += parseEnvVar();
646
+ } else {
647
+ out += c;
648
+ }
649
+ }
650
+ if (isGlob) {
651
+ return { op: "glob", pattern: out };
652
+ }
653
+ return out;
654
+ })
655
+ .reduce(function (prev, arg) {
656
+ return typeof arg === "undefined" ? prev : prev.concat(arg);
657
+ }, []);
658
+ }
659
+ module.exports = function parse(s, env, opts) {
660
+ var mapped = parseInternal(s, env, opts);
661
+ if (typeof env !== "function") {
662
+ return mapped;
663
+ }
664
+ return mapped.reduce(function (acc, s) {
665
+ if (typeof s === "object") {
666
+ return acc.concat(s);
667
+ }
668
+ var xs = s.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
669
+ if (xs.length === 1) {
670
+ return acc.concat(xs[0]);
671
+ }
672
+ return acc.concat(
673
+ xs.filter(Boolean).map(function (x) {
674
+ if (startsWithToken.test(x)) {
675
+ return JSON.parse(x.split(TOKEN)[1]);
676
+ }
677
+ return x;
678
+ }),
679
+ );
680
+ }, []);
681
+ };
682
+ },
683
+ 210: (module) => {
684
+ "use strict";
685
+ module.exports = function quote(xs) {
686
+ return xs
687
+ .map(function (s) {
688
+ if (s === "") {
689
+ return "''";
690
+ }
691
+ if (s && typeof s === "object") {
692
+ return s.op.replace(/(.)/g, "\\$1");
693
+ }
694
+ if (/["\s\\]/.test(s) && !/'/.test(s)) {
695
+ return "'" + s.replace(/(['])/g, "\\$1") + "'";
696
+ }
697
+ if (/["'\s]/.test(s)) {
698
+ return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
699
+ }
700
+ return String(s).replace(
701
+ /([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,
702
+ "$1\\$2",
703
+ );
704
+ })
705
+ .join(" ");
706
+ };
707
+ },
708
+ 317: (module) => {
709
+ "use strict";
710
+ module.exports = require("child_process");
711
+ },
712
+ 896: (module) => {
713
+ "use strict";
714
+ module.exports = require("fs");
715
+ },
716
+ 857: (module) => {
717
+ "use strict";
718
+ module.exports = require("os");
719
+ },
720
+ 928: (module) => {
721
+ "use strict";
722
+ module.exports = require("path");
723
+ },
724
+ 16: (module) => {
725
+ "use strict";
726
+ module.exports = require("url");
727
+ },
728
+ };
729
+ var __webpack_module_cache__ = {};
730
+ function __nccwpck_require__(moduleId) {
731
+ var cachedModule = __webpack_module_cache__[moduleId];
732
+ if (cachedModule !== undefined) {
733
+ return cachedModule.exports;
734
+ }
735
+ var module = (__webpack_module_cache__[moduleId] = { exports: {} });
736
+ var threw = true;
737
+ try {
738
+ __webpack_modules__[moduleId](
739
+ module,
740
+ module.exports,
741
+ __nccwpck_require__,
742
+ );
743
+ threw = false;
744
+ } finally {
745
+ if (threw) delete __webpack_module_cache__[moduleId];
746
+ }
747
+ return module.exports;
748
+ }
749
+ if (typeof __nccwpck_require__ !== "undefined")
750
+ __nccwpck_require__.ab = __dirname + "/";
751
+ var __webpack_exports__ = __nccwpck_require__(719);
752
+ module.exports = __webpack_exports__;
753
+ })();