sv 0.11.2 → 0.11.3
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/dist/add-BWQarWDB.mjs +7000 -0
- package/dist/add-nRRWTjzp.d.mts +35 -0
- package/dist/bin.mjs +25 -1845
- package/dist/{index-7xp7FWpU.d.mts → core-CnPhgWST.d.mts} +294 -46
- package/dist/lib/core.d.mts +2 -0
- package/dist/lib/core.mjs +3 -0
- package/dist/lib/index.d.mts +16 -0
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/testing.d.mts +108 -0
- package/dist/lib/testing.mjs +970 -927
- package/dist/{package-manager-CySZrSUa.mjs → package-manager-DkCPtZM1.mjs} +219 -1328
- package/dist/shared.json +30 -4
- package/dist/templates/addon/assets/DOT-gitignore +27 -0
- package/dist/templates/addon/assets/src/index.js +52 -0
- package/dist/templates/addon/assets/tests/addon.test.js +50 -0
- package/dist/templates/addon/assets/tests/setup/global.js +14 -0
- package/dist/templates/addon/assets/tests/setup/suite.js +130 -0
- package/dist/templates/addon/assets/vitest.config.js +16 -0
- package/dist/templates/addon/files.types=checkjs.json +1 -0
- package/dist/templates/addon/files.types=none.json +1 -0
- package/dist/templates/addon/files.types=typescript.json +1 -0
- package/dist/templates/addon/meta.json +4 -0
- package/dist/templates/addon/package.json +32 -0
- package/dist/templates/demo/files.types=checkjs.json +5 -5
- package/dist/templates/demo/files.types=none.json +5 -5
- package/dist/templates/demo/files.types=typescript.json +5 -5
- package/dist/templates/demo/package.json +1 -1
- package/dist/templates/library/package.json +1 -1
- package/dist/templates/minimal/package.json +1 -1
- package/dist/{core-D715tamU.mjs → utils-DjBRIDJG.mjs} +26494 -25089
- package/package.json +7 -7
- package/dist/index.d.mts +0 -2
- package/dist/index2.d.mts +0 -65
- package/dist/lib/core/index.mjs +0 -4
- package/dist/official-P5OKi7QM.mjs +0 -2586
- package/dist/testing.d.mts +0 -50
package/dist/lib/testing.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "../chunk-BjMGrMj9.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "../
|
|
2
|
+
import { n as addPnpmBuildDependencies, p as create } from "../package-manager-DkCPtZM1.mjs";
|
|
3
|
+
import { ct as K, lt as q } from "../utils-DjBRIDJG.mjs";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process$1 from "node:process";
|
|
7
|
+
import { execSync } from "node:child_process";
|
|
7
8
|
|
|
8
9
|
//#region ../../node_modules/.pnpm/degit@2.8.4/node_modules/degit/dist/index-688c5d50.js
|
|
9
10
|
var require_index_688c5d50 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -73,60 +74,60 @@ var require_index_688c5d50 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
73
74
|
["h", "follow"]
|
|
74
75
|
]);
|
|
75
76
|
var highLevelOpt = (opt) => opt ? Object.keys(opt).map((k) => [argmap.has(k) ? argmap.get(k) : k, opt[k]]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {};
|
|
76
|
-
var iterator = function(Yallist
|
|
77
|
-
Yallist
|
|
77
|
+
var iterator = function(Yallist) {
|
|
78
|
+
Yallist.prototype[Symbol.iterator] = function* () {
|
|
78
79
|
for (let walker = this.head; walker; walker = walker.next) yield walker.value;
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
82
|
var yallist = Yallist;
|
|
82
83
|
Yallist.Node = Node;
|
|
83
84
|
Yallist.create = Yallist;
|
|
84
|
-
function Yallist(list
|
|
85
|
+
function Yallist(list) {
|
|
85
86
|
var self$1 = this;
|
|
86
87
|
if (!(self$1 instanceof Yallist)) self$1 = new Yallist();
|
|
87
88
|
self$1.tail = null;
|
|
88
89
|
self$1.head = null;
|
|
89
90
|
self$1.length = 0;
|
|
90
|
-
if (list
|
|
91
|
+
if (list && typeof list.forEach === "function") list.forEach(function(item) {
|
|
91
92
|
self$1.push(item);
|
|
92
93
|
});
|
|
93
94
|
else if (arguments.length > 0) for (var i = 0, l = arguments.length; i < l; i++) self$1.push(arguments[i]);
|
|
94
95
|
return self$1;
|
|
95
96
|
}
|
|
96
|
-
Yallist.prototype.removeNode = function(node
|
|
97
|
-
if (node
|
|
98
|
-
var next = node
|
|
99
|
-
var prev = node
|
|
97
|
+
Yallist.prototype.removeNode = function(node) {
|
|
98
|
+
if (node.list !== this) throw new Error("removing node which does not belong to this list");
|
|
99
|
+
var next = node.next;
|
|
100
|
+
var prev = node.prev;
|
|
100
101
|
if (next) next.prev = prev;
|
|
101
102
|
if (prev) prev.next = next;
|
|
102
|
-
if (node
|
|
103
|
-
if (node
|
|
104
|
-
node
|
|
105
|
-
node
|
|
106
|
-
node
|
|
107
|
-
node
|
|
103
|
+
if (node === this.head) this.head = next;
|
|
104
|
+
if (node === this.tail) this.tail = prev;
|
|
105
|
+
node.list.length--;
|
|
106
|
+
node.next = null;
|
|
107
|
+
node.prev = null;
|
|
108
|
+
node.list = null;
|
|
108
109
|
return next;
|
|
109
110
|
};
|
|
110
|
-
Yallist.prototype.unshiftNode = function(node
|
|
111
|
-
if (node
|
|
112
|
-
if (node
|
|
111
|
+
Yallist.prototype.unshiftNode = function(node) {
|
|
112
|
+
if (node === this.head) return;
|
|
113
|
+
if (node.list) node.list.removeNode(node);
|
|
113
114
|
var head = this.head;
|
|
114
|
-
node
|
|
115
|
-
node
|
|
116
|
-
if (head) head.prev = node
|
|
117
|
-
this.head = node
|
|
118
|
-
if (!this.tail) this.tail = node
|
|
115
|
+
node.list = this;
|
|
116
|
+
node.next = head;
|
|
117
|
+
if (head) head.prev = node;
|
|
118
|
+
this.head = node;
|
|
119
|
+
if (!this.tail) this.tail = node;
|
|
119
120
|
this.length++;
|
|
120
121
|
};
|
|
121
|
-
Yallist.prototype.pushNode = function(node
|
|
122
|
-
if (node
|
|
123
|
-
if (node
|
|
122
|
+
Yallist.prototype.pushNode = function(node) {
|
|
123
|
+
if (node === this.tail) return;
|
|
124
|
+
if (node.list) node.list.removeNode(node);
|
|
124
125
|
var tail = this.tail;
|
|
125
|
-
node
|
|
126
|
-
node
|
|
127
|
-
if (tail) tail.next = node
|
|
128
|
-
this.tail = node
|
|
129
|
-
if (!this.head) this.head = node
|
|
126
|
+
node.list = this;
|
|
127
|
+
node.prev = tail;
|
|
128
|
+
if (tail) tail.next = node;
|
|
129
|
+
this.tail = node;
|
|
130
|
+
if (!this.head) this.head = node;
|
|
130
131
|
this.length++;
|
|
131
132
|
};
|
|
132
133
|
Yallist.prototype.push = function() {
|
|
@@ -291,8 +292,8 @@ var require_index_688c5d50 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
291
292
|
this.tail = head;
|
|
292
293
|
return this;
|
|
293
294
|
};
|
|
294
|
-
function insert(self$1, node
|
|
295
|
-
var inserted = node
|
|
295
|
+
function insert(self$1, node, value) {
|
|
296
|
+
var inserted = node === self$1.head ? new Node(value, null, node, self$1) : new Node(value, node, node.next, self$1);
|
|
296
297
|
if (inserted.next === null) self$1.tail = inserted;
|
|
297
298
|
if (inserted.prev === null) self$1.head = inserted;
|
|
298
299
|
self$1.length++;
|
|
@@ -308,9 +309,9 @@ var require_index_688c5d50 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
308
309
|
if (!self$1.tail) self$1.tail = self$1.head;
|
|
309
310
|
self$1.length++;
|
|
310
311
|
}
|
|
311
|
-
function Node(value, prev, next, list
|
|
312
|
-
if (!(this instanceof Node)) return new Node(value, prev, next, list
|
|
313
|
-
this.list = list
|
|
312
|
+
function Node(value, prev, next, list) {
|
|
313
|
+
if (!(this instanceof Node)) return new Node(value, prev, next, list);
|
|
314
|
+
this.list = list;
|
|
314
315
|
this.value = value;
|
|
315
316
|
if (prev) {
|
|
316
317
|
prev.next = this;
|
|
@@ -591,9 +592,9 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
591
592
|
return this[OBJECTMODE] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this.collect().then((buf) => this[OBJECTMODE] ? Promise.reject(/* @__PURE__ */ new Error("cannot concat in objectMode")) : this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength));
|
|
592
593
|
}
|
|
593
594
|
promise() {
|
|
594
|
-
return new Promise((resolve$
|
|
595
|
+
return new Promise((resolve$1, reject) => {
|
|
595
596
|
this.on(DESTROYED, () => reject(/* @__PURE__ */ new Error("stream destroyed")));
|
|
596
|
-
this.on("end", () => resolve$
|
|
597
|
+
this.on("end", () => resolve$1());
|
|
597
598
|
this.on("error", (er) => reject(er));
|
|
598
599
|
});
|
|
599
600
|
}
|
|
@@ -605,7 +606,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
605
606
|
value: res
|
|
606
607
|
});
|
|
607
608
|
if (this[EOF$1]) return Promise.resolve({ done: true });
|
|
608
|
-
let resolve$
|
|
609
|
+
let resolve$1 = null;
|
|
609
610
|
let reject = null;
|
|
610
611
|
const onerr = (er) => {
|
|
611
612
|
this.removeListener("data", ondata);
|
|
@@ -616,7 +617,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
616
617
|
this.removeListener("error", onerr);
|
|
617
618
|
this.removeListener("end", onend);
|
|
618
619
|
this.pause();
|
|
619
|
-
resolve$
|
|
620
|
+
resolve$1({
|
|
620
621
|
value,
|
|
621
622
|
done: !!this[EOF$1]
|
|
622
623
|
});
|
|
@@ -624,12 +625,12 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
624
625
|
const onend = () => {
|
|
625
626
|
this.removeListener("error", onerr);
|
|
626
627
|
this.removeListener("data", ondata);
|
|
627
|
-
resolve$
|
|
628
|
+
resolve$1({ done: true });
|
|
628
629
|
};
|
|
629
630
|
const ondestroy = () => onerr(/* @__PURE__ */ new Error("stream destroyed"));
|
|
630
631
|
return new Promise((res$1, rej) => {
|
|
631
632
|
reject = rej;
|
|
632
|
-
resolve$
|
|
633
|
+
resolve$1 = res$1;
|
|
633
634
|
this.once(DESTROYED, ondestroy);
|
|
634
635
|
this.once("error", onerr);
|
|
635
636
|
this.once("end", onend);
|
|
@@ -662,8 +663,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
662
663
|
else this.emit(DESTROYED);
|
|
663
664
|
return this;
|
|
664
665
|
}
|
|
665
|
-
static isStream(s
|
|
666
|
-
return !!s
|
|
666
|
+
static isStream(s) {
|
|
667
|
+
return !!s && (s instanceof Minipass || s instanceof Stream__default["default"] || s instanceof Events__default["default"] && (typeof s.pipe === "function" || typeof s.write === "function" && typeof s.end === "function"));
|
|
667
668
|
}
|
|
668
669
|
};
|
|
669
670
|
const realZlibConstants = realZlib__default["default"].constants || (
|
|
@@ -804,13 +805,13 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
804
805
|
const _sawError = Symbol("sawError");
|
|
805
806
|
const _level = Symbol("level");
|
|
806
807
|
const _strategy = Symbol("strategy");
|
|
807
|
-
const _ended
|
|
808
|
+
const _ended = Symbol("ended");
|
|
808
809
|
class ZlibBase extends minipass {
|
|
809
810
|
constructor(opts, mode) {
|
|
810
811
|
if (!opts || typeof opts !== "object") throw new TypeError("invalid options for ZlibBase constructor");
|
|
811
812
|
super(opts);
|
|
812
813
|
this[_sawError] = false;
|
|
813
|
-
this[_ended
|
|
814
|
+
this[_ended] = false;
|
|
814
815
|
this[_opts] = opts;
|
|
815
816
|
this[_flushFlag] = opts.flush;
|
|
816
817
|
this[_finishFlushFlag] = opts.finishFlush;
|
|
@@ -849,11 +850,11 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
849
850
|
end(chunk, encoding, cb) {
|
|
850
851
|
if (chunk) this.write(chunk, encoding);
|
|
851
852
|
this.flush(this[_finishFlushFlag]);
|
|
852
|
-
this[_ended
|
|
853
|
+
this[_ended] = true;
|
|
853
854
|
return super.end(null, null, cb);
|
|
854
855
|
}
|
|
855
856
|
get ended() {
|
|
856
|
-
return this[_ended
|
|
857
|
+
return this[_ended];
|
|
857
858
|
}
|
|
858
859
|
write(chunk, encoding, cb) {
|
|
859
860
|
if (typeof encoding === "function") cb = encoding, encoding = "utf8";
|
|
@@ -1012,16 +1013,16 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1012
1013
|
});
|
|
1013
1014
|
const SLURP$1 = Symbol("slurp");
|
|
1014
1015
|
var readEntry = class ReadEntry extends minipass {
|
|
1015
|
-
constructor(header
|
|
1016
|
+
constructor(header, ex, gex) {
|
|
1016
1017
|
super();
|
|
1017
1018
|
this.pause();
|
|
1018
1019
|
this.extended = ex;
|
|
1019
1020
|
this.globalExtended = gex;
|
|
1020
|
-
this.header = header
|
|
1021
|
-
this.startBlockSize = 512 * Math.ceil(header
|
|
1021
|
+
this.header = header;
|
|
1022
|
+
this.startBlockSize = 512 * Math.ceil(header.size / 512);
|
|
1022
1023
|
this.blockRemain = this.startBlockSize;
|
|
1023
|
-
this.remain = header
|
|
1024
|
-
this.type = header
|
|
1024
|
+
this.remain = header.size;
|
|
1025
|
+
this.type = header.type;
|
|
1025
1026
|
this.meta = false;
|
|
1026
1027
|
this.ignore = false;
|
|
1027
1028
|
switch (this.type) {
|
|
@@ -1045,20 +1046,20 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1045
1046
|
break;
|
|
1046
1047
|
default: this.ignore = true;
|
|
1047
1048
|
}
|
|
1048
|
-
this.path = header
|
|
1049
|
-
this.mode = header
|
|
1049
|
+
this.path = header.path;
|
|
1050
|
+
this.mode = header.mode;
|
|
1050
1051
|
if (this.mode) this.mode = this.mode & 4095;
|
|
1051
|
-
this.uid = header
|
|
1052
|
-
this.gid = header
|
|
1053
|
-
this.uname = header
|
|
1054
|
-
this.gname = header
|
|
1055
|
-
this.size = header
|
|
1056
|
-
this.mtime = header
|
|
1057
|
-
this.atime = header
|
|
1058
|
-
this.ctime = header
|
|
1059
|
-
this.linkpath = header
|
|
1060
|
-
this.uname = header
|
|
1061
|
-
this.gname = header
|
|
1052
|
+
this.uid = header.uid;
|
|
1053
|
+
this.gid = header.gid;
|
|
1054
|
+
this.uname = header.uname;
|
|
1055
|
+
this.gname = header.gname;
|
|
1056
|
+
this.size = header.size;
|
|
1057
|
+
this.mtime = header.mtime;
|
|
1058
|
+
this.atime = header.atime;
|
|
1059
|
+
this.ctime = header.ctime;
|
|
1060
|
+
this.linkpath = header.linkpath;
|
|
1061
|
+
this.uname = header.uname;
|
|
1062
|
+
this.gname = header.gname;
|
|
1062
1063
|
if (ex) this[SLURP$1](ex);
|
|
1063
1064
|
if (gex) this[SLURP$1](gex, true);
|
|
1064
1065
|
}
|
|
@@ -1244,11 +1245,11 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1244
1245
|
if (!off) off = 0;
|
|
1245
1246
|
if (!(buf.length >= off + 512)) throw new Error("need 512 bytes for header");
|
|
1246
1247
|
const prefixSize = this.ctime || this.atime ? 130 : 155;
|
|
1247
|
-
const split$
|
|
1248
|
-
const path$
|
|
1249
|
-
const prefix = split$
|
|
1250
|
-
this.needPax = split$
|
|
1251
|
-
this.needPax = encString(buf, off, 100, path$
|
|
1248
|
+
const split$1 = splitPrefix(this.path || "", prefixSize);
|
|
1249
|
+
const path$2 = split$1[0];
|
|
1250
|
+
const prefix = split$1[1];
|
|
1251
|
+
this.needPax = split$1[2];
|
|
1252
|
+
this.needPax = encString(buf, off, 100, path$2) || this.needPax;
|
|
1252
1253
|
this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
|
|
1253
1254
|
this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
|
|
1254
1255
|
this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
|
|
@@ -1398,15 +1399,15 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1398
1399
|
encodeField(field) {
|
|
1399
1400
|
if (this[field] === null || this[field] === void 0) return "";
|
|
1400
1401
|
const v = this[field] instanceof Date ? this[field].getTime() / 1e3 : this[field];
|
|
1401
|
-
const s
|
|
1402
|
-
const byteLen = Buffer.byteLength(s
|
|
1402
|
+
const s = " " + (field === "dev" || field === "ino" || field === "nlink" ? "SCHILY." : "") + field + "=" + v + "\n";
|
|
1403
|
+
const byteLen = Buffer.byteLength(s);
|
|
1403
1404
|
let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1;
|
|
1404
1405
|
if (byteLen + digits >= Math.pow(10, digits)) digits += 1;
|
|
1405
|
-
return digits + byteLen + s
|
|
1406
|
+
return digits + byteLen + s;
|
|
1406
1407
|
}
|
|
1407
1408
|
};
|
|
1408
1409
|
Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g);
|
|
1409
|
-
const merge = (a, b) => b ? Object.keys(a).reduce((s
|
|
1410
|
+
const merge = (a, b) => b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a;
|
|
1410
1411
|
const parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, Object.create(null));
|
|
1411
1412
|
const parseKVLine = (set, line) => {
|
|
1412
1413
|
const n = parseInt(line, 10);
|
|
@@ -1447,8 +1448,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1447
1448
|
const toWin = new Map(raw.map((char, i) => [char, win[i]]));
|
|
1448
1449
|
const toRaw = new Map(win.map((char, i) => [char, raw[i]]));
|
|
1449
1450
|
var winchars = {
|
|
1450
|
-
encode: (s
|
|
1451
|
-
decode: (s
|
|
1451
|
+
encode: (s) => raw.reduce((s$1, c) => s$1.split(c).join(toWin.get(c)), s),
|
|
1452
|
+
decode: (s) => win.reduce((s$1, c) => s$1.split(c).join(toRaw.get(c)), s)
|
|
1452
1453
|
};
|
|
1453
1454
|
var modeFix = (mode, isDir, portable) => {
|
|
1454
1455
|
mode &= 4095;
|
|
@@ -1476,7 +1477,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1476
1477
|
const ONOPENFILE = Symbol("onopenfile");
|
|
1477
1478
|
const CLOSE = Symbol("close");
|
|
1478
1479
|
const MODE = Symbol("mode");
|
|
1479
|
-
const WriteEntry = warnMixin(class WriteEntry
|
|
1480
|
+
const WriteEntry = warnMixin(class WriteEntry extends minipass {
|
|
1480
1481
|
constructor(p, opt) {
|
|
1481
1482
|
opt = opt || {};
|
|
1482
1483
|
super(opt);
|
|
@@ -1620,16 +1621,16 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1620
1621
|
const buf = Buffer.allocUnsafe(bufLen);
|
|
1621
1622
|
this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen);
|
|
1622
1623
|
}
|
|
1623
|
-
[READ](fd, buf, offset, length, pos
|
|
1624
|
-
fs__default["default"].read(fd, buf, offset, length, pos
|
|
1624
|
+
[READ](fd, buf, offset, length, pos, remain, blockRemain) {
|
|
1625
|
+
fs__default["default"].read(fd, buf, offset, length, pos, (er, bytesRead) => {
|
|
1625
1626
|
if (er) return this[CLOSE](fd, () => this.emit("error", er));
|
|
1626
|
-
this[ONREAD](fd, buf, offset, length, pos
|
|
1627
|
+
this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead);
|
|
1627
1628
|
});
|
|
1628
1629
|
}
|
|
1629
1630
|
[CLOSE](fd, cb) {
|
|
1630
1631
|
fs__default["default"].close(fd, cb);
|
|
1631
1632
|
}
|
|
1632
|
-
[ONREAD](fd, buf, offset, length, pos
|
|
1633
|
+
[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) {
|
|
1633
1634
|
if (bytesRead <= 0 && remain > 0) {
|
|
1634
1635
|
const er = /* @__PURE__ */ new Error("encountered unexpected EOF");
|
|
1635
1636
|
er.path = this.absolute;
|
|
@@ -1652,7 +1653,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1652
1653
|
const writeBuf = offset === 0 && bytesRead === buf.length ? buf : buf.slice(offset, offset + bytesRead);
|
|
1653
1654
|
remain -= bytesRead;
|
|
1654
1655
|
blockRemain -= bytesRead;
|
|
1655
|
-
pos
|
|
1656
|
+
pos += bytesRead;
|
|
1656
1657
|
offset += bytesRead;
|
|
1657
1658
|
this.write(writeBuf);
|
|
1658
1659
|
if (!remain) {
|
|
@@ -1664,7 +1665,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1664
1665
|
offset = 0;
|
|
1665
1666
|
}
|
|
1666
1667
|
length = buf.length - offset;
|
|
1667
|
-
this[READ](fd, buf, offset, length, pos
|
|
1668
|
+
this[READ](fd, buf, offset, length, pos, remain, blockRemain);
|
|
1668
1669
|
}
|
|
1669
1670
|
});
|
|
1670
1671
|
var WriteEntrySync$1 = class extends WriteEntry {
|
|
@@ -1677,11 +1678,11 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1677
1678
|
[OPENFILE]() {
|
|
1678
1679
|
this[ONOPENFILE](fs__default["default"].openSync(this.absolute, "r"));
|
|
1679
1680
|
}
|
|
1680
|
-
[READ](fd, buf, offset, length, pos
|
|
1681
|
+
[READ](fd, buf, offset, length, pos, remain, blockRemain) {
|
|
1681
1682
|
let threw = true;
|
|
1682
1683
|
try {
|
|
1683
|
-
const bytesRead = fs__default["default"].readSync(fd, buf, offset, length, pos
|
|
1684
|
-
this[ONREAD](fd, buf, offset, length, pos
|
|
1684
|
+
const bytesRead = fs__default["default"].readSync(fd, buf, offset, length, pos);
|
|
1685
|
+
this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead);
|
|
1685
1686
|
threw = false;
|
|
1686
1687
|
} finally {
|
|
1687
1688
|
if (threw) try {
|
|
@@ -1694,8 +1695,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1694
1695
|
cb();
|
|
1695
1696
|
}
|
|
1696
1697
|
};
|
|
1697
|
-
const WriteEntryTar$1 = warnMixin(class WriteEntryTar
|
|
1698
|
-
constructor(readEntry
|
|
1698
|
+
const WriteEntryTar$1 = warnMixin(class WriteEntryTar extends minipass {
|
|
1699
|
+
constructor(readEntry, opt) {
|
|
1699
1700
|
opt = opt || {};
|
|
1700
1701
|
super(opt);
|
|
1701
1702
|
this.preservePaths = !!opt.preservePaths;
|
|
@@ -1703,20 +1704,20 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1703
1704
|
this.strict = !!opt.strict;
|
|
1704
1705
|
this.noPax = !!opt.noPax;
|
|
1705
1706
|
this.noMtime = !!opt.noMtime;
|
|
1706
|
-
this.readEntry = readEntry
|
|
1707
|
-
this.type = readEntry
|
|
1707
|
+
this.readEntry = readEntry;
|
|
1708
|
+
this.type = readEntry.type;
|
|
1708
1709
|
if (this.type === "Directory" && this.portable) this.noMtime = true;
|
|
1709
|
-
this.path = readEntry
|
|
1710
|
-
this.mode = this[MODE](readEntry
|
|
1711
|
-
this.uid = this.portable ? null : readEntry
|
|
1712
|
-
this.gid = this.portable ? null : readEntry
|
|
1713
|
-
this.uname = this.portable ? null : readEntry
|
|
1714
|
-
this.gname = this.portable ? null : readEntry
|
|
1715
|
-
this.size = readEntry
|
|
1716
|
-
this.mtime = this.noMtime ? null : opt.mtime || readEntry
|
|
1717
|
-
this.atime = this.portable ? null : readEntry
|
|
1718
|
-
this.ctime = this.portable ? null : readEntry
|
|
1719
|
-
this.linkpath = readEntry
|
|
1710
|
+
this.path = readEntry.path;
|
|
1711
|
+
this.mode = this[MODE](readEntry.mode);
|
|
1712
|
+
this.uid = this.portable ? null : readEntry.uid;
|
|
1713
|
+
this.gid = this.portable ? null : readEntry.gid;
|
|
1714
|
+
this.uname = this.portable ? null : readEntry.uname;
|
|
1715
|
+
this.gname = this.portable ? null : readEntry.gname;
|
|
1716
|
+
this.size = readEntry.size;
|
|
1717
|
+
this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime;
|
|
1718
|
+
this.atime = this.portable ? null : readEntry.atime;
|
|
1719
|
+
this.ctime = this.portable ? null : readEntry.ctime;
|
|
1720
|
+
this.linkpath = readEntry.linkpath;
|
|
1720
1721
|
if (typeof opt.onwarn === "function") this.on("warn", opt.onwarn);
|
|
1721
1722
|
let pathWarn = false;
|
|
1722
1723
|
if (path__default["default"].isAbsolute(this.path) && !this.preservePaths) {
|
|
@@ -1724,8 +1725,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1724
1725
|
pathWarn = parsed.root;
|
|
1725
1726
|
this.path = this.path.substr(parsed.root.length);
|
|
1726
1727
|
}
|
|
1727
|
-
this.remain = readEntry
|
|
1728
|
-
this.blockRemain = readEntry
|
|
1728
|
+
this.remain = readEntry.size;
|
|
1729
|
+
this.blockRemain = readEntry.startBlockSize;
|
|
1729
1730
|
this.header = new header({
|
|
1730
1731
|
path: this.path,
|
|
1731
1732
|
linkpath: this.linkpath,
|
|
@@ -1758,7 +1759,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1758
1759
|
nlink: this.portable ? null : this.readEntry.nlink
|
|
1759
1760
|
}).encode());
|
|
1760
1761
|
super.write(this.header.block);
|
|
1761
|
-
readEntry
|
|
1762
|
+
readEntry.pipe(this);
|
|
1762
1763
|
}
|
|
1763
1764
|
[MODE](mode) {
|
|
1764
1765
|
return modeFix(mode, this.type === "Directory", this.portable);
|
|
@@ -1779,8 +1780,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1779
1780
|
const getType = (stat) => stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
|
|
1780
1781
|
var writeEntry = WriteEntry;
|
|
1781
1782
|
var PackJob = class {
|
|
1782
|
-
constructor(path$
|
|
1783
|
-
this.path = path$
|
|
1783
|
+
constructor(path$2, absolute) {
|
|
1784
|
+
this.path = path$2 || "./";
|
|
1784
1785
|
this.absolute = absolute;
|
|
1785
1786
|
this.entry = null;
|
|
1786
1787
|
this.stat = null;
|
|
@@ -1813,7 +1814,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1813
1814
|
const WRITEENTRYCLASS = Symbol("writeEntryClass");
|
|
1814
1815
|
const WRITE = Symbol("write");
|
|
1815
1816
|
const ONDRAIN = Symbol("ondrain");
|
|
1816
|
-
const Pack = warnMixin(class Pack
|
|
1817
|
+
const Pack = warnMixin(class Pack extends minipass {
|
|
1817
1818
|
constructor(opt) {
|
|
1818
1819
|
super(opt);
|
|
1819
1820
|
opt = opt || Object.create(null);
|
|
@@ -1855,20 +1856,20 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1855
1856
|
[WRITE](chunk) {
|
|
1856
1857
|
return super.write(chunk);
|
|
1857
1858
|
}
|
|
1858
|
-
add(path$
|
|
1859
|
-
this.write(path$
|
|
1859
|
+
add(path$2) {
|
|
1860
|
+
this.write(path$2);
|
|
1860
1861
|
return this;
|
|
1861
1862
|
}
|
|
1862
|
-
end(path$
|
|
1863
|
-
if (path$
|
|
1863
|
+
end(path$2) {
|
|
1864
|
+
if (path$2) this.write(path$2);
|
|
1864
1865
|
this[ENDED$2] = true;
|
|
1865
1866
|
this[PROCESS]();
|
|
1866
1867
|
return this;
|
|
1867
1868
|
}
|
|
1868
|
-
write(path$
|
|
1869
|
+
write(path$2) {
|
|
1869
1870
|
if (this[ENDED$2]) throw new Error("write after end");
|
|
1870
|
-
if (path$
|
|
1871
|
-
else this[ADDFSENTRY](path$
|
|
1871
|
+
if (path$2 instanceof readEntry) this[ADDTARENTRY](path$2);
|
|
1872
|
+
else this[ADDFSENTRY](path$2);
|
|
1872
1873
|
return this.flowing;
|
|
1873
1874
|
}
|
|
1874
1875
|
[ADDTARENTRY](p) {
|
|
@@ -1925,12 +1926,12 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
1925
1926
|
[PROCESS]() {
|
|
1926
1927
|
if (this[PROCESSING]) return;
|
|
1927
1928
|
this[PROCESSING] = true;
|
|
1928
|
-
for (let w
|
|
1929
|
-
this[PROCESSJOB](w
|
|
1930
|
-
if (w
|
|
1931
|
-
const p = w
|
|
1932
|
-
this[QUEUE$1].removeNode(w
|
|
1933
|
-
w
|
|
1929
|
+
for (let w = this[QUEUE$1].head; w !== null && this[JOBS] < this.jobs; w = w.next) {
|
|
1930
|
+
this[PROCESSJOB](w.value);
|
|
1931
|
+
if (w.value.ignore) {
|
|
1932
|
+
const p = w.next;
|
|
1933
|
+
this[QUEUE$1].removeNode(w);
|
|
1934
|
+
w.next = p;
|
|
1934
1935
|
}
|
|
1935
1936
|
}
|
|
1936
1937
|
this[PROCESSING] = false;
|
|
@@ -2001,16 +2002,16 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
2001
2002
|
job.piped = true;
|
|
2002
2003
|
if (job.readdir) job.readdir.forEach((entry) => {
|
|
2003
2004
|
const p = this.prefix ? job.path.slice(this.prefix.length + 1) || "./" : job.path;
|
|
2004
|
-
const base
|
|
2005
|
-
this[ADDFSENTRY](base
|
|
2005
|
+
const base = p === "./" ? "" : p.replace(/\/*$/, "/");
|
|
2006
|
+
this[ADDFSENTRY](base + entry);
|
|
2006
2007
|
});
|
|
2007
|
-
const source
|
|
2008
|
+
const source = job.entry;
|
|
2008
2009
|
const zip = this.zip;
|
|
2009
|
-
if (zip) source
|
|
2010
|
-
if (!zip.write(chunk)) source
|
|
2010
|
+
if (zip) source.on("data", (chunk) => {
|
|
2011
|
+
if (!zip.write(chunk)) source.pause();
|
|
2011
2012
|
});
|
|
2012
|
-
else source
|
|
2013
|
-
if (!super.write(chunk)) source
|
|
2013
|
+
else source.on("data", (chunk) => {
|
|
2014
|
+
if (!super.write(chunk)) source.pause();
|
|
2014
2015
|
});
|
|
2015
2016
|
}
|
|
2016
2017
|
pause() {
|
|
@@ -2033,17 +2034,17 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
2033
2034
|
this[ONREADDIR](job, fs__default["default"].readdirSync(job.absolute));
|
|
2034
2035
|
}
|
|
2035
2036
|
[PIPE](job) {
|
|
2036
|
-
const source
|
|
2037
|
+
const source = job.entry;
|
|
2037
2038
|
const zip = this.zip;
|
|
2038
2039
|
if (job.readdir) job.readdir.forEach((entry) => {
|
|
2039
2040
|
const p = this.prefix ? job.path.slice(this.prefix.length + 1) || "./" : job.path;
|
|
2040
|
-
const base
|
|
2041
|
-
this[ADDFSENTRY](base
|
|
2041
|
+
const base = p === "./" ? "" : p.replace(/\/*$/, "/");
|
|
2042
|
+
this[ADDFSENTRY](base + entry);
|
|
2042
2043
|
});
|
|
2043
|
-
if (zip) source
|
|
2044
|
+
if (zip) source.on("data", (chunk) => {
|
|
2044
2045
|
zip.write(chunk);
|
|
2045
2046
|
});
|
|
2046
|
-
else source
|
|
2047
|
+
else source.on("data", (chunk) => {
|
|
2047
2048
|
super[WRITE](chunk);
|
|
2048
2049
|
});
|
|
2049
2050
|
}
|
|
@@ -2056,11 +2057,11 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
2056
2057
|
if (!writev) {
|
|
2057
2058
|
const binding = process.binding("fs");
|
|
2058
2059
|
const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback;
|
|
2059
|
-
writev = (fd, iovec, pos
|
|
2060
|
+
writev = (fd, iovec, pos, cb) => {
|
|
2060
2061
|
const done = (er, bw) => cb(er, bw, iovec);
|
|
2061
2062
|
const req = new FSReqWrap();
|
|
2062
2063
|
req.oncomplete = done;
|
|
2063
|
-
binding.writeBuffers(fd, iovec, pos
|
|
2064
|
+
binding.writeBuffers(fd, iovec, pos, req);
|
|
2064
2065
|
};
|
|
2065
2066
|
}
|
|
2066
2067
|
const _autoClose = Symbol("_autoClose");
|
|
@@ -2092,15 +2093,15 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
2092
2093
|
const _defaultFlag = Symbol("_defaultFlag");
|
|
2093
2094
|
const _errored = Symbol("_errored");
|
|
2094
2095
|
var ReadStream = class extends minipass {
|
|
2095
|
-
constructor(path$
|
|
2096
|
+
constructor(path$2, opt) {
|
|
2096
2097
|
opt = opt || {};
|
|
2097
2098
|
super(opt);
|
|
2098
2099
|
this.readable = true;
|
|
2099
2100
|
this.writable = false;
|
|
2100
|
-
if (typeof path$
|
|
2101
|
+
if (typeof path$2 !== "string") throw new TypeError("path must be a string");
|
|
2101
2102
|
this[_errored] = false;
|
|
2102
2103
|
this[_fd] = typeof opt.fd === "number" ? opt.fd : null;
|
|
2103
|
-
this[_path] = path$
|
|
2104
|
+
this[_path] = path$2;
|
|
2104
2105
|
this[_readSize] = opt.readSize || 16 * 1024 * 1024;
|
|
2105
2106
|
this[_reading] = false;
|
|
2106
2107
|
this[_size] = typeof opt.size === "number" ? opt.size : Infinity;
|
|
@@ -2225,7 +2226,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
2225
2226
|
}
|
|
2226
2227
|
};
|
|
2227
2228
|
var WriteStream = class extends EE$1 {
|
|
2228
|
-
constructor(path$
|
|
2229
|
+
constructor(path$2, opt) {
|
|
2229
2230
|
opt = opt || {};
|
|
2230
2231
|
super(opt);
|
|
2231
2232
|
this.readable = false;
|
|
@@ -2235,7 +2236,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()));
|
|
|
2235
2236
|
this[_ended] = false;
|
|
2236
2237
|
this[_needDrain] = false;
|
|
2237
2238
|
this[_queue] = [];
|
|
2238
|
-
this[_path] = path$
|
|
2239
|
+
this[_path] = path$2;
|
|
2239
2240
|
this[_fd] = typeof opt.fd === "number" ? opt.fd : null;
|
|
2240
2241
|
this[_mode] = opt.mode === void 0 ? 438 : opt.mode;
|
|
2241
2242
|
this[_pos] = typeof opt.start === "number" ? opt.start : null;
|
|
@@ -2714,14 +2715,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2714
2715
|
};
|
|
2715
2716
|
const filesFilter$1 = (opt, files) => {
|
|
2716
2717
|
const map$1 = new Map(files.map((f) => [f.replace(/\/+$/, ""), true]));
|
|
2717
|
-
const filter
|
|
2718
|
+
const filter = opt.filter;
|
|
2718
2719
|
const mapHas = (file, r) => {
|
|
2719
2720
|
const root = r || path__default["default"].parse(file).root || ".";
|
|
2720
2721
|
const ret = file === root ? false : map$1.has(file) ? map$1.get(file) : mapHas(path__default["default"].dirname(file), root);
|
|
2721
2722
|
map$1.set(file, ret);
|
|
2722
2723
|
return ret;
|
|
2723
2724
|
};
|
|
2724
|
-
opt.filter = filter
|
|
2725
|
+
opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, "")) : (file) => mapHas(file.replace(/\/+$/, ""));
|
|
2725
2726
|
};
|
|
2726
2727
|
const listFileSync = (opt) => {
|
|
2727
2728
|
const p = list(opt);
|
|
@@ -2733,12 +2734,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2733
2734
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
2734
2735
|
if (stat.size < readSize) p.end(fs__default["default"].readFileSync(file));
|
|
2735
2736
|
else {
|
|
2736
|
-
let pos
|
|
2737
|
+
let pos = 0;
|
|
2737
2738
|
const buf = Buffer.allocUnsafe(readSize);
|
|
2738
2739
|
fd = fs__default["default"].openSync(file, "r");
|
|
2739
|
-
while (pos
|
|
2740
|
-
const bytesRead = fs__default["default"].readSync(fd, buf, 0, readSize, pos
|
|
2741
|
-
pos
|
|
2740
|
+
while (pos < stat.size) {
|
|
2741
|
+
const bytesRead = fs__default["default"].readSync(fd, buf, 0, readSize, pos);
|
|
2742
|
+
pos += bytesRead;
|
|
2742
2743
|
p.write(buf.slice(0, bytesRead));
|
|
2743
2744
|
}
|
|
2744
2745
|
p.end();
|
|
@@ -2751,12 +2752,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2751
2752
|
}
|
|
2752
2753
|
};
|
|
2753
2754
|
const listFile = (opt, cb) => {
|
|
2754
|
-
const parse
|
|
2755
|
+
const parse = new parse$4(opt);
|
|
2755
2756
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
2756
2757
|
const file = opt.file;
|
|
2757
|
-
const p = new Promise((resolve$
|
|
2758
|
-
parse
|
|
2759
|
-
parse
|
|
2758
|
+
const p = new Promise((resolve$1, reject) => {
|
|
2759
|
+
parse.on("error", reject);
|
|
2760
|
+
parse.on("end", resolve$1);
|
|
2760
2761
|
fs__default["default"].stat(file, (er, stat) => {
|
|
2761
2762
|
if (er) reject(er);
|
|
2762
2763
|
else {
|
|
@@ -2765,7 +2766,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2765
2766
|
size: stat.size
|
|
2766
2767
|
});
|
|
2767
2768
|
stream.on("error", reject);
|
|
2768
|
-
stream.pipe(parse
|
|
2769
|
+
stream.pipe(parse);
|
|
2769
2770
|
}
|
|
2770
2771
|
});
|
|
2771
2772
|
});
|
|
@@ -2780,7 +2781,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2780
2781
|
const opt = highLevelOpt(opt_);
|
|
2781
2782
|
if (opt.sync && typeof cb === "function") throw new TypeError("callback not supported for sync tar functions");
|
|
2782
2783
|
if (!opt.file && typeof cb === "function") throw new TypeError("callback only supported with file option");
|
|
2783
|
-
return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create
|
|
2784
|
+
return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create(opt, files);
|
|
2784
2785
|
};
|
|
2785
2786
|
const createFileSync = (opt, files) => {
|
|
2786
2787
|
const p = new pack.Sync(opt);
|
|
@@ -2829,7 +2830,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2829
2830
|
addFilesSync$1(p, files);
|
|
2830
2831
|
return p;
|
|
2831
2832
|
};
|
|
2832
|
-
const create
|
|
2833
|
+
const create = (opt, files) => {
|
|
2833
2834
|
const p = new pack(opt);
|
|
2834
2835
|
addFilesAsync$1(p, files);
|
|
2835
2836
|
return p;
|
|
@@ -2862,12 +2863,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2862
2863
|
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139) throw new Error("cannot append to compressed archives");
|
|
2863
2864
|
if (!bytes) break POSITION;
|
|
2864
2865
|
}
|
|
2865
|
-
const h
|
|
2866
|
-
if (!h
|
|
2867
|
-
const entryBlockSize = 512 * Math.ceil(h
|
|
2866
|
+
const h = new header(headBuf);
|
|
2867
|
+
if (!h.cksumValid) break;
|
|
2868
|
+
const entryBlockSize = 512 * Math.ceil(h.size / 512);
|
|
2868
2869
|
if (position + entryBlockSize + 512 > st.size) break;
|
|
2869
2870
|
position += entryBlockSize;
|
|
2870
|
-
if (opt.mtimeCache) opt.mtimeCache.set(h
|
|
2871
|
+
if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime);
|
|
2871
2872
|
}
|
|
2872
2873
|
threw = false;
|
|
2873
2874
|
streamSync(opt, p, position, fd, files);
|
|
@@ -2889,9 +2890,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2889
2890
|
files = Array.from(files);
|
|
2890
2891
|
const p = new pack(opt);
|
|
2891
2892
|
const getPos = (fd, size, cb_) => {
|
|
2892
|
-
const cb$1 = (er, pos
|
|
2893
|
+
const cb$1 = (er, pos) => {
|
|
2893
2894
|
if (er) fs__default["default"].close(fd, (_) => cb_(er));
|
|
2894
|
-
else cb_(null, pos
|
|
2895
|
+
else cb_(null, pos);
|
|
2895
2896
|
};
|
|
2896
2897
|
let position = 0;
|
|
2897
2898
|
if (size === 0) return cb$1(null, 0);
|
|
@@ -2903,19 +2904,19 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2903
2904
|
if (bufPos < 512 && bytes) return fs__default["default"].read(fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread);
|
|
2904
2905
|
if (position === 0 && headBuf[0] === 31 && headBuf[1] === 139) return cb$1(/* @__PURE__ */ new Error("cannot append to compressed archives"));
|
|
2905
2906
|
if (bufPos < 512) return cb$1(null, position);
|
|
2906
|
-
const h
|
|
2907
|
-
if (!h
|
|
2908
|
-
const entryBlockSize = 512 * Math.ceil(h
|
|
2907
|
+
const h = new header(headBuf);
|
|
2908
|
+
if (!h.cksumValid) return cb$1(null, position);
|
|
2909
|
+
const entryBlockSize = 512 * Math.ceil(h.size / 512);
|
|
2909
2910
|
if (position + entryBlockSize + 512 > size) return cb$1(null, position);
|
|
2910
2911
|
position += entryBlockSize + 512;
|
|
2911
2912
|
if (position >= size) return cb$1(null, position);
|
|
2912
|
-
if (opt.mtimeCache) opt.mtimeCache.set(h
|
|
2913
|
+
if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime);
|
|
2913
2914
|
bufPos = 0;
|
|
2914
2915
|
fs__default["default"].read(fd, headBuf, 0, 512, position, onread);
|
|
2915
2916
|
};
|
|
2916
2917
|
fs__default["default"].read(fd, headBuf, 0, 512, position, onread);
|
|
2917
2918
|
};
|
|
2918
|
-
const promise = new Promise((resolve$
|
|
2919
|
+
const promise = new Promise((resolve$1, reject) => {
|
|
2919
2920
|
p.on("error", reject);
|
|
2920
2921
|
let flag = "r+";
|
|
2921
2922
|
const onopen = (er, fd) => {
|
|
@@ -2934,7 +2935,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2934
2935
|
});
|
|
2935
2936
|
p.pipe(stream);
|
|
2936
2937
|
stream.on("error", reject);
|
|
2937
|
-
stream.on("close", resolve$
|
|
2938
|
+
stream.on("close", resolve$1);
|
|
2938
2939
|
addFilesAsync(p, files);
|
|
2939
2940
|
});
|
|
2940
2941
|
});
|
|
@@ -2977,9 +2978,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
2977
2978
|
return replace_1(opt, files, cb);
|
|
2978
2979
|
};
|
|
2979
2980
|
const mtimeFilter = (opt) => {
|
|
2980
|
-
const filter
|
|
2981
|
+
const filter = opt.filter;
|
|
2981
2982
|
if (!opt.mtimeCache) opt.mtimeCache = /* @__PURE__ */ new Map();
|
|
2982
|
-
opt.filter = filter
|
|
2983
|
+
opt.filter = filter ? (path$2, stat) => filter(path$2, stat) && !(opt.mtimeCache.get(path$2) > stat.mtime) : (path$2, stat) => !(opt.mtimeCache.get(path$2) > stat.mtime);
|
|
2983
2984
|
};
|
|
2984
2985
|
const { promisify: promisify$1 } = util__default["default"];
|
|
2985
2986
|
const optsArg = (opts) => {
|
|
@@ -3011,33 +3012,33 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3011
3012
|
};
|
|
3012
3013
|
var optsArg_1 = optsArg;
|
|
3013
3014
|
const platform$2 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
|
|
3014
|
-
const { resolve
|
|
3015
|
-
const pathArg = (path$
|
|
3016
|
-
if (/\0/.test(path$
|
|
3017
|
-
path: path$
|
|
3015
|
+
const { resolve, parse: parse$3 } = path__default["default"];
|
|
3016
|
+
const pathArg = (path$2) => {
|
|
3017
|
+
if (/\0/.test(path$2)) throw Object.assign(/* @__PURE__ */ new TypeError("path must be a string without null bytes"), {
|
|
3018
|
+
path: path$2,
|
|
3018
3019
|
code: "ERR_INVALID_ARG_VALUE"
|
|
3019
3020
|
});
|
|
3020
|
-
path$
|
|
3021
|
+
path$2 = resolve(path$2);
|
|
3021
3022
|
if (platform$2 === "win32") {
|
|
3022
3023
|
const badWinChars = /[*|"<>?:]/;
|
|
3023
|
-
const { root } = parse$3(path$
|
|
3024
|
-
if (badWinChars.test(path$
|
|
3025
|
-
path: path$
|
|
3024
|
+
const { root } = parse$3(path$2);
|
|
3025
|
+
if (badWinChars.test(path$2.substr(root.length))) throw Object.assign(/* @__PURE__ */ new Error("Illegal characters in path."), {
|
|
3026
|
+
path: path$2,
|
|
3026
3027
|
code: "EINVAL"
|
|
3027
3028
|
});
|
|
3028
3029
|
}
|
|
3029
|
-
return path$
|
|
3030
|
+
return path$2;
|
|
3030
3031
|
};
|
|
3031
3032
|
var pathArg_1 = pathArg;
|
|
3032
3033
|
const { dirname: dirname$2 } = path__default["default"];
|
|
3033
|
-
const findMade$1 = (opts, parent, path$
|
|
3034
|
-
if (path$
|
|
3035
|
-
return opts.statAsync(parent).then((st) => st.isDirectory() ? path$
|
|
3034
|
+
const findMade$1 = (opts, parent, path$2 = void 0) => {
|
|
3035
|
+
if (path$2 === parent) return Promise.resolve();
|
|
3036
|
+
return opts.statAsync(parent).then((st) => st.isDirectory() ? path$2 : void 0, (er) => er.code === "ENOENT" ? findMade$1(opts, dirname$2(parent), parent) : void 0);
|
|
3036
3037
|
};
|
|
3037
|
-
const findMadeSync$1 = (opts, parent, path$
|
|
3038
|
-
if (path$
|
|
3038
|
+
const findMadeSync$1 = (opts, parent, path$2 = void 0) => {
|
|
3039
|
+
if (path$2 === parent) return void 0;
|
|
3039
3040
|
try {
|
|
3040
|
-
return opts.statSync(parent).isDirectory() ? path$
|
|
3041
|
+
return opts.statSync(parent).isDirectory() ? path$2 : void 0;
|
|
3041
3042
|
} catch (er) {
|
|
3042
3043
|
return er.code === "ENOENT" ? findMadeSync$1(opts, dirname$2(parent), parent) : void 0;
|
|
3043
3044
|
}
|
|
@@ -3047,16 +3048,16 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3047
3048
|
findMadeSync: findMadeSync$1
|
|
3048
3049
|
};
|
|
3049
3050
|
const { dirname: dirname$1 } = path__default["default"];
|
|
3050
|
-
const mkdirpManual$2 = (path$
|
|
3051
|
+
const mkdirpManual$2 = (path$2, opts, made) => {
|
|
3051
3052
|
opts.recursive = false;
|
|
3052
|
-
const parent = dirname$1(path$
|
|
3053
|
-
if (parent === path$
|
|
3053
|
+
const parent = dirname$1(path$2);
|
|
3054
|
+
if (parent === path$2) return opts.mkdirAsync(path$2, opts).catch((er) => {
|
|
3054
3055
|
if (er.code !== "EISDIR") throw er;
|
|
3055
3056
|
});
|
|
3056
|
-
return opts.mkdirAsync(path$
|
|
3057
|
-
if (er.code === "ENOENT") return mkdirpManual$2(parent, opts).then((made$1) => mkdirpManual$2(path$
|
|
3057
|
+
return opts.mkdirAsync(path$2, opts).then(() => made || path$2, (er) => {
|
|
3058
|
+
if (er.code === "ENOENT") return mkdirpManual$2(parent, opts).then((made$1) => mkdirpManual$2(path$2, opts, made$1));
|
|
3058
3059
|
if (er.code !== "EEXIST" && er.code !== "EROFS") throw er;
|
|
3059
|
-
return opts.statAsync(path$
|
|
3060
|
+
return opts.statAsync(path$2).then((st) => {
|
|
3060
3061
|
if (st.isDirectory()) return made;
|
|
3061
3062
|
else throw er;
|
|
3062
3063
|
}, () => {
|
|
@@ -3064,23 +3065,23 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3064
3065
|
});
|
|
3065
3066
|
});
|
|
3066
3067
|
};
|
|
3067
|
-
const mkdirpManualSync$2 = (path$
|
|
3068
|
-
const parent = dirname$1(path$
|
|
3068
|
+
const mkdirpManualSync$2 = (path$2, opts, made) => {
|
|
3069
|
+
const parent = dirname$1(path$2);
|
|
3069
3070
|
opts.recursive = false;
|
|
3070
|
-
if (parent === path$
|
|
3071
|
-
return opts.mkdirSync(path$
|
|
3071
|
+
if (parent === path$2) try {
|
|
3072
|
+
return opts.mkdirSync(path$2, opts);
|
|
3072
3073
|
} catch (er) {
|
|
3073
3074
|
if (er.code !== "EISDIR") throw er;
|
|
3074
3075
|
else return;
|
|
3075
3076
|
}
|
|
3076
3077
|
try {
|
|
3077
|
-
opts.mkdirSync(path$
|
|
3078
|
-
return made || path$
|
|
3078
|
+
opts.mkdirSync(path$2, opts);
|
|
3079
|
+
return made || path$2;
|
|
3079
3080
|
} catch (er) {
|
|
3080
|
-
if (er.code === "ENOENT") return mkdirpManualSync$2(path$
|
|
3081
|
+
if (er.code === "ENOENT") return mkdirpManualSync$2(path$2, opts, mkdirpManualSync$2(parent, opts, made));
|
|
3081
3082
|
if (er.code !== "EEXIST" && er.code !== "EROFS") throw er;
|
|
3082
3083
|
try {
|
|
3083
|
-
if (!opts.statSync(path$
|
|
3084
|
+
if (!opts.statSync(path$2).isDirectory()) throw er;
|
|
3084
3085
|
} catch (_) {
|
|
3085
3086
|
throw er;
|
|
3086
3087
|
}
|
|
@@ -3090,26 +3091,26 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3090
3091
|
mkdirpManual: mkdirpManual$2,
|
|
3091
3092
|
mkdirpManualSync: mkdirpManualSync$2
|
|
3092
3093
|
};
|
|
3093
|
-
const { dirname
|
|
3094
|
+
const { dirname } = path__default["default"];
|
|
3094
3095
|
const { findMade, findMadeSync } = findMade_1;
|
|
3095
3096
|
const { mkdirpManual: mkdirpManual$1, mkdirpManualSync: mkdirpManualSync$1 } = mkdirpManual_1;
|
|
3096
|
-
const mkdirpNative$1 = (path$
|
|
3097
|
+
const mkdirpNative$1 = (path$2, opts) => {
|
|
3097
3098
|
opts.recursive = true;
|
|
3098
|
-
if (dirname
|
|
3099
|
-
return findMade(opts, path$
|
|
3100
|
-
if (er.code === "ENOENT") return mkdirpManual$1(path$
|
|
3099
|
+
if (dirname(path$2) === path$2) return opts.mkdirAsync(path$2, opts);
|
|
3100
|
+
return findMade(opts, path$2).then((made) => opts.mkdirAsync(path$2, opts).then(() => made).catch((er) => {
|
|
3101
|
+
if (er.code === "ENOENT") return mkdirpManual$1(path$2, opts);
|
|
3101
3102
|
else throw er;
|
|
3102
3103
|
}));
|
|
3103
3104
|
};
|
|
3104
|
-
const mkdirpNativeSync$1 = (path$
|
|
3105
|
+
const mkdirpNativeSync$1 = (path$2, opts) => {
|
|
3105
3106
|
opts.recursive = true;
|
|
3106
|
-
if (dirname
|
|
3107
|
-
const made = findMadeSync(opts, path$
|
|
3107
|
+
if (dirname(path$2) === path$2) return opts.mkdirSync(path$2, opts);
|
|
3108
|
+
const made = findMadeSync(opts, path$2);
|
|
3108
3109
|
try {
|
|
3109
|
-
opts.mkdirSync(path$
|
|
3110
|
+
opts.mkdirSync(path$2, opts);
|
|
3110
3111
|
return made;
|
|
3111
3112
|
} catch (er) {
|
|
3112
|
-
if (er.code === "ENOENT") return mkdirpManualSync$1(path$
|
|
3113
|
+
if (er.code === "ENOENT") return mkdirpManualSync$1(path$2, opts);
|
|
3113
3114
|
else throw er;
|
|
3114
3115
|
}
|
|
3115
3116
|
};
|
|
@@ -3126,21 +3127,21 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3126
3127
|
const { mkdirpNative, mkdirpNativeSync } = mkdirpNative_1;
|
|
3127
3128
|
const { mkdirpManual, mkdirpManualSync } = mkdirpManual_1;
|
|
3128
3129
|
const { useNative, useNativeSync } = useNative_1;
|
|
3129
|
-
const mkdirp$3 = (path$
|
|
3130
|
-
path$
|
|
3130
|
+
const mkdirp$3 = (path$2, opts) => {
|
|
3131
|
+
path$2 = pathArg_1(path$2);
|
|
3131
3132
|
opts = optsArg_1(opts);
|
|
3132
|
-
return useNative(opts) ? mkdirpNative(path$
|
|
3133
|
+
return useNative(opts) ? mkdirpNative(path$2, opts) : mkdirpManual(path$2, opts);
|
|
3133
3134
|
};
|
|
3134
|
-
const mkdirpSync = (path$
|
|
3135
|
-
path$
|
|
3135
|
+
const mkdirpSync = (path$2, opts) => {
|
|
3136
|
+
path$2 = pathArg_1(path$2);
|
|
3136
3137
|
opts = optsArg_1(opts);
|
|
3137
|
-
return useNativeSync(opts) ? mkdirpNativeSync(path$
|
|
3138
|
+
return useNativeSync(opts) ? mkdirpNativeSync(path$2, opts) : mkdirpManualSync(path$2, opts);
|
|
3138
3139
|
};
|
|
3139
3140
|
mkdirp$3.sync = mkdirpSync;
|
|
3140
|
-
mkdirp$3.native = (path$
|
|
3141
|
-
mkdirp$3.manual = (path$
|
|
3142
|
-
mkdirp$3.nativeSync = (path$
|
|
3143
|
-
mkdirp$3.manualSync = (path$
|
|
3141
|
+
mkdirp$3.native = (path$2, opts) => mkdirpNative(pathArg_1(path$2), optsArg_1(opts));
|
|
3142
|
+
mkdirp$3.manual = (path$2, opts) => mkdirpManual(pathArg_1(path$2), optsArg_1(opts));
|
|
3143
|
+
mkdirp$3.nativeSync = (path$2, opts) => mkdirpNativeSync(pathArg_1(path$2), optsArg_1(opts));
|
|
3144
|
+
mkdirp$3.manualSync = (path$2, opts) => mkdirpManualSync(pathArg_1(path$2), optsArg_1(opts));
|
|
3144
3145
|
var mkdirp_1 = mkdirp$3;
|
|
3145
3146
|
/* istanbul ignore next */
|
|
3146
3147
|
const LCHOWN = fs__default["default"].lchown ? "lchown" : "chown";
|
|
@@ -3148,40 +3149,40 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3148
3149
|
const LCHOWNSYNC = fs__default["default"].lchownSync ? "lchownSync" : "chownSync";
|
|
3149
3150
|
/* istanbul ignore next */
|
|
3150
3151
|
const needEISDIRHandled = fs__default["default"].lchown && !process.version.match(/v1[1-9]+\./) && !process.version.match(/v10\.[6-9]/);
|
|
3151
|
-
const lchownSync = (path$
|
|
3152
|
+
const lchownSync = (path$2, uid, gid) => {
|
|
3152
3153
|
try {
|
|
3153
|
-
return fs__default["default"][LCHOWNSYNC](path$
|
|
3154
|
+
return fs__default["default"][LCHOWNSYNC](path$2, uid, gid);
|
|
3154
3155
|
} catch (er) {
|
|
3155
3156
|
if (er.code !== "ENOENT") throw er;
|
|
3156
3157
|
}
|
|
3157
3158
|
};
|
|
3158
3159
|
/* istanbul ignore next */
|
|
3159
|
-
const chownSync = (path$
|
|
3160
|
+
const chownSync = (path$2, uid, gid) => {
|
|
3160
3161
|
try {
|
|
3161
|
-
return fs__default["default"].chownSync(path$
|
|
3162
|
+
return fs__default["default"].chownSync(path$2, uid, gid);
|
|
3162
3163
|
} catch (er) {
|
|
3163
3164
|
if (er.code !== "ENOENT") throw er;
|
|
3164
3165
|
}
|
|
3165
3166
|
};
|
|
3166
3167
|
/* istanbul ignore next */
|
|
3167
|
-
const handleEISDIR = needEISDIRHandled ? (path$
|
|
3168
|
+
const handleEISDIR = needEISDIRHandled ? (path$2, uid, gid, cb) => (er) => {
|
|
3168
3169
|
if (!er || er.code !== "EISDIR") cb(er);
|
|
3169
|
-
else fs__default["default"].chown(path$
|
|
3170
|
+
else fs__default["default"].chown(path$2, uid, gid, cb);
|
|
3170
3171
|
} : (_, __, ___, cb) => cb;
|
|
3171
3172
|
/* istanbul ignore next */
|
|
3172
|
-
const handleEISDirSync = needEISDIRHandled ? (path$
|
|
3173
|
+
const handleEISDirSync = needEISDIRHandled ? (path$2, uid, gid) => {
|
|
3173
3174
|
try {
|
|
3174
|
-
return lchownSync(path$
|
|
3175
|
+
return lchownSync(path$2, uid, gid);
|
|
3175
3176
|
} catch (er) {
|
|
3176
3177
|
if (er.code !== "EISDIR") throw er;
|
|
3177
|
-
chownSync(path$
|
|
3178
|
+
chownSync(path$2, uid, gid);
|
|
3178
3179
|
}
|
|
3179
|
-
} : (path$
|
|
3180
|
+
} : (path$2, uid, gid) => lchownSync(path$2, uid, gid);
|
|
3180
3181
|
const nodeVersion = process.version;
|
|
3181
|
-
let readdir = (path$
|
|
3182
|
-
let readdirSync
|
|
3182
|
+
let readdir = (path$2, options, cb) => fs__default["default"].readdir(path$2, options, cb);
|
|
3183
|
+
let readdirSync = (path$2, options) => fs__default["default"].readdirSync(path$2, options);
|
|
3183
3184
|
/* istanbul ignore next */
|
|
3184
|
-
if (/^v4\./.test(nodeVersion)) readdir = (path$
|
|
3185
|
+
if (/^v4\./.test(nodeVersion)) readdir = (path$2, options, cb) => fs__default["default"].readdir(path$2, cb);
|
|
3185
3186
|
const chown = (cpath, uid, gid, cb) => {
|
|
3186
3187
|
fs__default["default"][LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, (er) => {
|
|
3187
3188
|
cb(er && er.code !== "ENOENT" ? er : null);
|
|
@@ -3231,7 +3232,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3231
3232
|
const chownrSync = (p, uid, gid) => {
|
|
3232
3233
|
let children;
|
|
3233
3234
|
try {
|
|
3234
|
-
children = readdirSync
|
|
3235
|
+
children = readdirSync(p, { withFileTypes: true });
|
|
3235
3236
|
} catch (er) {
|
|
3236
3237
|
if (er.code === "ENOENT") return;
|
|
3237
3238
|
else if (er.code === "ENOTDIR" || er.code === "ENOTSUP") return handleEISDirSync(p, uid, gid);
|
|
@@ -3243,9 +3244,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3243
3244
|
var chownr_1 = chownr;
|
|
3244
3245
|
chownr.sync = chownrSync;
|
|
3245
3246
|
var SymlinkError = class extends Error {
|
|
3246
|
-
constructor(symlink, path$
|
|
3247
|
+
constructor(symlink, path$2) {
|
|
3247
3248
|
super("Cannot extract through symbolic link");
|
|
3248
|
-
this.path = path$
|
|
3249
|
+
this.path = path$2;
|
|
3249
3250
|
this.symlink = symlink;
|
|
3250
3251
|
}
|
|
3251
3252
|
get name() {
|
|
@@ -3253,9 +3254,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3253
3254
|
}
|
|
3254
3255
|
};
|
|
3255
3256
|
var CwdError = class extends Error {
|
|
3256
|
-
constructor(path$
|
|
3257
|
-
super(code + ": Cannot cd into '" + path$
|
|
3258
|
-
this.path = path$
|
|
3257
|
+
constructor(path$2, code) {
|
|
3258
|
+
super(code + ": Cannot cd into '" + path$2 + "'");
|
|
3259
|
+
this.path = path$2;
|
|
3259
3260
|
this.code = code;
|
|
3260
3261
|
}
|
|
3261
3262
|
get name() {
|
|
@@ -3272,7 +3273,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3272
3273
|
const preserve = opt.preserve;
|
|
3273
3274
|
const unlink = opt.unlink;
|
|
3274
3275
|
const cache = opt.cache;
|
|
3275
|
-
const cwd$
|
|
3276
|
+
const cwd$1 = opt.cwd;
|
|
3276
3277
|
const done = (er, created) => {
|
|
3277
3278
|
if (er) cb(er);
|
|
3278
3279
|
else {
|
|
@@ -3283,36 +3284,36 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3283
3284
|
}
|
|
3284
3285
|
};
|
|
3285
3286
|
if (cache && cache.get(dir) === true) return done();
|
|
3286
|
-
if (dir === cwd$
|
|
3287
|
+
if (dir === cwd$1) return fs__default["default"].stat(dir, (er, st) => {
|
|
3287
3288
|
if (er || !st.isDirectory()) er = new CwdError(dir, er && er.code || "ENOTDIR");
|
|
3288
3289
|
done(er);
|
|
3289
3290
|
});
|
|
3290
3291
|
if (preserve) return mkdirp_1(dir, { mode }).then((made) => done(null, made), done);
|
|
3291
|
-
mkdir_(cwd$
|
|
3292
|
+
mkdir_(cwd$1, path__default["default"].relative(cwd$1, dir).split(/\/|\\/), mode, cache, unlink, cwd$1, null, done);
|
|
3292
3293
|
};
|
|
3293
|
-
const mkdir_ = (base
|
|
3294
|
+
const mkdir_ = (base, parts, mode, cache, unlink, cwd$1, created, cb) => {
|
|
3294
3295
|
if (!parts.length) return cb(null, created);
|
|
3295
3296
|
const p = parts.shift();
|
|
3296
|
-
const part = base
|
|
3297
|
-
if (cache.get(part)) return mkdir_(part, parts, mode, cache, unlink, cwd$
|
|
3298
|
-
fs__default["default"].mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd$
|
|
3297
|
+
const part = base + "/" + p;
|
|
3298
|
+
if (cache.get(part)) return mkdir_(part, parts, mode, cache, unlink, cwd$1, created, cb);
|
|
3299
|
+
fs__default["default"].mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd$1, created, cb));
|
|
3299
3300
|
};
|
|
3300
|
-
const onmkdir = (part, parts, mode, cache, unlink, cwd$
|
|
3301
|
+
const onmkdir = (part, parts, mode, cache, unlink, cwd$1, created, cb) => (er) => {
|
|
3301
3302
|
if (er) {
|
|
3302
|
-
if (er.path && path__default["default"].dirname(er.path) === cwd$
|
|
3303
|
+
if (er.path && path__default["default"].dirname(er.path) === cwd$1 && (er.code === "ENOTDIR" || er.code === "ENOENT")) return cb(new CwdError(cwd$1, er.code));
|
|
3303
3304
|
fs__default["default"].lstat(part, (statEr, st) => {
|
|
3304
3305
|
if (statEr) cb(statEr);
|
|
3305
|
-
else if (st.isDirectory()) mkdir_(part, parts, mode, cache, unlink, cwd$
|
|
3306
|
+
else if (st.isDirectory()) mkdir_(part, parts, mode, cache, unlink, cwd$1, created, cb);
|
|
3306
3307
|
else if (unlink) fs__default["default"].unlink(part, (er$1) => {
|
|
3307
3308
|
if (er$1) return cb(er$1);
|
|
3308
|
-
fs__default["default"].mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd$
|
|
3309
|
+
fs__default["default"].mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd$1, created, cb));
|
|
3309
3310
|
});
|
|
3310
3311
|
else if (st.isSymbolicLink()) return cb(new SymlinkError(part, part + "/" + parts.join("/")));
|
|
3311
3312
|
else cb(er);
|
|
3312
3313
|
});
|
|
3313
3314
|
} else {
|
|
3314
3315
|
created = created || part;
|
|
3315
|
-
mkdir_(part, parts, mode, cache, unlink, cwd$
|
|
3316
|
+
mkdir_(part, parts, mode, cache, unlink, cwd$1, created, cb);
|
|
3316
3317
|
}
|
|
3317
3318
|
};
|
|
3318
3319
|
var sync$1 = (dir, opt) => {
|
|
@@ -3325,37 +3326,37 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3325
3326
|
const preserve = opt.preserve;
|
|
3326
3327
|
const unlink = opt.unlink;
|
|
3327
3328
|
const cache = opt.cache;
|
|
3328
|
-
const cwd$
|
|
3329
|
+
const cwd$1 = opt.cwd;
|
|
3329
3330
|
const done = (created$1) => {
|
|
3330
3331
|
cache.set(dir, true);
|
|
3331
3332
|
if (created$1 && doChown) chownr_1.sync(created$1, uid, gid);
|
|
3332
3333
|
if (needChmod) fs__default["default"].chmodSync(dir, mode);
|
|
3333
3334
|
};
|
|
3334
3335
|
if (cache && cache.get(dir) === true) return done();
|
|
3335
|
-
if (dir === cwd$
|
|
3336
|
-
let ok
|
|
3336
|
+
if (dir === cwd$1) {
|
|
3337
|
+
let ok = false;
|
|
3337
3338
|
let code = "ENOTDIR";
|
|
3338
3339
|
try {
|
|
3339
|
-
ok
|
|
3340
|
+
ok = fs__default["default"].statSync(dir).isDirectory();
|
|
3340
3341
|
} catch (er) {
|
|
3341
3342
|
code = er.code;
|
|
3342
3343
|
} finally {
|
|
3343
|
-
if (!ok
|
|
3344
|
+
if (!ok) throw new CwdError(dir, code);
|
|
3344
3345
|
}
|
|
3345
3346
|
done();
|
|
3346
3347
|
return;
|
|
3347
3348
|
}
|
|
3348
3349
|
if (preserve) return done(mkdirp_1.sync(dir, mode));
|
|
3349
|
-
const parts = path__default["default"].relative(cwd$
|
|
3350
|
+
const parts = path__default["default"].relative(cwd$1, dir).split(/\/|\\/);
|
|
3350
3351
|
let created = null;
|
|
3351
|
-
for (let p = parts.shift(), part = cwd$
|
|
3352
|
+
for (let p = parts.shift(), part = cwd$1; p && (part += "/" + p); p = parts.shift()) {
|
|
3352
3353
|
if (cache.get(part)) continue;
|
|
3353
3354
|
try {
|
|
3354
3355
|
fs__default["default"].mkdirSync(part, mode);
|
|
3355
3356
|
created = created || part;
|
|
3356
3357
|
cache.set(part, true);
|
|
3357
3358
|
} catch (er) {
|
|
3358
|
-
if (er.path && path__default["default"].dirname(er.path) === cwd$
|
|
3359
|
+
if (er.path && path__default["default"].dirname(er.path) === cwd$1 && (er.code === "ENOTDIR" || er.code === "ENOENT")) return new CwdError(cwd$1, er.code);
|
|
3359
3360
|
const st = fs__default["default"].lstatSync(part);
|
|
3360
3361
|
if (st.isDirectory()) {
|
|
3361
3362
|
cache.set(part, true);
|
|
@@ -3376,15 +3377,15 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3376
3377
|
const queues = /* @__PURE__ */ new Map();
|
|
3377
3378
|
const reservations = /* @__PURE__ */ new Map();
|
|
3378
3379
|
const { join: join$1 } = path__default["default"];
|
|
3379
|
-
const getDirs = (path$
|
|
3380
|
+
const getDirs = (path$2) => join$1(path$2).split(/[\\/]/).slice(0, -1).reduce((set, path$3) => set.length ? set.concat(join$1(set[set.length - 1], path$3)) : [path$3], []);
|
|
3380
3381
|
const running = /* @__PURE__ */ new Set();
|
|
3381
3382
|
const getQueues = (fn) => {
|
|
3382
3383
|
const res = reservations.get(fn);
|
|
3383
3384
|
/* istanbul ignore if - unpossible */
|
|
3384
3385
|
if (!res) throw new Error("function does not have any path reservations");
|
|
3385
3386
|
return {
|
|
3386
|
-
paths: res.paths.map((path$
|
|
3387
|
-
dirs: [...res.dirs].map((path$
|
|
3387
|
+
paths: res.paths.map((path$2) => queues.get(path$2)),
|
|
3388
|
+
dirs: [...res.dirs].map((path$2) => queues.get(path$2))
|
|
3388
3389
|
};
|
|
3389
3390
|
};
|
|
3390
3391
|
const check = (fn) => {
|
|
@@ -3401,10 +3402,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3401
3402
|
if (!running.has(fn)) return false;
|
|
3402
3403
|
const { paths, dirs } = reservations.get(fn);
|
|
3403
3404
|
const next = /* @__PURE__ */ new Set();
|
|
3404
|
-
paths.forEach((path$
|
|
3405
|
-
const q$1 = queues.get(path$
|
|
3405
|
+
paths.forEach((path$2) => {
|
|
3406
|
+
const q$1 = queues.get(path$2);
|
|
3406
3407
|
assert__default["default"].equal(q$1[0], fn);
|
|
3407
|
-
if (q$1.length === 1) queues.delete(path$
|
|
3408
|
+
if (q$1.length === 1) queues.delete(path$2);
|
|
3408
3409
|
else {
|
|
3409
3410
|
q$1.shift();
|
|
3410
3411
|
if (typeof q$1[0] === "function") next.add(q$1[0]);
|
|
@@ -3425,14 +3426,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3425
3426
|
return true;
|
|
3426
3427
|
};
|
|
3427
3428
|
const reserve = (paths, fn) => {
|
|
3428
|
-
const dirs = new Set(paths.map((path$
|
|
3429
|
+
const dirs = new Set(paths.map((path$2) => getDirs(path$2)).reduce((a, b) => a.concat(b)));
|
|
3429
3430
|
reservations.set(fn, {
|
|
3430
3431
|
dirs,
|
|
3431
3432
|
paths
|
|
3432
3433
|
});
|
|
3433
|
-
paths.forEach((path$
|
|
3434
|
-
const q$1 = queues.get(path$
|
|
3435
|
-
if (!q$1) queues.set(path$
|
|
3434
|
+
paths.forEach((path$2) => {
|
|
3435
|
+
const q$1 = queues.get(path$2);
|
|
3436
|
+
if (!q$1) queues.set(path$2, [fn]);
|
|
3436
3437
|
else q$1.push(fn);
|
|
3437
3438
|
});
|
|
3438
3439
|
dirs.forEach((dir) => {
|
|
@@ -3483,19 +3484,19 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3483
3484
|
throw new Error("sync function called cb somehow?!?");
|
|
3484
3485
|
};
|
|
3485
3486
|
/* istanbul ignore next */
|
|
3486
|
-
const unlinkFile = (path$
|
|
3487
|
-
if (process.platform !== "win32") return fs__default["default"].unlink(path$
|
|
3488
|
-
const name = path$
|
|
3489
|
-
fs__default["default"].rename(path$
|
|
3487
|
+
const unlinkFile = (path$2, cb) => {
|
|
3488
|
+
if (process.platform !== "win32") return fs__default["default"].unlink(path$2, cb);
|
|
3489
|
+
const name = path$2 + ".DELETE." + crypto__default["default"].randomBytes(16).toString("hex");
|
|
3490
|
+
fs__default["default"].rename(path$2, name, (er) => {
|
|
3490
3491
|
if (er) return cb(er);
|
|
3491
3492
|
fs__default["default"].unlink(name, cb);
|
|
3492
3493
|
});
|
|
3493
3494
|
};
|
|
3494
3495
|
/* istanbul ignore next */
|
|
3495
|
-
const unlinkFileSync = (path$
|
|
3496
|
-
if (process.platform !== "win32") return fs__default["default"].unlinkSync(path$
|
|
3497
|
-
const name = path$
|
|
3498
|
-
fs__default["default"].renameSync(path$
|
|
3496
|
+
const unlinkFileSync = (path$2) => {
|
|
3497
|
+
if (process.platform !== "win32") return fs__default["default"].unlinkSync(path$2);
|
|
3498
|
+
const name = path$2 + ".DELETE." + crypto__default["default"].randomBytes(16).toString("hex");
|
|
3499
|
+
fs__default["default"].renameSync(path$2, name);
|
|
3499
3500
|
fs__default["default"].unlinkSync(name);
|
|
3500
3501
|
};
|
|
3501
3502
|
const uint32 = (a, b, c) => a === a >>> 0 ? a : b === b >>> 0 ? b : c;
|
|
@@ -3769,8 +3770,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3769
3770
|
case "GNUDumpDir": return this[DIRECTORY](entry, done);
|
|
3770
3771
|
}
|
|
3771
3772
|
}
|
|
3772
|
-
[LINK](entry, linkpath, link
|
|
3773
|
-
fs__default["default"][link
|
|
3773
|
+
[LINK](entry, linkpath, link, done) {
|
|
3774
|
+
fs__default["default"][link](linkpath, entry.absolute, (er) => {
|
|
3774
3775
|
if (er) return this[ONERROR](er, entry);
|
|
3775
3776
|
done();
|
|
3776
3777
|
this[UNPEND]();
|
|
@@ -3889,9 +3890,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3889
3890
|
return er;
|
|
3890
3891
|
}
|
|
3891
3892
|
}
|
|
3892
|
-
[LINK](entry, linkpath, link
|
|
3893
|
+
[LINK](entry, linkpath, link, _) {
|
|
3893
3894
|
try {
|
|
3894
|
-
fs__default["default"][link
|
|
3895
|
+
fs__default["default"][link + "Sync"](linkpath, entry.absolute);
|
|
3895
3896
|
entry.resume();
|
|
3896
3897
|
} catch (er) {
|
|
3897
3898
|
return this[ONERROR](er, entry);
|
|
@@ -3914,14 +3915,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3914
3915
|
};
|
|
3915
3916
|
const filesFilter = (opt, files) => {
|
|
3916
3917
|
const map$1 = new Map(files.map((f) => [f.replace(/\/+$/, ""), true]));
|
|
3917
|
-
const filter
|
|
3918
|
+
const filter = opt.filter;
|
|
3918
3919
|
const mapHas = (file, r) => {
|
|
3919
3920
|
const root = r || path__default["default"].parse(file).root || ".";
|
|
3920
3921
|
const ret = file === root ? false : map$1.has(file) ? map$1.get(file) : mapHas(path__default["default"].dirname(file), root);
|
|
3921
3922
|
map$1.set(file, ret);
|
|
3922
3923
|
return ret;
|
|
3923
3924
|
};
|
|
3924
|
-
opt.filter = filter
|
|
3925
|
+
opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, "")) : (file) => mapHas(file.replace(/\/+$/, ""));
|
|
3925
3926
|
};
|
|
3926
3927
|
const extractFileSync = (opt) => {
|
|
3927
3928
|
const u = new unpack.Sync(opt);
|
|
@@ -3937,9 +3938,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
3937
3938
|
const u = new unpack(opt);
|
|
3938
3939
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
3939
3940
|
const file = opt.file;
|
|
3940
|
-
const p = new Promise((resolve$
|
|
3941
|
+
const p = new Promise((resolve$1, reject) => {
|
|
3941
3942
|
u.on("error", reject);
|
|
3942
|
-
u.on("close", resolve$
|
|
3943
|
+
u.on("close", resolve$1);
|
|
3943
3944
|
fs__default["default"].stat(file, (er, stat) => {
|
|
3944
3945
|
if (er) reject(er);
|
|
3945
3946
|
else {
|
|
@@ -4803,21 +4804,21 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4803
4804
|
const min = Math.min(r, g, b);
|
|
4804
4805
|
const max = Math.max(r, g, b);
|
|
4805
4806
|
const delta = max - min;
|
|
4806
|
-
let h
|
|
4807
|
-
let s
|
|
4808
|
-
if (max === min) h
|
|
4809
|
-
else if (r === max) h
|
|
4810
|
-
else if (g === max) h
|
|
4811
|
-
else if (b === max) h
|
|
4812
|
-
h
|
|
4813
|
-
if (h
|
|
4807
|
+
let h;
|
|
4808
|
+
let s;
|
|
4809
|
+
if (max === min) h = 0;
|
|
4810
|
+
else if (r === max) h = (g - b) / delta;
|
|
4811
|
+
else if (g === max) h = 2 + (b - r) / delta;
|
|
4812
|
+
else if (b === max) h = 4 + (r - g) / delta;
|
|
4813
|
+
h = Math.min(h * 60, 360);
|
|
4814
|
+
if (h < 0) h += 360;
|
|
4814
4815
|
const l = (min + max) / 2;
|
|
4815
|
-
if (max === min) s
|
|
4816
|
-
else if (l <= .5) s
|
|
4817
|
-
else s
|
|
4816
|
+
if (max === min) s = 0;
|
|
4817
|
+
else if (l <= .5) s = delta / (max + min);
|
|
4818
|
+
else s = delta / (2 - max - min);
|
|
4818
4819
|
return [
|
|
4819
|
-
h
|
|
4820
|
-
s
|
|
4820
|
+
h,
|
|
4821
|
+
s * 100,
|
|
4821
4822
|
l * 100
|
|
4822
4823
|
];
|
|
4823
4824
|
};
|
|
@@ -4825,8 +4826,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4825
4826
|
let rdif;
|
|
4826
4827
|
let gdif;
|
|
4827
4828
|
let bdif;
|
|
4828
|
-
let h
|
|
4829
|
-
let s
|
|
4829
|
+
let h;
|
|
4830
|
+
let s;
|
|
4830
4831
|
const r = rgb[0] / 255;
|
|
4831
4832
|
const g = rgb[1] / 255;
|
|
4832
4833
|
const b = rgb[2] / 255;
|
|
@@ -4836,22 +4837,22 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4836
4837
|
return (v - c) / 6 / diff + 1 / 2;
|
|
4837
4838
|
};
|
|
4838
4839
|
if (diff === 0) {
|
|
4839
|
-
h
|
|
4840
|
-
s
|
|
4840
|
+
h = 0;
|
|
4841
|
+
s = 0;
|
|
4841
4842
|
} else {
|
|
4842
|
-
s
|
|
4843
|
+
s = diff / v;
|
|
4843
4844
|
rdif = diffc(r);
|
|
4844
4845
|
gdif = diffc(g);
|
|
4845
4846
|
bdif = diffc(b);
|
|
4846
|
-
if (r === v) h
|
|
4847
|
-
else if (g === v) h
|
|
4848
|
-
else if (b === v) h
|
|
4849
|
-
if (h
|
|
4850
|
-
else if (h
|
|
4847
|
+
if (r === v) h = bdif - gdif;
|
|
4848
|
+
else if (g === v) h = 1 / 3 + rdif - bdif;
|
|
4849
|
+
else if (b === v) h = 2 / 3 + gdif - rdif;
|
|
4850
|
+
if (h < 0) h += 1;
|
|
4851
|
+
else if (h > 1) h -= 1;
|
|
4851
4852
|
}
|
|
4852
4853
|
return [
|
|
4853
|
-
h
|
|
4854
|
-
s
|
|
4854
|
+
h * 360,
|
|
4855
|
+
s * 100,
|
|
4855
4856
|
v * 100
|
|
4856
4857
|
];
|
|
4857
4858
|
};
|
|
@@ -4859,12 +4860,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4859
4860
|
const r = rgb[0];
|
|
4860
4861
|
const g = rgb[1];
|
|
4861
4862
|
let b = rgb[2];
|
|
4862
|
-
const h
|
|
4863
|
-
const w
|
|
4863
|
+
const h = convert$1.rgb.hsl(rgb)[0];
|
|
4864
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
4864
4865
|
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
4865
4866
|
return [
|
|
4866
|
-
h
|
|
4867
|
-
w
|
|
4867
|
+
h,
|
|
4868
|
+
w * 100,
|
|
4868
4869
|
b * 100
|
|
4869
4870
|
];
|
|
4870
4871
|
};
|
|
@@ -4874,17 +4875,17 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4874
4875
|
const b = rgb[2] / 255;
|
|
4875
4876
|
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
4876
4877
|
const c = (1 - r - k) / (1 - k) || 0;
|
|
4877
|
-
const m
|
|
4878
|
-
const y
|
|
4878
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
4879
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
4879
4880
|
return [
|
|
4880
4881
|
c * 100,
|
|
4881
|
-
m
|
|
4882
|
-
y
|
|
4882
|
+
m * 100,
|
|
4883
|
+
y * 100,
|
|
4883
4884
|
k * 100
|
|
4884
4885
|
];
|
|
4885
4886
|
};
|
|
4886
|
-
function comparativeDistance(x, y
|
|
4887
|
-
return (x[0] - y
|
|
4887
|
+
function comparativeDistance(x, y) {
|
|
4888
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
4888
4889
|
}
|
|
4889
4890
|
convert$1.rgb.keyword = function(rgb) {
|
|
4890
4891
|
const reversed = reverseKeywords[rgb];
|
|
@@ -4912,39 +4913,39 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4912
4913
|
g = g > .04045 ? ((g + .055) / 1.055) ** 2.4 : g / 12.92;
|
|
4913
4914
|
b = b > .04045 ? ((b + .055) / 1.055) ** 2.4 : b / 12.92;
|
|
4914
4915
|
const x = r * .4124 + g * .3576 + b * .1805;
|
|
4915
|
-
const y
|
|
4916
|
+
const y = r * .2126 + g * .7152 + b * .0722;
|
|
4916
4917
|
const z = r * .0193 + g * .1192 + b * .9505;
|
|
4917
4918
|
return [
|
|
4918
4919
|
x * 100,
|
|
4919
|
-
y
|
|
4920
|
+
y * 100,
|
|
4920
4921
|
z * 100
|
|
4921
4922
|
];
|
|
4922
4923
|
};
|
|
4923
4924
|
convert$1.rgb.lab = function(rgb) {
|
|
4924
4925
|
const xyz = convert$1.rgb.xyz(rgb);
|
|
4925
4926
|
let x = xyz[0];
|
|
4926
|
-
let y
|
|
4927
|
+
let y = xyz[1];
|
|
4927
4928
|
let z = xyz[2];
|
|
4928
4929
|
x /= 95.047;
|
|
4929
|
-
y
|
|
4930
|
+
y /= 100;
|
|
4930
4931
|
z /= 108.883;
|
|
4931
4932
|
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
4932
|
-
y
|
|
4933
|
+
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
4933
4934
|
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
4934
4935
|
return [
|
|
4935
|
-
116 * y
|
|
4936
|
-
500 * (x - y
|
|
4937
|
-
200 * (y
|
|
4936
|
+
116 * y - 16,
|
|
4937
|
+
500 * (x - y),
|
|
4938
|
+
200 * (y - z)
|
|
4938
4939
|
];
|
|
4939
4940
|
};
|
|
4940
4941
|
convert$1.hsl.rgb = function(hsl) {
|
|
4941
|
-
const h
|
|
4942
|
-
const s
|
|
4942
|
+
const h = hsl[0] / 360;
|
|
4943
|
+
const s = hsl[1] / 100;
|
|
4943
4944
|
const l = hsl[2] / 100;
|
|
4944
4945
|
let t2;
|
|
4945
4946
|
let t3;
|
|
4946
4947
|
let val;
|
|
4947
|
-
if (s
|
|
4948
|
+
if (s === 0) {
|
|
4948
4949
|
val = l * 255;
|
|
4949
4950
|
return [
|
|
4950
4951
|
val,
|
|
@@ -4952,8 +4953,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4952
4953
|
val
|
|
4953
4954
|
];
|
|
4954
4955
|
}
|
|
4955
|
-
if (l < .5) t2 = l * (1 + s
|
|
4956
|
-
else t2 = l + s
|
|
4956
|
+
if (l < .5) t2 = l * (1 + s);
|
|
4957
|
+
else t2 = l + s - l * s;
|
|
4957
4958
|
const t1 = 2 * l - t2;
|
|
4958
4959
|
const rgb = [
|
|
4959
4960
|
0,
|
|
@@ -4961,7 +4962,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4961
4962
|
0
|
|
4962
4963
|
];
|
|
4963
4964
|
for (let i = 0; i < 3; i++) {
|
|
4964
|
-
t3 = h
|
|
4965
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
4965
4966
|
if (t3 < 0) t3++;
|
|
4966
4967
|
if (t3 > 1) t3--;
|
|
4967
4968
|
if (6 * t3 < 1) val = t1 + (t2 - t1) * 6 * t3;
|
|
@@ -4973,30 +4974,30 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
4973
4974
|
return rgb;
|
|
4974
4975
|
};
|
|
4975
4976
|
convert$1.hsl.hsv = function(hsl) {
|
|
4976
|
-
const h
|
|
4977
|
-
let s
|
|
4977
|
+
const h = hsl[0];
|
|
4978
|
+
let s = hsl[1] / 100;
|
|
4978
4979
|
let l = hsl[2] / 100;
|
|
4979
|
-
let smin = s
|
|
4980
|
+
let smin = s;
|
|
4980
4981
|
const lmin = Math.max(l, .01);
|
|
4981
4982
|
l *= 2;
|
|
4982
|
-
s
|
|
4983
|
+
s *= l <= 1 ? l : 2 - l;
|
|
4983
4984
|
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
4984
|
-
const v = (l + s
|
|
4985
|
+
const v = (l + s) / 2;
|
|
4985
4986
|
return [
|
|
4986
|
-
h
|
|
4987
|
-
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s
|
|
4987
|
+
h,
|
|
4988
|
+
(l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s)) * 100,
|
|
4988
4989
|
v * 100
|
|
4989
4990
|
];
|
|
4990
4991
|
};
|
|
4991
4992
|
convert$1.hsv.rgb = function(hsv) {
|
|
4992
|
-
const h
|
|
4993
|
-
const s
|
|
4993
|
+
const h = hsv[0] / 60;
|
|
4994
|
+
const s = hsv[1] / 100;
|
|
4994
4995
|
let v = hsv[2] / 100;
|
|
4995
|
-
const hi = Math.floor(h
|
|
4996
|
-
const f = h
|
|
4997
|
-
const p = 255 * v * (1 - s
|
|
4998
|
-
const q$1 = 255 * v * (1 - s
|
|
4999
|
-
const t = 255 * v * (1 - s
|
|
4996
|
+
const hi = Math.floor(h) % 6;
|
|
4997
|
+
const f = h - Math.floor(h);
|
|
4998
|
+
const p = 255 * v * (1 - s);
|
|
4999
|
+
const q$1 = 255 * v * (1 - s * f);
|
|
5000
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
5000
5001
|
v *= 255;
|
|
5001
5002
|
switch (hi) {
|
|
5002
5003
|
case 0: return [
|
|
@@ -5032,26 +5033,26 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5032
5033
|
}
|
|
5033
5034
|
};
|
|
5034
5035
|
convert$1.hsv.hsl = function(hsv) {
|
|
5035
|
-
const h
|
|
5036
|
-
const s
|
|
5036
|
+
const h = hsv[0];
|
|
5037
|
+
const s = hsv[1] / 100;
|
|
5037
5038
|
const v = hsv[2] / 100;
|
|
5038
5039
|
const vmin = Math.max(v, .01);
|
|
5039
5040
|
let sl;
|
|
5040
5041
|
let l;
|
|
5041
|
-
l = (2 - s
|
|
5042
|
-
const lmin = (2 - s
|
|
5043
|
-
sl = s
|
|
5042
|
+
l = (2 - s) * v;
|
|
5043
|
+
const lmin = (2 - s) * vmin;
|
|
5044
|
+
sl = s * vmin;
|
|
5044
5045
|
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
5045
5046
|
sl = sl || 0;
|
|
5046
5047
|
l /= 2;
|
|
5047
5048
|
return [
|
|
5048
|
-
h
|
|
5049
|
+
h,
|
|
5049
5050
|
sl * 100,
|
|
5050
5051
|
l * 100
|
|
5051
5052
|
];
|
|
5052
5053
|
};
|
|
5053
5054
|
convert$1.hwb.rgb = function(hwb) {
|
|
5054
|
-
const h
|
|
5055
|
+
const h = hwb[0] / 360;
|
|
5055
5056
|
let wh = hwb[1] / 100;
|
|
5056
5057
|
let bl = hwb[2] / 100;
|
|
5057
5058
|
const ratio = wh + bl;
|
|
@@ -5060,9 +5061,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5060
5061
|
wh /= ratio;
|
|
5061
5062
|
bl /= ratio;
|
|
5062
5063
|
}
|
|
5063
|
-
const i = Math.floor(6 * h
|
|
5064
|
+
const i = Math.floor(6 * h);
|
|
5064
5065
|
const v = 1 - bl;
|
|
5065
|
-
f = 6 * h
|
|
5066
|
+
f = 6 * h - i;
|
|
5066
5067
|
if ((i & 1) !== 0) f = 1 - f;
|
|
5067
5068
|
const n = wh + f * (v - wh);
|
|
5068
5069
|
let r;
|
|
@@ -5110,12 +5111,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5110
5111
|
};
|
|
5111
5112
|
convert$1.cmyk.rgb = function(cmyk) {
|
|
5112
5113
|
const c = cmyk[0] / 100;
|
|
5113
|
-
const m
|
|
5114
|
-
const y
|
|
5114
|
+
const m = cmyk[1] / 100;
|
|
5115
|
+
const y = cmyk[2] / 100;
|
|
5115
5116
|
const k = cmyk[3] / 100;
|
|
5116
5117
|
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
5117
|
-
const g = 1 - Math.min(1, m
|
|
5118
|
-
const b = 1 - Math.min(1, y
|
|
5118
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
5119
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
5119
5120
|
return [
|
|
5120
5121
|
r * 255,
|
|
5121
5122
|
g * 255,
|
|
@@ -5124,14 +5125,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5124
5125
|
};
|
|
5125
5126
|
convert$1.xyz.rgb = function(xyz) {
|
|
5126
5127
|
const x = xyz[0] / 100;
|
|
5127
|
-
const y
|
|
5128
|
+
const y = xyz[1] / 100;
|
|
5128
5129
|
const z = xyz[2] / 100;
|
|
5129
5130
|
let r;
|
|
5130
5131
|
let g;
|
|
5131
5132
|
let b;
|
|
5132
|
-
r = x * 3.2406 + y
|
|
5133
|
-
g = x * -.9689 + y
|
|
5134
|
-
b = x * .0557 + y
|
|
5133
|
+
r = x * 3.2406 + y * -1.5372 + z * -.4986;
|
|
5134
|
+
g = x * -.9689 + y * 1.8758 + z * .0415;
|
|
5135
|
+
b = x * .0557 + y * -.204 + z * 1.057;
|
|
5135
5136
|
r = r > .0031308 ? 1.055 * r ** (1 / 2.4) - .055 : r * 12.92;
|
|
5136
5137
|
g = g > .0031308 ? 1.055 * g ** (1 / 2.4) - .055 : g * 12.92;
|
|
5137
5138
|
b = b > .0031308 ? 1.055 * b ** (1 / 2.4) - .055 : b * 12.92;
|
|
@@ -5146,18 +5147,18 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5146
5147
|
};
|
|
5147
5148
|
convert$1.xyz.lab = function(xyz) {
|
|
5148
5149
|
let x = xyz[0];
|
|
5149
|
-
let y
|
|
5150
|
+
let y = xyz[1];
|
|
5150
5151
|
let z = xyz[2];
|
|
5151
5152
|
x /= 95.047;
|
|
5152
|
-
y
|
|
5153
|
+
y /= 100;
|
|
5153
5154
|
z /= 108.883;
|
|
5154
5155
|
x = x > .008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
5155
|
-
y
|
|
5156
|
+
y = y > .008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
5156
5157
|
z = z > .008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
5157
5158
|
return [
|
|
5158
|
-
116 * y
|
|
5159
|
-
500 * (x - y
|
|
5160
|
-
200 * (y
|
|
5159
|
+
116 * y - 16,
|
|
5160
|
+
500 * (x - y),
|
|
5161
|
+
200 * (y - z)
|
|
5161
5162
|
];
|
|
5162
5163
|
};
|
|
5163
5164
|
convert$1.lab.xyz = function(lab) {
|
|
@@ -5165,23 +5166,23 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5165
5166
|
const a = lab[1];
|
|
5166
5167
|
const b = lab[2];
|
|
5167
5168
|
let x;
|
|
5168
|
-
let y
|
|
5169
|
+
let y;
|
|
5169
5170
|
let z;
|
|
5170
|
-
y
|
|
5171
|
-
x = a / 500 + y
|
|
5172
|
-
z = y
|
|
5173
|
-
const y2 = y
|
|
5171
|
+
y = (l + 16) / 116;
|
|
5172
|
+
x = a / 500 + y;
|
|
5173
|
+
z = y - b / 200;
|
|
5174
|
+
const y2 = y ** 3;
|
|
5174
5175
|
const x2 = x ** 3;
|
|
5175
5176
|
const z2 = z ** 3;
|
|
5176
|
-
y
|
|
5177
|
+
y = y2 > .008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
5177
5178
|
x = x2 > .008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
5178
5179
|
z = z2 > .008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
5179
5180
|
x *= 95.047;
|
|
5180
|
-
y
|
|
5181
|
+
y *= 100;
|
|
5181
5182
|
z *= 108.883;
|
|
5182
5183
|
return [
|
|
5183
5184
|
x,
|
|
5184
|
-
y
|
|
5185
|
+
y,
|
|
5185
5186
|
z
|
|
5186
5187
|
];
|
|
5187
5188
|
};
|
|
@@ -5189,13 +5190,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5189
5190
|
const l = lab[0];
|
|
5190
5191
|
const a = lab[1];
|
|
5191
5192
|
const b = lab[2];
|
|
5192
|
-
let h
|
|
5193
|
-
h
|
|
5194
|
-
if (h
|
|
5193
|
+
let h;
|
|
5194
|
+
h = Math.atan2(b, a) * 360 / 2 / Math.PI;
|
|
5195
|
+
if (h < 0) h += 360;
|
|
5195
5196
|
return [
|
|
5196
5197
|
l,
|
|
5197
5198
|
Math.sqrt(a * a + b * b),
|
|
5198
|
-
h
|
|
5199
|
+
h
|
|
5199
5200
|
];
|
|
5200
5201
|
};
|
|
5201
5202
|
convert$1.lch.lab = function(lch) {
|
|
@@ -5271,14 +5272,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5271
5272
|
return "000000".substring(string.length) + string;
|
|
5272
5273
|
};
|
|
5273
5274
|
convert$1.hex.rgb = function(args) {
|
|
5274
|
-
const match
|
|
5275
|
-
if (!match
|
|
5275
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
5276
|
+
if (!match) return [
|
|
5276
5277
|
0,
|
|
5277
5278
|
0,
|
|
5278
5279
|
0
|
|
5279
5280
|
];
|
|
5280
|
-
let colorString = match
|
|
5281
|
-
if (match
|
|
5281
|
+
let colorString = match[0];
|
|
5282
|
+
if (match[0].length === 3) colorString = colorString.split("").map((char) => {
|
|
5282
5283
|
return char + char;
|
|
5283
5284
|
}).join("");
|
|
5284
5285
|
const integer = parseInt(colorString, 16);
|
|
@@ -5312,9 +5313,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5312
5313
|
];
|
|
5313
5314
|
};
|
|
5314
5315
|
convert$1.hsl.hcg = function(hsl) {
|
|
5315
|
-
const s
|
|
5316
|
+
const s = hsl[1] / 100;
|
|
5316
5317
|
const l = hsl[2] / 100;
|
|
5317
|
-
const c = l < .5 ? 2 * s
|
|
5318
|
+
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
5318
5319
|
let f = 0;
|
|
5319
5320
|
if (c < 1) f = (l - .5 * c) / (1 - c);
|
|
5320
5321
|
return [
|
|
@@ -5324,9 +5325,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5324
5325
|
];
|
|
5325
5326
|
};
|
|
5326
5327
|
convert$1.hsv.hcg = function(hsv) {
|
|
5327
|
-
const s
|
|
5328
|
+
const s = hsv[1] / 100;
|
|
5328
5329
|
const v = hsv[2] / 100;
|
|
5329
|
-
const c = s
|
|
5330
|
+
const c = s * v;
|
|
5330
5331
|
let f = 0;
|
|
5331
5332
|
if (c < 1) f = (v - c) / (1 - c);
|
|
5332
5333
|
return [
|
|
@@ -5336,7 +5337,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5336
5337
|
];
|
|
5337
5338
|
};
|
|
5338
5339
|
convert$1.hcg.rgb = function(hcg) {
|
|
5339
|
-
const h
|
|
5340
|
+
const h = hcg[0] / 360;
|
|
5340
5341
|
const c = hcg[1] / 100;
|
|
5341
5342
|
const g = hcg[2] / 100;
|
|
5342
5343
|
if (c === 0) return [
|
|
@@ -5349,9 +5350,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5349
5350
|
0,
|
|
5350
5351
|
0
|
|
5351
5352
|
];
|
|
5352
|
-
const hi = h
|
|
5353
|
+
const hi = h % 1 * 6;
|
|
5353
5354
|
const v = hi % 1;
|
|
5354
|
-
const w
|
|
5355
|
+
const w = 1 - v;
|
|
5355
5356
|
let mg = 0;
|
|
5356
5357
|
switch (Math.floor(hi)) {
|
|
5357
5358
|
case 0:
|
|
@@ -5360,7 +5361,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5360
5361
|
pure[2] = 0;
|
|
5361
5362
|
break;
|
|
5362
5363
|
case 1:
|
|
5363
|
-
pure[0] = w
|
|
5364
|
+
pure[0] = w;
|
|
5364
5365
|
pure[1] = 1;
|
|
5365
5366
|
pure[2] = 0;
|
|
5366
5367
|
break;
|
|
@@ -5371,7 +5372,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5371
5372
|
break;
|
|
5372
5373
|
case 3:
|
|
5373
5374
|
pure[0] = 0;
|
|
5374
|
-
pure[1] = w
|
|
5375
|
+
pure[1] = w;
|
|
5375
5376
|
pure[2] = 1;
|
|
5376
5377
|
break;
|
|
5377
5378
|
case 4:
|
|
@@ -5382,7 +5383,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5382
5383
|
default:
|
|
5383
5384
|
pure[0] = 1;
|
|
5384
5385
|
pure[1] = 0;
|
|
5385
|
-
pure[2] = w
|
|
5386
|
+
pure[2] = w;
|
|
5386
5387
|
}
|
|
5387
5388
|
mg = (1 - c) * g;
|
|
5388
5389
|
return [
|
|
@@ -5405,12 +5406,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5405
5406
|
convert$1.hcg.hsl = function(hcg) {
|
|
5406
5407
|
const c = hcg[1] / 100;
|
|
5407
5408
|
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
5408
|
-
let s
|
|
5409
|
-
if (l > 0 && l < .5) s
|
|
5410
|
-
else if (l >= .5 && l < 1) s
|
|
5409
|
+
let s = 0;
|
|
5410
|
+
if (l > 0 && l < .5) s = c / (2 * l);
|
|
5411
|
+
else if (l >= .5 && l < 1) s = c / (2 * (1 - l));
|
|
5411
5412
|
return [
|
|
5412
5413
|
hcg[0],
|
|
5413
|
-
s
|
|
5414
|
+
s * 100,
|
|
5414
5415
|
l * 100
|
|
5415
5416
|
];
|
|
5416
5417
|
};
|
|
@@ -5424,9 +5425,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5424
5425
|
];
|
|
5425
5426
|
};
|
|
5426
5427
|
convert$1.hwb.hcg = function(hwb) {
|
|
5427
|
-
const w
|
|
5428
|
+
const w = hwb[1] / 100;
|
|
5428
5429
|
const v = 1 - hwb[2] / 100;
|
|
5429
|
-
const c = v - w
|
|
5430
|
+
const c = v - w;
|
|
5430
5431
|
let g = 0;
|
|
5431
5432
|
if (c < 1) g = (v - c) / (1 - c);
|
|
5432
5433
|
return [
|
|
@@ -5496,8 +5497,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5496
5497
|
};
|
|
5497
5498
|
function buildGraph() {
|
|
5498
5499
|
const graph = {};
|
|
5499
|
-
const models
|
|
5500
|
-
for (let len = models
|
|
5500
|
+
const models = Object.keys(conversions);
|
|
5501
|
+
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
5501
5502
|
distance: -1,
|
|
5502
5503
|
parent: null
|
|
5503
5504
|
};
|
|
@@ -5512,10 +5513,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5512
5513
|
const adjacents = Object.keys(conversions[current]);
|
|
5513
5514
|
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
5514
5515
|
const adjacent = adjacents[i];
|
|
5515
|
-
const node
|
|
5516
|
-
if (node
|
|
5517
|
-
node
|
|
5518
|
-
node
|
|
5516
|
+
const node = graph[adjacent];
|
|
5517
|
+
if (node.distance === -1) {
|
|
5518
|
+
node.distance = graph[current].distance + 1;
|
|
5519
|
+
node.parent = current;
|
|
5519
5520
|
queue.unshift(adjacent);
|
|
5520
5521
|
}
|
|
5521
5522
|
}
|
|
@@ -5528,23 +5529,23 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5528
5529
|
};
|
|
5529
5530
|
}
|
|
5530
5531
|
function wrapConversion(toModel, graph) {
|
|
5531
|
-
const path$
|
|
5532
|
+
const path$2 = [graph[toModel].parent, toModel];
|
|
5532
5533
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
5533
5534
|
let cur = graph[toModel].parent;
|
|
5534
5535
|
while (graph[cur].parent) {
|
|
5535
|
-
path$
|
|
5536
|
+
path$2.unshift(graph[cur].parent);
|
|
5536
5537
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
5537
5538
|
cur = graph[cur].parent;
|
|
5538
5539
|
}
|
|
5539
|
-
fn.conversion = path$
|
|
5540
|
+
fn.conversion = path$2;
|
|
5540
5541
|
return fn;
|
|
5541
5542
|
}
|
|
5542
5543
|
var route = function(fromModel) {
|
|
5543
5544
|
const graph = deriveBFS(fromModel);
|
|
5544
5545
|
const conversion = {};
|
|
5545
|
-
const models
|
|
5546
|
-
for (let len = models
|
|
5547
|
-
const toModel = models
|
|
5546
|
+
const models = Object.keys(graph);
|
|
5547
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
5548
|
+
const toModel = models[i];
|
|
5548
5549
|
if (graph[toModel].parent === null) continue;
|
|
5549
5550
|
conversion[toModel] = wrapConversion(toModel, graph);
|
|
5550
5551
|
}
|
|
@@ -5624,17 +5625,17 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5624
5625
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
5625
5626
|
if (colorConvert$1 === void 0) colorConvert$1 = colorConvert;
|
|
5626
5627
|
const offset = isBackground ? 10 : 0;
|
|
5627
|
-
const styles
|
|
5628
|
+
const styles = {};
|
|
5628
5629
|
for (const [sourceSpace, suite] of Object.entries(colorConvert$1)) {
|
|
5629
5630
|
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
5630
|
-
if (sourceSpace === targetSpace) styles
|
|
5631
|
-
else if (typeof suite === "object") styles
|
|
5631
|
+
if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
|
|
5632
|
+
else if (typeof suite === "object") styles[name] = wrap(suite[targetSpace], offset);
|
|
5632
5633
|
}
|
|
5633
|
-
return styles
|
|
5634
|
+
return styles;
|
|
5634
5635
|
};
|
|
5635
5636
|
function assembleStyles() {
|
|
5636
5637
|
const codes = /* @__PURE__ */ new Map();
|
|
5637
|
-
const styles
|
|
5638
|
+
const styles = {
|
|
5638
5639
|
modifier: {
|
|
5639
5640
|
reset: [0, 0],
|
|
5640
5641
|
bold: [1, 22],
|
|
@@ -5682,37 +5683,37 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5682
5683
|
bgWhiteBright: [107, 49]
|
|
5683
5684
|
}
|
|
5684
5685
|
};
|
|
5685
|
-
styles
|
|
5686
|
-
styles
|
|
5687
|
-
styles
|
|
5688
|
-
styles
|
|
5689
|
-
for (const [groupName, group] of Object.entries(styles
|
|
5686
|
+
styles.color.gray = styles.color.blackBright;
|
|
5687
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
5688
|
+
styles.color.grey = styles.color.blackBright;
|
|
5689
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
5690
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
5690
5691
|
for (const [styleName, style] of Object.entries(group)) {
|
|
5691
|
-
styles
|
|
5692
|
+
styles[styleName] = {
|
|
5692
5693
|
open: `\u001B[${style[0]}m`,
|
|
5693
5694
|
close: `\u001B[${style[1]}m`
|
|
5694
5695
|
};
|
|
5695
|
-
group[styleName] = styles
|
|
5696
|
+
group[styleName] = styles[styleName];
|
|
5696
5697
|
codes.set(style[0], style[1]);
|
|
5697
5698
|
}
|
|
5698
|
-
Object.defineProperty(styles
|
|
5699
|
+
Object.defineProperty(styles, groupName, {
|
|
5699
5700
|
value: group,
|
|
5700
5701
|
enumerable: false
|
|
5701
5702
|
});
|
|
5702
5703
|
}
|
|
5703
|
-
Object.defineProperty(styles
|
|
5704
|
+
Object.defineProperty(styles, "codes", {
|
|
5704
5705
|
value: codes,
|
|
5705
5706
|
enumerable: false
|
|
5706
5707
|
});
|
|
5707
|
-
styles
|
|
5708
|
-
styles
|
|
5709
|
-
setLazyProperty(styles
|
|
5710
|
-
setLazyProperty(styles
|
|
5711
|
-
setLazyProperty(styles
|
|
5712
|
-
setLazyProperty(styles
|
|
5713
|
-
setLazyProperty(styles
|
|
5714
|
-
setLazyProperty(styles
|
|
5715
|
-
return styles
|
|
5708
|
+
styles.color.close = "\x1B[39m";
|
|
5709
|
+
styles.bgColor.close = "\x1B[49m";
|
|
5710
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
5711
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
5712
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
5713
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
5714
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
5715
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
5716
|
+
return styles;
|
|
5716
5717
|
}
|
|
5717
5718
|
Object.defineProperty(module$1, "exports", {
|
|
5718
5719
|
enumerable: true,
|
|
@@ -5767,9 +5768,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5767
5768
|
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
5768
5769
|
if (env.COLORTERM === "truecolor") return 3;
|
|
5769
5770
|
if ("TERM_PROGRAM" in env) {
|
|
5770
|
-
const version
|
|
5771
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
5771
5772
|
switch (env.TERM_PROGRAM) {
|
|
5772
|
-
case "iTerm.app": return version
|
|
5773
|
+
case "iTerm.app": return version >= 3 ? 3 : 2;
|
|
5773
5774
|
case "Apple_Terminal": return 2;
|
|
5774
5775
|
}
|
|
5775
5776
|
}
|
|
@@ -5787,28 +5788,28 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5787
5788
|
stderr: translateLevel(supportsColor(true, tty__default["default"].isatty(2)))
|
|
5788
5789
|
};
|
|
5789
5790
|
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
5790
|
-
let index
|
|
5791
|
-
if (index
|
|
5791
|
+
let index = string.indexOf(substring);
|
|
5792
|
+
if (index === -1) return string;
|
|
5792
5793
|
const substringLength = substring.length;
|
|
5793
5794
|
let endIndex = 0;
|
|
5794
5795
|
let returnValue = "";
|
|
5795
5796
|
do {
|
|
5796
|
-
returnValue += string.substr(endIndex, index
|
|
5797
|
-
endIndex = index
|
|
5798
|
-
index
|
|
5799
|
-
} while (index
|
|
5797
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
5798
|
+
endIndex = index + substringLength;
|
|
5799
|
+
index = string.indexOf(substring, endIndex);
|
|
5800
|
+
} while (index !== -1);
|
|
5800
5801
|
returnValue += string.substr(endIndex);
|
|
5801
5802
|
return returnValue;
|
|
5802
5803
|
};
|
|
5803
|
-
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index
|
|
5804
|
+
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
5804
5805
|
let endIndex = 0;
|
|
5805
5806
|
let returnValue = "";
|
|
5806
5807
|
do {
|
|
5807
|
-
const gotCR = string[index
|
|
5808
|
-
returnValue += string.substr(endIndex, (gotCR ? index
|
|
5809
|
-
endIndex = index
|
|
5810
|
-
index
|
|
5811
|
-
} while (index
|
|
5808
|
+
const gotCR = string[index - 1] === "\r";
|
|
5809
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
5810
|
+
endIndex = index + 1;
|
|
5811
|
+
index = string.indexOf("\n", endIndex);
|
|
5812
|
+
} while (index !== -1);
|
|
5812
5813
|
returnValue += string.substr(endIndex);
|
|
5813
5814
|
return returnValue;
|
|
5814
5815
|
};
|
|
@@ -5846,7 +5847,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5846
5847
|
for (const chunk of chunks) {
|
|
5847
5848
|
const number = Number(chunk);
|
|
5848
5849
|
if (!Number.isNaN(number)) results.push(number);
|
|
5849
|
-
else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m
|
|
5850
|
+
else if (matches = chunk.match(STRING_REGEX)) results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
5850
5851
|
else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
5851
5852
|
}
|
|
5852
5853
|
return results;
|
|
@@ -5864,41 +5865,41 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5864
5865
|
}
|
|
5865
5866
|
return results;
|
|
5866
5867
|
}
|
|
5867
|
-
function buildStyle(chalk
|
|
5868
|
+
function buildStyle(chalk, styles) {
|
|
5868
5869
|
const enabled = {};
|
|
5869
|
-
for (const layer of styles
|
|
5870
|
-
let current = chalk
|
|
5871
|
-
for (const [styleName, styles$
|
|
5872
|
-
if (!Array.isArray(styles$
|
|
5870
|
+
for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
5871
|
+
let current = chalk;
|
|
5872
|
+
for (const [styleName, styles$1] of Object.entries(enabled)) {
|
|
5873
|
+
if (!Array.isArray(styles$1)) continue;
|
|
5873
5874
|
if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
5874
|
-
current = styles$
|
|
5875
|
+
current = styles$1.length > 0 ? current[styleName](...styles$1) : current[styleName];
|
|
5875
5876
|
}
|
|
5876
5877
|
return current;
|
|
5877
5878
|
}
|
|
5878
|
-
var templates = (chalk
|
|
5879
|
-
const styles
|
|
5879
|
+
var templates = (chalk, temporary) => {
|
|
5880
|
+
const styles = [];
|
|
5880
5881
|
const chunks = [];
|
|
5881
5882
|
let chunk = [];
|
|
5882
|
-
temporary.replace(TEMPLATE_REGEX, (m
|
|
5883
|
+
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
5883
5884
|
if (escapeCharacter) chunk.push(unescape(escapeCharacter));
|
|
5884
5885
|
else if (style) {
|
|
5885
5886
|
const string = chunk.join("");
|
|
5886
5887
|
chunk = [];
|
|
5887
|
-
chunks.push(styles
|
|
5888
|
-
styles
|
|
5888
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
5889
|
+
styles.push({
|
|
5889
5890
|
inverse,
|
|
5890
5891
|
styles: parseStyle(style)
|
|
5891
5892
|
});
|
|
5892
5893
|
} else if (close) {
|
|
5893
|
-
if (styles
|
|
5894
|
-
chunks.push(buildStyle(chalk
|
|
5894
|
+
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
5895
|
+
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
5895
5896
|
chunk = [];
|
|
5896
|
-
styles
|
|
5897
|
+
styles.pop();
|
|
5897
5898
|
} else chunk.push(character);
|
|
5898
5899
|
});
|
|
5899
5900
|
chunks.push(chunk.join(""));
|
|
5900
|
-
if (styles
|
|
5901
|
-
const errMessage = `Chalk template literal is missing ${styles
|
|
5901
|
+
if (styles.length > 0) {
|
|
5902
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
5902
5903
|
throw new Error(errMessage);
|
|
5903
5904
|
}
|
|
5904
5905
|
return chunks.join("");
|
|
@@ -5924,16 +5925,16 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
5924
5925
|
}
|
|
5925
5926
|
};
|
|
5926
5927
|
const chalkFactory = (options) => {
|
|
5927
|
-
const chalk
|
|
5928
|
-
applyOptions(chalk
|
|
5929
|
-
chalk
|
|
5930
|
-
Object.setPrototypeOf(chalk
|
|
5931
|
-
Object.setPrototypeOf(chalk
|
|
5932
|
-
chalk
|
|
5928
|
+
const chalk = {};
|
|
5929
|
+
applyOptions(chalk, options);
|
|
5930
|
+
chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
|
|
5931
|
+
Object.setPrototypeOf(chalk, Chalk.prototype);
|
|
5932
|
+
Object.setPrototypeOf(chalk.template, chalk);
|
|
5933
|
+
chalk.template.constructor = () => {
|
|
5933
5934
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
5934
5935
|
};
|
|
5935
|
-
chalk
|
|
5936
|
-
return chalk
|
|
5936
|
+
chalk.template.Instance = ChalkClass;
|
|
5937
|
+
return chalk.template;
|
|
5937
5938
|
};
|
|
5938
5939
|
function Chalk(options) {
|
|
5939
5940
|
return chalkFactory(options);
|
|
@@ -6030,14 +6031,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6030
6031
|
return openAll + string + closeAll;
|
|
6031
6032
|
};
|
|
6032
6033
|
let template;
|
|
6033
|
-
const chalkTag = (chalk
|
|
6034
|
+
const chalkTag = (chalk, ...strings) => {
|
|
6034
6035
|
const [firstString] = strings;
|
|
6035
6036
|
if (!isArray$1(firstString) || !isArray$1(firstString.raw)) return strings.join(" ");
|
|
6036
6037
|
const arguments_ = strings.slice(1);
|
|
6037
6038
|
const parts = [firstString.raw[0]];
|
|
6038
6039
|
for (let i = 1; i < firstString.length; i++) parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
|
|
6039
6040
|
if (template === void 0) template = templates;
|
|
6040
|
-
return template(chalk
|
|
6041
|
+
return template(chalk, parts.join(""));
|
|
6041
6042
|
};
|
|
6042
6043
|
Object.defineProperties(Chalk.prototype, styles);
|
|
6043
6044
|
const chalk = Chalk();
|
|
@@ -6056,19 +6057,19 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6056
6057
|
return copy;
|
|
6057
6058
|
}
|
|
6058
6059
|
var origCwd = process.cwd;
|
|
6059
|
-
var cwd
|
|
6060
|
+
var cwd = null;
|
|
6060
6061
|
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
6061
6062
|
process.cwd = function() {
|
|
6062
|
-
if (!cwd
|
|
6063
|
-
return cwd
|
|
6063
|
+
if (!cwd) cwd = origCwd.call(process);
|
|
6064
|
+
return cwd;
|
|
6064
6065
|
};
|
|
6065
6066
|
try {
|
|
6066
6067
|
process.cwd();
|
|
6067
6068
|
} catch (er) {}
|
|
6068
6069
|
var chdir = process.chdir;
|
|
6069
|
-
process.chdir = function(d
|
|
6070
|
-
cwd
|
|
6071
|
-
chdir.call(process, d
|
|
6070
|
+
process.chdir = function(d) {
|
|
6071
|
+
cwd = null;
|
|
6072
|
+
chdir.call(process, d);
|
|
6072
6073
|
};
|
|
6073
6074
|
var polyfills = patch;
|
|
6074
6075
|
function patch(fs$2) {
|
|
@@ -6093,13 +6094,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6093
6094
|
fs$2.fstatSync = statFixSync(fs$2.fstatSync);
|
|
6094
6095
|
fs$2.lstatSync = statFixSync(fs$2.lstatSync);
|
|
6095
6096
|
if (!fs$2.lchmod) {
|
|
6096
|
-
fs$2.lchmod = function(path$
|
|
6097
|
+
fs$2.lchmod = function(path$2, mode, cb) {
|
|
6097
6098
|
if (cb) process.nextTick(cb);
|
|
6098
6099
|
};
|
|
6099
6100
|
fs$2.lchmodSync = function() {};
|
|
6100
6101
|
}
|
|
6101
6102
|
if (!fs$2.lchown) {
|
|
6102
|
-
fs$2.lchown = function(path$
|
|
6103
|
+
fs$2.lchown = function(path$2, uid, gid, cb) {
|
|
6103
6104
|
if (cb) process.nextTick(cb);
|
|
6104
6105
|
};
|
|
6105
6106
|
fs$2.lchownSync = function() {};
|
|
@@ -6155,8 +6156,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6155
6156
|
})(fs$2.readSync);
|
|
6156
6157
|
}
|
|
6157
6158
|
function patchLchmod(fs$2) {
|
|
6158
|
-
fs$2.lchmod = function(path$
|
|
6159
|
-
fs$2.open(path$
|
|
6159
|
+
fs$2.lchmod = function(path$2, mode, callback) {
|
|
6160
|
+
fs$2.open(path$2, constants__default["default"].O_WRONLY | constants__default["default"].O_SYMLINK, mode, function(err, fd) {
|
|
6160
6161
|
if (err) {
|
|
6161
6162
|
if (callback) callback(err);
|
|
6162
6163
|
return;
|
|
@@ -6168,8 +6169,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6168
6169
|
});
|
|
6169
6170
|
});
|
|
6170
6171
|
};
|
|
6171
|
-
fs$2.lchmodSync = function(path$
|
|
6172
|
-
var fd = fs$2.openSync(path$
|
|
6172
|
+
fs$2.lchmodSync = function(path$2, mode) {
|
|
6173
|
+
var fd = fs$2.openSync(path$2, constants__default["default"].O_WRONLY | constants__default["default"].O_SYMLINK, mode);
|
|
6173
6174
|
var threw = true;
|
|
6174
6175
|
var ret;
|
|
6175
6176
|
try {
|
|
@@ -6186,8 +6187,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6186
6187
|
}
|
|
6187
6188
|
function patchLutimes(fs$2) {
|
|
6188
6189
|
if (constants__default["default"].hasOwnProperty("O_SYMLINK")) {
|
|
6189
|
-
fs$2.lutimes = function(path$
|
|
6190
|
-
fs$2.open(path$
|
|
6190
|
+
fs$2.lutimes = function(path$2, at, mt, cb) {
|
|
6191
|
+
fs$2.open(path$2, constants__default["default"].O_SYMLINK, function(er, fd) {
|
|
6191
6192
|
if (er) {
|
|
6192
6193
|
if (cb) cb(er);
|
|
6193
6194
|
return;
|
|
@@ -6199,8 +6200,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6199
6200
|
});
|
|
6200
6201
|
});
|
|
6201
6202
|
};
|
|
6202
|
-
fs$2.lutimesSync = function(path$
|
|
6203
|
-
var fd = fs$2.openSync(path$
|
|
6203
|
+
fs$2.lutimesSync = function(path$2, at, mt) {
|
|
6204
|
+
var fd = fs$2.openSync(path$2, constants__default["default"].O_SYMLINK);
|
|
6204
6205
|
var ret;
|
|
6205
6206
|
var threw = true;
|
|
6206
6207
|
try {
|
|
@@ -6287,18 +6288,18 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6287
6288
|
}
|
|
6288
6289
|
return false;
|
|
6289
6290
|
}
|
|
6290
|
-
var Stream
|
|
6291
|
+
var Stream = Stream__default["default"].Stream;
|
|
6291
6292
|
var legacyStreams = legacy;
|
|
6292
6293
|
function legacy(fs$2) {
|
|
6293
6294
|
return {
|
|
6294
|
-
ReadStream
|
|
6295
|
-
WriteStream
|
|
6295
|
+
ReadStream,
|
|
6296
|
+
WriteStream
|
|
6296
6297
|
};
|
|
6297
|
-
function ReadStream
|
|
6298
|
-
if (!(this instanceof ReadStream
|
|
6299
|
-
Stream
|
|
6298
|
+
function ReadStream(path$2, options) {
|
|
6299
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path$2, options);
|
|
6300
|
+
Stream.call(this);
|
|
6300
6301
|
var self$1 = this;
|
|
6301
|
-
this.path = path$
|
|
6302
|
+
this.path = path$2;
|
|
6302
6303
|
this.fd = null;
|
|
6303
6304
|
this.readable = true;
|
|
6304
6305
|
this.paused = false;
|
|
@@ -6307,8 +6308,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6307
6308
|
this.bufferSize = 64 * 1024;
|
|
6308
6309
|
options = options || {};
|
|
6309
6310
|
var keys = Object.keys(options);
|
|
6310
|
-
for (var index
|
|
6311
|
-
var key = keys[index
|
|
6311
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
6312
|
+
var key = keys[index];
|
|
6312
6313
|
this[key] = options[key];
|
|
6313
6314
|
}
|
|
6314
6315
|
if (this.encoding) this.setEncoding(this.encoding);
|
|
@@ -6336,10 +6337,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6336
6337
|
self$1._read();
|
|
6337
6338
|
});
|
|
6338
6339
|
}
|
|
6339
|
-
function WriteStream
|
|
6340
|
-
if (!(this instanceof WriteStream
|
|
6341
|
-
Stream
|
|
6342
|
-
this.path = path$
|
|
6340
|
+
function WriteStream(path$2, options) {
|
|
6341
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path$2, options);
|
|
6342
|
+
Stream.call(this);
|
|
6343
|
+
this.path = path$2;
|
|
6343
6344
|
this.fd = null;
|
|
6344
6345
|
this.writable = true;
|
|
6345
6346
|
this.flags = "w";
|
|
@@ -6348,8 +6349,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6348
6349
|
this.bytesWritten = 0;
|
|
6349
6350
|
options = options || {};
|
|
6350
6351
|
var keys = Object.keys(options);
|
|
6351
|
-
for (var index
|
|
6352
|
-
var key = keys[index
|
|
6352
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
6353
|
+
var key = keys[index];
|
|
6353
6354
|
this[key] = options[key];
|
|
6354
6355
|
}
|
|
6355
6356
|
if (this.start !== void 0) {
|
|
@@ -6374,20 +6375,20 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6374
6375
|
}
|
|
6375
6376
|
var gracefulFs = createCommonjsModule(function(module$1) {
|
|
6376
6377
|
var queue = [];
|
|
6377
|
-
function noop
|
|
6378
|
-
var debug
|
|
6379
|
-
if (util__default["default"].debuglog) debug
|
|
6380
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug
|
|
6381
|
-
var m
|
|
6382
|
-
m
|
|
6383
|
-
console.error(m
|
|
6378
|
+
function noop() {}
|
|
6379
|
+
var debug = noop;
|
|
6380
|
+
if (util__default["default"].debuglog) debug = util__default["default"].debuglog("gfs4");
|
|
6381
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function() {
|
|
6382
|
+
var m = util__default["default"].format.apply(util__default["default"], arguments);
|
|
6383
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
6384
|
+
console.error(m);
|
|
6384
6385
|
};
|
|
6385
6386
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
6386
|
-
debug
|
|
6387
|
+
debug(queue);
|
|
6387
6388
|
assert__default["default"].equal(queue.length, 0);
|
|
6388
6389
|
});
|
|
6389
|
-
module$1.exports = patch
|
|
6390
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) module$1.exports = patch
|
|
6390
|
+
module$1.exports = patch(fs_1);
|
|
6391
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) module$1.exports = patch(fs__default["default"]);
|
|
6391
6392
|
module$1.exports.close = fs__default["default"].close = (function(fs$close) {
|
|
6392
6393
|
return function(fd, cb) {
|
|
6393
6394
|
return fs$close.call(fs__default["default"], fd, function(err) {
|
|
@@ -6403,22 +6404,22 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6403
6404
|
return rval;
|
|
6404
6405
|
};
|
|
6405
6406
|
})(fs__default["default"].closeSync);
|
|
6406
|
-
function patch
|
|
6407
|
+
function patch(fs$2) {
|
|
6407
6408
|
polyfills(fs$2);
|
|
6408
|
-
fs$2.gracefulify = patch
|
|
6409
|
-
fs$2.FileReadStream = ReadStream
|
|
6410
|
-
fs$2.FileWriteStream = WriteStream
|
|
6409
|
+
fs$2.gracefulify = patch;
|
|
6410
|
+
fs$2.FileReadStream = ReadStream;
|
|
6411
|
+
fs$2.FileWriteStream = WriteStream;
|
|
6411
6412
|
fs$2.createReadStream = createReadStream;
|
|
6412
6413
|
fs$2.createWriteStream = createWriteStream;
|
|
6413
6414
|
var fs$readFile = fs$2.readFile;
|
|
6414
6415
|
fs$2.readFile = readFile;
|
|
6415
|
-
function readFile(path$
|
|
6416
|
+
function readFile(path$2, options, cb) {
|
|
6416
6417
|
if (typeof options === "function") cb = options, options = null;
|
|
6417
|
-
return go$readFile(path$
|
|
6418
|
-
function go$readFile(path$
|
|
6419
|
-
return fs$readFile(path$
|
|
6418
|
+
return go$readFile(path$2, options, cb);
|
|
6419
|
+
function go$readFile(path$3, options$1, cb$1) {
|
|
6420
|
+
return fs$readFile(path$3, options$1, function(err) {
|
|
6420
6421
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$readFile, [
|
|
6421
|
-
path$
|
|
6422
|
+
path$3,
|
|
6422
6423
|
options$1,
|
|
6423
6424
|
cb$1
|
|
6424
6425
|
]]);
|
|
@@ -6431,13 +6432,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6431
6432
|
}
|
|
6432
6433
|
var fs$writeFile = fs$2.writeFile;
|
|
6433
6434
|
fs$2.writeFile = writeFile;
|
|
6434
|
-
function writeFile(path$
|
|
6435
|
+
function writeFile(path$2, data, options, cb) {
|
|
6435
6436
|
if (typeof options === "function") cb = options, options = null;
|
|
6436
|
-
return go$writeFile(path$
|
|
6437
|
-
function go$writeFile(path$
|
|
6438
|
-
return fs$writeFile(path$
|
|
6437
|
+
return go$writeFile(path$2, data, options, cb);
|
|
6438
|
+
function go$writeFile(path$3, data$1, options$1, cb$1) {
|
|
6439
|
+
return fs$writeFile(path$3, data$1, options$1, function(err) {
|
|
6439
6440
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$writeFile, [
|
|
6440
|
-
path$
|
|
6441
|
+
path$3,
|
|
6441
6442
|
data$1,
|
|
6442
6443
|
options$1,
|
|
6443
6444
|
cb$1
|
|
@@ -6451,13 +6452,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6451
6452
|
}
|
|
6452
6453
|
var fs$appendFile = fs$2.appendFile;
|
|
6453
6454
|
if (fs$appendFile) fs$2.appendFile = appendFile;
|
|
6454
|
-
function appendFile(path$
|
|
6455
|
+
function appendFile(path$2, data, options, cb) {
|
|
6455
6456
|
if (typeof options === "function") cb = options, options = null;
|
|
6456
|
-
return go$appendFile(path$
|
|
6457
|
-
function go$appendFile(path$
|
|
6458
|
-
return fs$appendFile(path$
|
|
6457
|
+
return go$appendFile(path$2, data, options, cb);
|
|
6458
|
+
function go$appendFile(path$3, data$1, options$1, cb$1) {
|
|
6459
|
+
return fs$appendFile(path$3, data$1, options$1, function(err) {
|
|
6459
6460
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$appendFile, [
|
|
6460
|
-
path$
|
|
6461
|
+
path$3,
|
|
6461
6462
|
data$1,
|
|
6462
6463
|
options$1,
|
|
6463
6464
|
cb$1
|
|
@@ -6470,9 +6471,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6470
6471
|
}
|
|
6471
6472
|
}
|
|
6472
6473
|
var fs$readdir = fs$2.readdir;
|
|
6473
|
-
fs$2.readdir = readdir
|
|
6474
|
-
function readdir
|
|
6475
|
-
var args = [path$
|
|
6474
|
+
fs$2.readdir = readdir;
|
|
6475
|
+
function readdir(path$2, options, cb) {
|
|
6476
|
+
var args = [path$2];
|
|
6476
6477
|
if (typeof options !== "function") args.push(options);
|
|
6477
6478
|
else cb = options;
|
|
6478
6479
|
args.push(go$readdir$cb);
|
|
@@ -6491,20 +6492,20 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6491
6492
|
}
|
|
6492
6493
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
6493
6494
|
var legStreams = legacyStreams(fs$2);
|
|
6494
|
-
ReadStream
|
|
6495
|
-
WriteStream
|
|
6495
|
+
ReadStream = legStreams.ReadStream;
|
|
6496
|
+
WriteStream = legStreams.WriteStream;
|
|
6496
6497
|
}
|
|
6497
6498
|
var fs$ReadStream = fs$2.ReadStream;
|
|
6498
|
-
ReadStream
|
|
6499
|
-
ReadStream
|
|
6499
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
6500
|
+
ReadStream.prototype.open = ReadStream$open;
|
|
6500
6501
|
var fs$WriteStream = fs$2.WriteStream;
|
|
6501
|
-
WriteStream
|
|
6502
|
-
WriteStream
|
|
6503
|
-
fs$2.ReadStream = ReadStream
|
|
6504
|
-
fs$2.WriteStream = WriteStream
|
|
6505
|
-
function ReadStream
|
|
6506
|
-
if (this instanceof ReadStream
|
|
6507
|
-
else return ReadStream
|
|
6502
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
6503
|
+
WriteStream.prototype.open = WriteStream$open;
|
|
6504
|
+
fs$2.ReadStream = ReadStream;
|
|
6505
|
+
fs$2.WriteStream = WriteStream;
|
|
6506
|
+
function ReadStream(path$2, options) {
|
|
6507
|
+
if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
|
|
6508
|
+
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
6508
6509
|
}
|
|
6509
6510
|
function ReadStream$open() {
|
|
6510
6511
|
var that = this;
|
|
@@ -6519,9 +6520,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6519
6520
|
}
|
|
6520
6521
|
});
|
|
6521
6522
|
}
|
|
6522
|
-
function WriteStream
|
|
6523
|
-
if (this instanceof WriteStream
|
|
6524
|
-
else return WriteStream
|
|
6523
|
+
function WriteStream(path$2, options) {
|
|
6524
|
+
if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
|
|
6525
|
+
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
6525
6526
|
}
|
|
6526
6527
|
function WriteStream$open() {
|
|
6527
6528
|
var that = this;
|
|
@@ -6535,21 +6536,21 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6535
6536
|
}
|
|
6536
6537
|
});
|
|
6537
6538
|
}
|
|
6538
|
-
function createReadStream(path$
|
|
6539
|
-
return new ReadStream
|
|
6539
|
+
function createReadStream(path$2, options) {
|
|
6540
|
+
return new ReadStream(path$2, options);
|
|
6540
6541
|
}
|
|
6541
|
-
function createWriteStream(path$
|
|
6542
|
-
return new WriteStream
|
|
6542
|
+
function createWriteStream(path$2, options) {
|
|
6543
|
+
return new WriteStream(path$2, options);
|
|
6543
6544
|
}
|
|
6544
6545
|
var fs$open = fs$2.open;
|
|
6545
6546
|
fs$2.open = open;
|
|
6546
|
-
function open(path$
|
|
6547
|
+
function open(path$2, flags, mode, cb) {
|
|
6547
6548
|
if (typeof mode === "function") cb = mode, mode = null;
|
|
6548
|
-
return go$open(path$
|
|
6549
|
-
function go$open(path$
|
|
6550
|
-
return fs$open(path$
|
|
6549
|
+
return go$open(path$2, flags, mode, cb);
|
|
6550
|
+
function go$open(path$3, flags$1, mode$1, cb$1) {
|
|
6551
|
+
return fs$open(path$3, flags$1, mode$1, function(err, fd) {
|
|
6551
6552
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$open, [
|
|
6552
|
-
path$
|
|
6553
|
+
path$3,
|
|
6553
6554
|
flags$1,
|
|
6554
6555
|
mode$1,
|
|
6555
6556
|
cb$1
|
|
@@ -6564,13 +6565,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6564
6565
|
return fs$2;
|
|
6565
6566
|
}
|
|
6566
6567
|
function enqueue(elem) {
|
|
6567
|
-
debug
|
|
6568
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
6568
6569
|
queue.push(elem);
|
|
6569
6570
|
}
|
|
6570
6571
|
function retry() {
|
|
6571
6572
|
var elem = queue.shift();
|
|
6572
6573
|
if (elem) {
|
|
6573
|
-
debug
|
|
6574
|
+
debug("RETRY", elem[0].name, elem[1]);
|
|
6574
6575
|
elem[0].apply(null, elem[1]);
|
|
6575
6576
|
}
|
|
6576
6577
|
}
|
|
@@ -6609,7 +6610,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6609
6610
|
}
|
|
6610
6611
|
});
|
|
6611
6612
|
}
|
|
6612
|
-
mkdirP.sync = function sync
|
|
6613
|
+
mkdirP.sync = function sync(p, opts, made) {
|
|
6613
6614
|
if (!opts || typeof opts !== "object") opts = { mode: opts };
|
|
6614
6615
|
var mode = opts.mode;
|
|
6615
6616
|
var xfs = opts.fs || fs__default["default"];
|
|
@@ -6622,8 +6623,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6622
6623
|
} catch (err0) {
|
|
6623
6624
|
switch (err0.code) {
|
|
6624
6625
|
case "ENOENT":
|
|
6625
|
-
made = sync
|
|
6626
|
-
sync
|
|
6626
|
+
made = sync(path__default["default"].dirname(p), opts, made);
|
|
6627
|
+
sync(p, opts, made);
|
|
6627
6628
|
break;
|
|
6628
6629
|
default:
|
|
6629
6630
|
var stat;
|
|
@@ -6674,41 +6675,41 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6674
6675
|
if (isWindows$1) var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
|
|
6675
6676
|
else var splitRootRe = /^[\/]*/;
|
|
6676
6677
|
var old = {
|
|
6677
|
-
realpathSync: function realpathSync
|
|
6678
|
+
realpathSync: function realpathSync(p, cache) {
|
|
6678
6679
|
p = path__default["default"].resolve(p);
|
|
6679
6680
|
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) return cache[p];
|
|
6680
6681
|
var original = p, seenLinks = {}, knownHard = {};
|
|
6681
|
-
var pos
|
|
6682
|
+
var pos;
|
|
6682
6683
|
var current;
|
|
6683
|
-
var base
|
|
6684
|
+
var base;
|
|
6684
6685
|
var previous;
|
|
6685
6686
|
start();
|
|
6686
6687
|
function start() {
|
|
6687
|
-
var m
|
|
6688
|
-
pos
|
|
6689
|
-
current = m
|
|
6690
|
-
base
|
|
6688
|
+
var m = splitRootRe.exec(p);
|
|
6689
|
+
pos = m[0].length;
|
|
6690
|
+
current = m[0];
|
|
6691
|
+
base = m[0];
|
|
6691
6692
|
previous = "";
|
|
6692
|
-
if (isWindows$1 && !knownHard[base
|
|
6693
|
-
fs__default["default"].lstatSync(base
|
|
6694
|
-
knownHard[base
|
|
6693
|
+
if (isWindows$1 && !knownHard[base]) {
|
|
6694
|
+
fs__default["default"].lstatSync(base);
|
|
6695
|
+
knownHard[base] = true;
|
|
6695
6696
|
}
|
|
6696
6697
|
}
|
|
6697
|
-
while (pos
|
|
6698
|
-
nextPartRe.lastIndex = pos
|
|
6698
|
+
while (pos < p.length) {
|
|
6699
|
+
nextPartRe.lastIndex = pos;
|
|
6699
6700
|
var result = nextPartRe.exec(p);
|
|
6700
6701
|
previous = current;
|
|
6701
6702
|
current += result[0];
|
|
6702
|
-
base
|
|
6703
|
-
pos
|
|
6704
|
-
if (knownHard[base
|
|
6703
|
+
base = previous + result[1];
|
|
6704
|
+
pos = nextPartRe.lastIndex;
|
|
6705
|
+
if (knownHard[base] || cache && cache[base] === base) continue;
|
|
6705
6706
|
var resolvedLink;
|
|
6706
|
-
if (cache && Object.prototype.hasOwnProperty.call(cache, base
|
|
6707
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) resolvedLink = cache[base];
|
|
6707
6708
|
else {
|
|
6708
|
-
var stat = fs__default["default"].lstatSync(base
|
|
6709
|
+
var stat = fs__default["default"].lstatSync(base);
|
|
6709
6710
|
if (!stat.isSymbolicLink()) {
|
|
6710
|
-
knownHard[base
|
|
6711
|
-
if (cache) cache[base
|
|
6711
|
+
knownHard[base] = true;
|
|
6712
|
+
if (cache) cache[base] = base;
|
|
6712
6713
|
continue;
|
|
6713
6714
|
}
|
|
6714
6715
|
var linkTarget = null;
|
|
@@ -6717,20 +6718,20 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6717
6718
|
if (seenLinks.hasOwnProperty(id)) linkTarget = seenLinks[id];
|
|
6718
6719
|
}
|
|
6719
6720
|
if (linkTarget === null) {
|
|
6720
|
-
fs__default["default"].statSync(base
|
|
6721
|
-
linkTarget = fs__default["default"].readlinkSync(base
|
|
6721
|
+
fs__default["default"].statSync(base);
|
|
6722
|
+
linkTarget = fs__default["default"].readlinkSync(base);
|
|
6722
6723
|
}
|
|
6723
6724
|
resolvedLink = path__default["default"].resolve(previous, linkTarget);
|
|
6724
|
-
if (cache) cache[base
|
|
6725
|
+
if (cache) cache[base] = resolvedLink;
|
|
6725
6726
|
if (!isWindows$1) seenLinks[id] = linkTarget;
|
|
6726
6727
|
}
|
|
6727
|
-
p = path__default["default"].resolve(resolvedLink, p.slice(pos
|
|
6728
|
+
p = path__default["default"].resolve(resolvedLink, p.slice(pos));
|
|
6728
6729
|
start();
|
|
6729
6730
|
}
|
|
6730
6731
|
if (cache) cache[original] = p;
|
|
6731
6732
|
return p;
|
|
6732
6733
|
},
|
|
6733
|
-
realpath: function realpath
|
|
6734
|
+
realpath: function realpath(p, cache, cb) {
|
|
6734
6735
|
if (typeof cb !== "function") {
|
|
6735
6736
|
cb = maybeCallback(cache);
|
|
6736
6737
|
cache = null;
|
|
@@ -6738,66 +6739,66 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6738
6739
|
p = path__default["default"].resolve(p);
|
|
6739
6740
|
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) return process.nextTick(cb.bind(null, null, cache[p]));
|
|
6740
6741
|
var original = p, seenLinks = {}, knownHard = {};
|
|
6741
|
-
var pos
|
|
6742
|
+
var pos;
|
|
6742
6743
|
var current;
|
|
6743
|
-
var base
|
|
6744
|
+
var base;
|
|
6744
6745
|
var previous;
|
|
6745
6746
|
start();
|
|
6746
6747
|
function start() {
|
|
6747
|
-
var m
|
|
6748
|
-
pos
|
|
6749
|
-
current = m
|
|
6750
|
-
base
|
|
6748
|
+
var m = splitRootRe.exec(p);
|
|
6749
|
+
pos = m[0].length;
|
|
6750
|
+
current = m[0];
|
|
6751
|
+
base = m[0];
|
|
6751
6752
|
previous = "";
|
|
6752
|
-
if (isWindows$1 && !knownHard[base
|
|
6753
|
+
if (isWindows$1 && !knownHard[base]) fs__default["default"].lstat(base, function(err) {
|
|
6753
6754
|
if (err) return cb(err);
|
|
6754
|
-
knownHard[base
|
|
6755
|
+
knownHard[base] = true;
|
|
6755
6756
|
LOOP();
|
|
6756
6757
|
});
|
|
6757
6758
|
else process.nextTick(LOOP);
|
|
6758
6759
|
}
|
|
6759
6760
|
function LOOP() {
|
|
6760
|
-
if (pos
|
|
6761
|
+
if (pos >= p.length) {
|
|
6761
6762
|
if (cache) cache[original] = p;
|
|
6762
6763
|
return cb(null, p);
|
|
6763
6764
|
}
|
|
6764
|
-
nextPartRe.lastIndex = pos
|
|
6765
|
+
nextPartRe.lastIndex = pos;
|
|
6765
6766
|
var result = nextPartRe.exec(p);
|
|
6766
6767
|
previous = current;
|
|
6767
6768
|
current += result[0];
|
|
6768
|
-
base
|
|
6769
|
-
pos
|
|
6770
|
-
if (knownHard[base
|
|
6771
|
-
if (cache && Object.prototype.hasOwnProperty.call(cache, base
|
|
6772
|
-
return fs__default["default"].lstat(base
|
|
6769
|
+
base = previous + result[1];
|
|
6770
|
+
pos = nextPartRe.lastIndex;
|
|
6771
|
+
if (knownHard[base] || cache && cache[base] === base) return process.nextTick(LOOP);
|
|
6772
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) return gotResolvedLink(cache[base]);
|
|
6773
|
+
return fs__default["default"].lstat(base, gotStat);
|
|
6773
6774
|
}
|
|
6774
6775
|
function gotStat(err, stat) {
|
|
6775
6776
|
if (err) return cb(err);
|
|
6776
6777
|
if (!stat.isSymbolicLink()) {
|
|
6777
|
-
knownHard[base
|
|
6778
|
-
if (cache) cache[base
|
|
6778
|
+
knownHard[base] = true;
|
|
6779
|
+
if (cache) cache[base] = base;
|
|
6779
6780
|
return process.nextTick(LOOP);
|
|
6780
6781
|
}
|
|
6781
6782
|
if (!isWindows$1) {
|
|
6782
6783
|
var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
|
6783
|
-
if (seenLinks.hasOwnProperty(id)) return gotTarget(null, seenLinks[id], base
|
|
6784
|
+
if (seenLinks.hasOwnProperty(id)) return gotTarget(null, seenLinks[id], base);
|
|
6784
6785
|
}
|
|
6785
|
-
fs__default["default"].stat(base
|
|
6786
|
+
fs__default["default"].stat(base, function(err$1) {
|
|
6786
6787
|
if (err$1) return cb(err$1);
|
|
6787
|
-
fs__default["default"].readlink(base
|
|
6788
|
+
fs__default["default"].readlink(base, function(err$2, target) {
|
|
6788
6789
|
if (!isWindows$1) seenLinks[id] = target;
|
|
6789
6790
|
gotTarget(err$2, target);
|
|
6790
6791
|
});
|
|
6791
6792
|
});
|
|
6792
6793
|
}
|
|
6793
|
-
function gotTarget(err, target, base$
|
|
6794
|
+
function gotTarget(err, target, base$1) {
|
|
6794
6795
|
if (err) return cb(err);
|
|
6795
6796
|
var resolvedLink = path__default["default"].resolve(previous, target);
|
|
6796
|
-
if (cache) cache[base$
|
|
6797
|
+
if (cache) cache[base$1] = resolvedLink;
|
|
6797
6798
|
gotResolvedLink(resolvedLink);
|
|
6798
6799
|
}
|
|
6799
6800
|
function gotResolvedLink(resolvedLink) {
|
|
6800
|
-
p = path__default["default"].resolve(resolvedLink, p.slice(pos
|
|
6801
|
+
p = path__default["default"].resolve(resolvedLink, p.slice(pos));
|
|
6801
6802
|
start();
|
|
6802
6803
|
}
|
|
6803
6804
|
}
|
|
@@ -6869,8 +6870,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6869
6870
|
};
|
|
6870
6871
|
}
|
|
6871
6872
|
function maybeMatch(reg, str) {
|
|
6872
|
-
var m
|
|
6873
|
-
return m
|
|
6873
|
+
var m = str.match(reg);
|
|
6874
|
+
return m ? m[0] : null;
|
|
6874
6875
|
}
|
|
6875
6876
|
balanced.range = range;
|
|
6876
6877
|
function range(a, b, str) {
|
|
@@ -6918,11 +6919,11 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6918
6919
|
function parseCommaParts(str) {
|
|
6919
6920
|
if (!str) return [""];
|
|
6920
6921
|
var parts = [];
|
|
6921
|
-
var m
|
|
6922
|
-
if (!m
|
|
6923
|
-
var pre = m
|
|
6924
|
-
var body = m
|
|
6925
|
-
var post = m
|
|
6922
|
+
var m = balancedMatch("{", "}", str);
|
|
6923
|
+
if (!m) return str.split(",");
|
|
6924
|
+
var pre = m.pre;
|
|
6925
|
+
var body = m.body;
|
|
6926
|
+
var post = m.post;
|
|
6926
6927
|
var p = pre.split(",");
|
|
6927
6928
|
p[p.length - 1] += "{" + body + "}";
|
|
6928
6929
|
var postParts = parseCommaParts(post);
|
|
@@ -6944,57 +6945,57 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
6944
6945
|
function isPadded(el) {
|
|
6945
6946
|
return /^-?0\d/.test(el);
|
|
6946
6947
|
}
|
|
6947
|
-
function lte(i, y
|
|
6948
|
-
return i <= y
|
|
6948
|
+
function lte(i, y) {
|
|
6949
|
+
return i <= y;
|
|
6949
6950
|
}
|
|
6950
|
-
function gte(i, y
|
|
6951
|
-
return i >= y
|
|
6951
|
+
function gte(i, y) {
|
|
6952
|
+
return i >= y;
|
|
6952
6953
|
}
|
|
6953
6954
|
function expand(str, isTop) {
|
|
6954
6955
|
var expansions = [];
|
|
6955
|
-
var m
|
|
6956
|
-
if (!m
|
|
6957
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m
|
|
6958
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m
|
|
6956
|
+
var m = balancedMatch("{", "}", str);
|
|
6957
|
+
if (!m || /\$$/.test(m.pre)) return [str];
|
|
6958
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
6959
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
6959
6960
|
var isSequence = isNumericSequence || isAlphaSequence;
|
|
6960
|
-
var isOptions = m
|
|
6961
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
6961
6962
|
if (!isSequence && !isOptions) {
|
|
6962
|
-
if (m
|
|
6963
|
-
str = m
|
|
6963
|
+
if (m.post.match(/,.*\}/)) {
|
|
6964
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
6964
6965
|
return expand(str);
|
|
6965
6966
|
}
|
|
6966
6967
|
return [str];
|
|
6967
6968
|
}
|
|
6968
6969
|
var n;
|
|
6969
|
-
if (isSequence) n = m
|
|
6970
|
+
if (isSequence) n = m.body.split(/\.\./);
|
|
6970
6971
|
else {
|
|
6971
|
-
n = parseCommaParts(m
|
|
6972
|
+
n = parseCommaParts(m.body);
|
|
6972
6973
|
if (n.length === 1) {
|
|
6973
6974
|
n = expand(n[0], false).map(embrace);
|
|
6974
6975
|
if (n.length === 1) {
|
|
6975
|
-
var post = m
|
|
6976
|
+
var post = m.post.length ? expand(m.post, false) : [""];
|
|
6976
6977
|
return post.map(function(p) {
|
|
6977
|
-
return m
|
|
6978
|
+
return m.pre + n[0] + p;
|
|
6978
6979
|
});
|
|
6979
6980
|
}
|
|
6980
6981
|
}
|
|
6981
6982
|
}
|
|
6982
|
-
var pre = m
|
|
6983
|
-
var post = m
|
|
6983
|
+
var pre = m.pre;
|
|
6984
|
+
var post = m.post.length ? expand(m.post, false) : [""];
|
|
6984
6985
|
var N;
|
|
6985
6986
|
if (isSequence) {
|
|
6986
6987
|
var x = numeric(n[0]);
|
|
6987
|
-
var y
|
|
6988
|
+
var y = numeric(n[1]);
|
|
6988
6989
|
var width = Math.max(n[0].length, n[1].length);
|
|
6989
6990
|
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
6990
6991
|
var test = lte;
|
|
6991
|
-
if (y
|
|
6992
|
+
if (y < x) {
|
|
6992
6993
|
incr *= -1;
|
|
6993
6994
|
test = gte;
|
|
6994
6995
|
}
|
|
6995
6996
|
var pad = n.some(isPadded);
|
|
6996
6997
|
N = [];
|
|
6997
|
-
for (var i = x; test(i, y
|
|
6998
|
+
for (var i = x; test(i, y); i += incr) {
|
|
6998
6999
|
var c;
|
|
6999
7000
|
if (isAlphaSequence) {
|
|
7000
7001
|
c = String.fromCharCode(i);
|
|
@@ -7023,9 +7024,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7023
7024
|
}
|
|
7024
7025
|
var minimatch_1 = minimatch;
|
|
7025
7026
|
minimatch.Minimatch = Minimatch$1;
|
|
7026
|
-
var path
|
|
7027
|
+
var path = { sep: "/" };
|
|
7027
7028
|
try {
|
|
7028
|
-
path
|
|
7029
|
+
path = path__default["default"];
|
|
7029
7030
|
} catch (er) {}
|
|
7030
7031
|
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch$1.GLOBSTAR = {};
|
|
7031
7032
|
var plTypes = {
|
|
@@ -7055,8 +7056,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7055
7056
|
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
7056
7057
|
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
7057
7058
|
var reSpecials = charSet("().*{}+?[]^$\\!");
|
|
7058
|
-
function charSet(s
|
|
7059
|
-
return s
|
|
7059
|
+
function charSet(s) {
|
|
7060
|
+
return s.split("").reduce(function(set, c) {
|
|
7060
7061
|
set[c] = true;
|
|
7061
7062
|
return set;
|
|
7062
7063
|
}, {});
|
|
@@ -7065,7 +7066,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7065
7066
|
minimatch.filter = filter;
|
|
7066
7067
|
function filter(pattern, options) {
|
|
7067
7068
|
options = options || {};
|
|
7068
|
-
return function(p, i, list
|
|
7069
|
+
return function(p, i, list) {
|
|
7069
7070
|
return minimatch(p, pattern, options);
|
|
7070
7071
|
};
|
|
7071
7072
|
}
|
|
@@ -7084,13 +7085,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7084
7085
|
minimatch.defaults = function(def) {
|
|
7085
7086
|
if (!def || !Object.keys(def).length) return minimatch;
|
|
7086
7087
|
var orig = minimatch;
|
|
7087
|
-
var m
|
|
7088
|
+
var m = function minimatch(p, pattern, options) {
|
|
7088
7089
|
return orig.minimatch(p, pattern, ext(def, options));
|
|
7089
7090
|
};
|
|
7090
|
-
m
|
|
7091
|
+
m.Minimatch = function Minimatch(pattern, options) {
|
|
7091
7092
|
return new orig.Minimatch(pattern, ext(def, options));
|
|
7092
7093
|
};
|
|
7093
|
-
return m
|
|
7094
|
+
return m;
|
|
7094
7095
|
};
|
|
7095
7096
|
Minimatch$1.defaults = function(def) {
|
|
7096
7097
|
if (!def || !Object.keys(def).length) return Minimatch$1;
|
|
@@ -7108,7 +7109,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7108
7109
|
if (typeof pattern !== "string") throw new TypeError("glob pattern string required");
|
|
7109
7110
|
if (!options) options = {};
|
|
7110
7111
|
pattern = pattern.trim();
|
|
7111
|
-
if (path
|
|
7112
|
+
if (path.sep !== "/") pattern = pattern.split(path.sep).join("/");
|
|
7112
7113
|
this.options = options;
|
|
7113
7114
|
this.set = [];
|
|
7114
7115
|
this.pattern = pattern;
|
|
@@ -7136,16 +7137,16 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7136
7137
|
var set = this.globSet = this.braceExpand();
|
|
7137
7138
|
if (options.debug) this.debug = console.error;
|
|
7138
7139
|
this.debug(this.pattern, set);
|
|
7139
|
-
set = this.globParts = set.map(function(s
|
|
7140
|
-
return s
|
|
7140
|
+
set = this.globParts = set.map(function(s) {
|
|
7141
|
+
return s.split(slashSplit);
|
|
7141
7142
|
});
|
|
7142
7143
|
this.debug(this.pattern, set);
|
|
7143
|
-
set = set.map(function(s
|
|
7144
|
-
return s
|
|
7144
|
+
set = set.map(function(s, si, set$1) {
|
|
7145
|
+
return s.map(this.parse, this);
|
|
7145
7146
|
}, this);
|
|
7146
7147
|
this.debug(this.pattern, set);
|
|
7147
|
-
set = set.filter(function(s
|
|
7148
|
-
return s
|
|
7148
|
+
set = set.filter(function(s) {
|
|
7149
|
+
return s.indexOf(false) === -1;
|
|
7149
7150
|
});
|
|
7150
7151
|
this.debug(this.pattern, set);
|
|
7151
7152
|
this.set = set;
|
|
@@ -7407,14 +7408,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7407
7408
|
}
|
|
7408
7409
|
return this.regexp;
|
|
7409
7410
|
}
|
|
7410
|
-
minimatch.match = function(list
|
|
7411
|
+
minimatch.match = function(list, pattern, options) {
|
|
7411
7412
|
options = options || {};
|
|
7412
7413
|
var mm = new Minimatch$1(pattern, options);
|
|
7413
|
-
list
|
|
7414
|
+
list = list.filter(function(f) {
|
|
7414
7415
|
return mm.match(f);
|
|
7415
7416
|
});
|
|
7416
|
-
if (mm.options.nonull && !list
|
|
7417
|
-
return list
|
|
7417
|
+
if (mm.options.nonull && !list.length) list.push(pattern);
|
|
7418
|
+
return list;
|
|
7418
7419
|
};
|
|
7419
7420
|
Minimatch$1.prototype.match = match;
|
|
7420
7421
|
function match(f, partial) {
|
|
@@ -7423,7 +7424,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7423
7424
|
if (this.empty) return f === "";
|
|
7424
7425
|
if (f === "/" && partial) return true;
|
|
7425
7426
|
var options = this.options;
|
|
7426
|
-
if (path
|
|
7427
|
+
if (path.sep !== "/") f = f.split(path.sep).join("/");
|
|
7427
7428
|
f = f.split(slashSplit);
|
|
7428
7429
|
this.debug(this.pattern, "split", f);
|
|
7429
7430
|
var set = this.set;
|
|
@@ -7510,14 +7511,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7510
7511
|
else if (pi === pl) return fi === fl - 1 && file[fi] === "";
|
|
7511
7512
|
throw new Error("wtf?");
|
|
7512
7513
|
};
|
|
7513
|
-
function globUnescape(s
|
|
7514
|
-
return s
|
|
7514
|
+
function globUnescape(s) {
|
|
7515
|
+
return s.replace(/\\(.)/g, "$1");
|
|
7515
7516
|
}
|
|
7516
|
-
function regExpEscape(s
|
|
7517
|
-
return s
|
|
7517
|
+
function regExpEscape(s) {
|
|
7518
|
+
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
7518
7519
|
}
|
|
7519
7520
|
var inherits_browser = createCommonjsModule(function(module$1) {
|
|
7520
|
-
if (typeof Object.create === "function") module$1.exports = function inherits
|
|
7521
|
+
if (typeof Object.create === "function") module$1.exports = function inherits(ctor, superCtor) {
|
|
7521
7522
|
ctor.super_ = superCtor;
|
|
7522
7523
|
ctor.prototype = Object.create(superCtor.prototype, { constructor: {
|
|
7523
7524
|
value: ctor,
|
|
@@ -7526,7 +7527,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7526
7527
|
configurable: true
|
|
7527
7528
|
} });
|
|
7528
7529
|
};
|
|
7529
|
-
else module$1.exports = function inherits
|
|
7530
|
+
else module$1.exports = function inherits(ctor, superCtor) {
|
|
7530
7531
|
ctor.super_ = superCtor;
|
|
7531
7532
|
var TempCtor = function() {};
|
|
7532
7533
|
TempCtor.prototype = superCtor.prototype;
|
|
@@ -7536,18 +7537,18 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7536
7537
|
});
|
|
7537
7538
|
var inherits = createCommonjsModule(function(module$1) {
|
|
7538
7539
|
try {
|
|
7539
|
-
var util
|
|
7540
|
-
if (typeof util
|
|
7541
|
-
module$1.exports = util
|
|
7540
|
+
var util = util__default["default"];
|
|
7541
|
+
if (typeof util.inherits !== "function") throw "";
|
|
7542
|
+
module$1.exports = util.inherits;
|
|
7542
7543
|
} catch (e) {
|
|
7543
7544
|
module$1.exports = inherits_browser;
|
|
7544
7545
|
}
|
|
7545
7546
|
});
|
|
7546
|
-
function posix(path$
|
|
7547
|
-
return path$
|
|
7547
|
+
function posix(path$2) {
|
|
7548
|
+
return path$2.charAt(0) === "/";
|
|
7548
7549
|
}
|
|
7549
|
-
function win32(path$
|
|
7550
|
-
var result = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(path$
|
|
7550
|
+
function win32(path$2) {
|
|
7551
|
+
var result = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(path$2);
|
|
7551
7552
|
var device = result[1] || "";
|
|
7552
7553
|
var isUnc = Boolean(device && device.charAt(1) !== ":");
|
|
7553
7554
|
return Boolean(result[2] || isUnc);
|
|
@@ -7619,11 +7620,11 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7619
7620
|
self$1.symlinks = options.symlinks || Object.create(null);
|
|
7620
7621
|
setupIgnores(self$1, options);
|
|
7621
7622
|
self$1.changedCwd = false;
|
|
7622
|
-
var cwd$
|
|
7623
|
-
if (!ownProp$2(options, "cwd")) self$1.cwd = cwd$
|
|
7623
|
+
var cwd$1 = process.cwd();
|
|
7624
|
+
if (!ownProp$2(options, "cwd")) self$1.cwd = cwd$1;
|
|
7624
7625
|
else {
|
|
7625
7626
|
self$1.cwd = path__default["default"].resolve(options.cwd);
|
|
7626
|
-
self$1.changedCwd = self$1.cwd !== cwd$
|
|
7627
|
+
self$1.changedCwd = self$1.cwd !== cwd$1;
|
|
7627
7628
|
}
|
|
7628
7629
|
self$1.root = options.root || path__default["default"].resolve(self$1.cwd, "/");
|
|
7629
7630
|
self$1.root = path__default["default"].resolve(self$1.root);
|
|
@@ -7648,10 +7649,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7648
7649
|
else all[literal] = true;
|
|
7649
7650
|
}
|
|
7650
7651
|
} else {
|
|
7651
|
-
var m
|
|
7652
|
-
if (nou) all.push.apply(all, m
|
|
7653
|
-
else m
|
|
7654
|
-
all[m$
|
|
7652
|
+
var m = Object.keys(matches);
|
|
7653
|
+
if (nou) all.push.apply(all, m);
|
|
7654
|
+
else m.forEach(function(m$1) {
|
|
7655
|
+
all[m$1] = true;
|
|
7655
7656
|
});
|
|
7656
7657
|
}
|
|
7657
7658
|
}
|
|
@@ -7666,27 +7667,27 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7666
7667
|
return notDir;
|
|
7667
7668
|
});
|
|
7668
7669
|
}
|
|
7669
|
-
if (self$1.ignore.length) all = all.filter(function(m$
|
|
7670
|
-
return !isIgnored$2(self$1, m$
|
|
7670
|
+
if (self$1.ignore.length) all = all.filter(function(m$1) {
|
|
7671
|
+
return !isIgnored$2(self$1, m$1);
|
|
7671
7672
|
});
|
|
7672
7673
|
self$1.found = all;
|
|
7673
7674
|
}
|
|
7674
7675
|
function mark(self$1, p) {
|
|
7675
7676
|
var abs = makeAbs(self$1, p);
|
|
7676
7677
|
var c = self$1.cache[abs];
|
|
7677
|
-
var m
|
|
7678
|
+
var m = p;
|
|
7678
7679
|
if (c) {
|
|
7679
7680
|
var isDir = c === "DIR" || Array.isArray(c);
|
|
7680
7681
|
var slash = p.slice(-1) === "/";
|
|
7681
|
-
if (isDir && !slash) m
|
|
7682
|
-
else if (!isDir && slash) m
|
|
7683
|
-
if (m
|
|
7684
|
-
var mabs = makeAbs(self$1, m
|
|
7682
|
+
if (isDir && !slash) m += "/";
|
|
7683
|
+
else if (!isDir && slash) m = m.slice(0, -1);
|
|
7684
|
+
if (m !== p) {
|
|
7685
|
+
var mabs = makeAbs(self$1, m);
|
|
7685
7686
|
self$1.statCache[mabs] = self$1.statCache[abs];
|
|
7686
7687
|
self$1.cache[mabs] = self$1.cache[abs];
|
|
7687
7688
|
}
|
|
7688
7689
|
}
|
|
7689
|
-
return m
|
|
7690
|
+
return m;
|
|
7690
7691
|
}
|
|
7691
7692
|
function makeAbs(self$1, f) {
|
|
7692
7693
|
var abs = f;
|
|
@@ -7697,16 +7698,16 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7697
7698
|
if (process.platform === "win32") abs = abs.replace(/\\/g, "/");
|
|
7698
7699
|
return abs;
|
|
7699
7700
|
}
|
|
7700
|
-
function isIgnored$2(self$1, path$
|
|
7701
|
+
function isIgnored$2(self$1, path$2) {
|
|
7701
7702
|
if (!self$1.ignore.length) return false;
|
|
7702
7703
|
return self$1.ignore.some(function(item) {
|
|
7703
|
-
return item.matcher.match(path$
|
|
7704
|
+
return item.matcher.match(path$2) || !!(item.gmatcher && item.gmatcher.match(path$2));
|
|
7704
7705
|
});
|
|
7705
7706
|
}
|
|
7706
|
-
function childrenIgnored$2(self$1, path$
|
|
7707
|
+
function childrenIgnored$2(self$1, path$2) {
|
|
7707
7708
|
if (!self$1.ignore.length) return false;
|
|
7708
7709
|
return self$1.ignore.some(function(item) {
|
|
7709
|
-
return !!(item.gmatcher && item.gmatcher.match(path$
|
|
7710
|
+
return !!(item.gmatcher && item.gmatcher.match(path$2));
|
|
7710
7711
|
});
|
|
7711
7712
|
}
|
|
7712
7713
|
var common$1 = {
|
|
@@ -7745,8 +7746,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7745
7746
|
assert__default["default"](this instanceof GlobSync$1);
|
|
7746
7747
|
if (this.realpath) {
|
|
7747
7748
|
var self$1 = this;
|
|
7748
|
-
this.matches.forEach(function(matchset, index
|
|
7749
|
-
var set = self$1.matches[index
|
|
7749
|
+
this.matches.forEach(function(matchset, index) {
|
|
7750
|
+
var set = self$1.matches[index] = Object.create(null);
|
|
7750
7751
|
for (var p in matchset) try {
|
|
7751
7752
|
p = self$1._makeAbs(p);
|
|
7752
7753
|
var real = fs_realpath.realpathSync(p, self$1.realpathCache);
|
|
@@ -7759,14 +7760,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7759
7760
|
}
|
|
7760
7761
|
common$1.finish(this);
|
|
7761
7762
|
};
|
|
7762
|
-
GlobSync$1.prototype._process = function(pattern, index
|
|
7763
|
+
GlobSync$1.prototype._process = function(pattern, index, inGlobStar) {
|
|
7763
7764
|
assert__default["default"](this instanceof GlobSync$1);
|
|
7764
7765
|
var n = 0;
|
|
7765
7766
|
while (typeof pattern[n] === "string") n++;
|
|
7766
7767
|
var prefix;
|
|
7767
7768
|
switch (n) {
|
|
7768
7769
|
case pattern.length:
|
|
7769
|
-
this._processSimple(pattern.join("/"), index
|
|
7770
|
+
this._processSimple(pattern.join("/"), index);
|
|
7770
7771
|
return;
|
|
7771
7772
|
case 0:
|
|
7772
7773
|
prefix = null;
|
|
@@ -7784,10 +7785,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7784
7785
|
} else read = prefix;
|
|
7785
7786
|
var abs = this._makeAbs(read);
|
|
7786
7787
|
if (childrenIgnored$1(this, read)) return;
|
|
7787
|
-
if (remain[0] === minimatch_1.GLOBSTAR) this._processGlobStar(prefix, read, abs, remain, index
|
|
7788
|
-
else this._processReaddir(prefix, read, abs, remain, index
|
|
7788
|
+
if (remain[0] === minimatch_1.GLOBSTAR) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
|
|
7789
|
+
else this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
|
|
7789
7790
|
};
|
|
7790
|
-
GlobSync$1.prototype._processReaddir = function(prefix, read, abs, remain, index
|
|
7791
|
+
GlobSync$1.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
|
|
7791
7792
|
var entries = this._readdir(abs, inGlobStar);
|
|
7792
7793
|
if (!entries) return;
|
|
7793
7794
|
var pn = remain[0];
|
|
@@ -7798,22 +7799,22 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7798
7799
|
for (var i = 0; i < entries.length; i++) {
|
|
7799
7800
|
var e = entries[i];
|
|
7800
7801
|
if (e.charAt(0) !== "." || dotOk) {
|
|
7801
|
-
var m
|
|
7802
|
-
if (negate && !prefix) m
|
|
7803
|
-
else m
|
|
7804
|
-
if (m
|
|
7802
|
+
var m;
|
|
7803
|
+
if (negate && !prefix) m = !e.match(pn);
|
|
7804
|
+
else m = e.match(pn);
|
|
7805
|
+
if (m) matchedEntries.push(e);
|
|
7805
7806
|
}
|
|
7806
7807
|
}
|
|
7807
7808
|
var len = matchedEntries.length;
|
|
7808
7809
|
if (len === 0) return;
|
|
7809
7810
|
if (remain.length === 1 && !this.mark && !this.stat) {
|
|
7810
|
-
if (!this.matches[index
|
|
7811
|
+
if (!this.matches[index]) this.matches[index] = Object.create(null);
|
|
7811
7812
|
for (var i = 0; i < len; i++) {
|
|
7812
7813
|
var e = matchedEntries[i];
|
|
7813
7814
|
if (prefix) if (prefix.slice(-1) !== "/") e = prefix + "/" + e;
|
|
7814
7815
|
else e = prefix + e;
|
|
7815
7816
|
if (e.charAt(0) === "/" && !this.nomount) e = path__default["default"].join(this.root, e);
|
|
7816
|
-
this._emitMatch(index
|
|
7817
|
+
this._emitMatch(index, e);
|
|
7817
7818
|
}
|
|
7818
7819
|
return;
|
|
7819
7820
|
}
|
|
@@ -7823,20 +7824,20 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7823
7824
|
var newPattern;
|
|
7824
7825
|
if (prefix) newPattern = [prefix, e];
|
|
7825
7826
|
else newPattern = [e];
|
|
7826
|
-
this._process(newPattern.concat(remain), index
|
|
7827
|
+
this._process(newPattern.concat(remain), index, inGlobStar);
|
|
7827
7828
|
}
|
|
7828
7829
|
};
|
|
7829
|
-
GlobSync$1.prototype._emitMatch = function(index
|
|
7830
|
+
GlobSync$1.prototype._emitMatch = function(index, e) {
|
|
7830
7831
|
if (isIgnored$1(this, e)) return;
|
|
7831
7832
|
var abs = this._makeAbs(e);
|
|
7832
7833
|
if (this.mark) e = this._mark(e);
|
|
7833
7834
|
if (this.absolute) e = abs;
|
|
7834
|
-
if (this.matches[index
|
|
7835
|
+
if (this.matches[index][e]) return;
|
|
7835
7836
|
if (this.nodir) {
|
|
7836
7837
|
var c = this.cache[abs];
|
|
7837
7838
|
if (c === "DIR" || Array.isArray(c)) return;
|
|
7838
7839
|
}
|
|
7839
|
-
this.matches[index
|
|
7840
|
+
this.matches[index][e] = true;
|
|
7840
7841
|
if (this.stat) this._stat(e);
|
|
7841
7842
|
};
|
|
7842
7843
|
GlobSync$1.prototype._readdirInGlobStar = function(abs) {
|
|
@@ -7904,26 +7905,26 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7904
7905
|
break;
|
|
7905
7906
|
}
|
|
7906
7907
|
};
|
|
7907
|
-
GlobSync$1.prototype._processGlobStar = function(prefix, read, abs, remain, index
|
|
7908
|
+
GlobSync$1.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
|
|
7908
7909
|
var entries = this._readdir(abs, inGlobStar);
|
|
7909
7910
|
if (!entries) return;
|
|
7910
7911
|
var remainWithoutGlobStar = remain.slice(1);
|
|
7911
7912
|
var gspref = prefix ? [prefix] : [];
|
|
7912
7913
|
var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
|
7913
|
-
this._process(noGlobStar, index
|
|
7914
|
+
this._process(noGlobStar, index, false);
|
|
7914
7915
|
var len = entries.length;
|
|
7915
7916
|
if (this.symlinks[abs] && inGlobStar) return;
|
|
7916
7917
|
for (var i = 0; i < len; i++) {
|
|
7917
7918
|
if (entries[i].charAt(0) === "." && !this.dot) continue;
|
|
7918
7919
|
var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
|
7919
|
-
this._process(instead, index
|
|
7920
|
+
this._process(instead, index, true);
|
|
7920
7921
|
var below = gspref.concat(entries[i], remain);
|
|
7921
|
-
this._process(below, index
|
|
7922
|
+
this._process(below, index, true);
|
|
7922
7923
|
}
|
|
7923
7924
|
};
|
|
7924
|
-
GlobSync$1.prototype._processSimple = function(prefix, index
|
|
7925
|
+
GlobSync$1.prototype._processSimple = function(prefix, index) {
|
|
7925
7926
|
var exists = this._stat(prefix);
|
|
7926
|
-
if (!this.matches[index
|
|
7927
|
+
if (!this.matches[index]) this.matches[index] = Object.create(null);
|
|
7927
7928
|
if (!exists) return;
|
|
7928
7929
|
if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
|
|
7929
7930
|
var trail = /[\/\\]$/.test(prefix);
|
|
@@ -7934,7 +7935,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
7934
7935
|
}
|
|
7935
7936
|
}
|
|
7936
7937
|
if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/");
|
|
7937
|
-
this._emitMatch(index
|
|
7938
|
+
this._emitMatch(index, prefix);
|
|
7938
7939
|
};
|
|
7939
7940
|
GlobSync$1.prototype._stat = function(f) {
|
|
7940
7941
|
var abs = this._makeAbs(f);
|
|
@@ -8047,7 +8048,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8047
8048
|
return once_1(function RES() {
|
|
8048
8049
|
var cbs = reqs[key];
|
|
8049
8050
|
var len = cbs.length;
|
|
8050
|
-
var args = slice
|
|
8051
|
+
var args = slice(arguments);
|
|
8051
8052
|
try {
|
|
8052
8053
|
for (var i = 0; i < len; i++) cbs[i].apply(null, args);
|
|
8053
8054
|
} finally {
|
|
@@ -8060,7 +8061,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8060
8061
|
}
|
|
8061
8062
|
});
|
|
8062
8063
|
}
|
|
8063
|
-
function slice
|
|
8064
|
+
function slice(args) {
|
|
8064
8065
|
var length = args.length;
|
|
8065
8066
|
var array = [];
|
|
8066
8067
|
for (var i = 0; i < length; i++) array[i] = args[i];
|
|
@@ -8130,12 +8131,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8130
8131
|
this.paused = false;
|
|
8131
8132
|
if (this.noprocess) return this;
|
|
8132
8133
|
if (n === 0) return done();
|
|
8133
|
-
var sync
|
|
8134
|
+
var sync = true;
|
|
8134
8135
|
for (var i = 0; i < n; i++) this._process(this.minimatch.set[i], i, false, done);
|
|
8135
|
-
sync
|
|
8136
|
+
sync = false;
|
|
8136
8137
|
function done() {
|
|
8137
8138
|
--self$1._processing;
|
|
8138
|
-
if (self$1._processing <= 0) if (sync
|
|
8139
|
+
if (self$1._processing <= 0) if (sync) process.nextTick(function() {
|
|
8139
8140
|
self$1._finish();
|
|
8140
8141
|
});
|
|
8141
8142
|
else self$1._finish();
|
|
@@ -8159,14 +8160,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8159
8160
|
if (--n === 0) self$1._finish();
|
|
8160
8161
|
}
|
|
8161
8162
|
};
|
|
8162
|
-
Glob.prototype._realpathSet = function(index
|
|
8163
|
-
var matchset = this.matches[index
|
|
8163
|
+
Glob.prototype._realpathSet = function(index, cb) {
|
|
8164
|
+
var matchset = this.matches[index];
|
|
8164
8165
|
if (!matchset) return cb();
|
|
8165
8166
|
var found = Object.keys(matchset);
|
|
8166
8167
|
var self$1 = this;
|
|
8167
8168
|
var n = found.length;
|
|
8168
8169
|
if (n === 0) return cb();
|
|
8169
|
-
var set = this.matches[index
|
|
8170
|
+
var set = this.matches[index] = Object.create(null);
|
|
8170
8171
|
found.forEach(function(p, i) {
|
|
8171
8172
|
p = self$1._makeAbs(p);
|
|
8172
8173
|
fs_realpath.realpath(p, self$1.realpathCache, function(er, real) {
|
|
@@ -8174,7 +8175,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8174
8175
|
else if (er.syscall === "stat") set[p] = true;
|
|
8175
8176
|
else self$1.emit("error", er);
|
|
8176
8177
|
if (--n === 0) {
|
|
8177
|
-
self$1.matches[index
|
|
8178
|
+
self$1.matches[index] = set;
|
|
8178
8179
|
cb();
|
|
8179
8180
|
}
|
|
8180
8181
|
});
|
|
@@ -8219,7 +8220,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8219
8220
|
}
|
|
8220
8221
|
}
|
|
8221
8222
|
};
|
|
8222
|
-
Glob.prototype._process = function(pattern, index
|
|
8223
|
+
Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
|
|
8223
8224
|
assert__default["default"](this instanceof Glob);
|
|
8224
8225
|
assert__default["default"](typeof cb === "function");
|
|
8225
8226
|
if (this.aborted) return;
|
|
@@ -8227,7 +8228,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8227
8228
|
if (this.paused) {
|
|
8228
8229
|
this._processQueue.push([
|
|
8229
8230
|
pattern,
|
|
8230
|
-
index
|
|
8231
|
+
index,
|
|
8231
8232
|
inGlobStar,
|
|
8232
8233
|
cb
|
|
8233
8234
|
]);
|
|
@@ -8238,7 +8239,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8238
8239
|
var prefix;
|
|
8239
8240
|
switch (n) {
|
|
8240
8241
|
case pattern.length:
|
|
8241
|
-
this._processSimple(pattern.join("/"), index
|
|
8242
|
+
this._processSimple(pattern.join("/"), index, cb);
|
|
8242
8243
|
return;
|
|
8243
8244
|
case 0:
|
|
8244
8245
|
prefix = null;
|
|
@@ -8256,16 +8257,16 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8256
8257
|
} else read = prefix;
|
|
8257
8258
|
var abs = this._makeAbs(read);
|
|
8258
8259
|
if (childrenIgnored(this, read)) return cb();
|
|
8259
|
-
if (remain[0] === minimatch_1.GLOBSTAR) this._processGlobStar(prefix, read, abs, remain, index
|
|
8260
|
-
else this._processReaddir(prefix, read, abs, remain, index
|
|
8260
|
+
if (remain[0] === minimatch_1.GLOBSTAR) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
|
|
8261
|
+
else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
|
|
8261
8262
|
};
|
|
8262
|
-
Glob.prototype._processReaddir = function(prefix, read, abs, remain, index
|
|
8263
|
+
Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
|
|
8263
8264
|
var self$1 = this;
|
|
8264
8265
|
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
8265
|
-
return self$1._processReaddir2(prefix, read, abs, remain, index
|
|
8266
|
+
return self$1._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
|
|
8266
8267
|
});
|
|
8267
8268
|
};
|
|
8268
|
-
Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index
|
|
8269
|
+
Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
|
8269
8270
|
if (!entries) return cb();
|
|
8270
8271
|
var pn = remain[0];
|
|
8271
8272
|
var negate = !!this.minimatch.negate;
|
|
@@ -8275,22 +8276,22 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8275
8276
|
for (var i = 0; i < entries.length; i++) {
|
|
8276
8277
|
var e = entries[i];
|
|
8277
8278
|
if (e.charAt(0) !== "." || dotOk) {
|
|
8278
|
-
var m
|
|
8279
|
-
if (negate && !prefix) m
|
|
8280
|
-
else m
|
|
8281
|
-
if (m
|
|
8279
|
+
var m;
|
|
8280
|
+
if (negate && !prefix) m = !e.match(pn);
|
|
8281
|
+
else m = e.match(pn);
|
|
8282
|
+
if (m) matchedEntries.push(e);
|
|
8282
8283
|
}
|
|
8283
8284
|
}
|
|
8284
8285
|
var len = matchedEntries.length;
|
|
8285
8286
|
if (len === 0) return cb();
|
|
8286
8287
|
if (remain.length === 1 && !this.mark && !this.stat) {
|
|
8287
|
-
if (!this.matches[index
|
|
8288
|
+
if (!this.matches[index]) this.matches[index] = Object.create(null);
|
|
8288
8289
|
for (var i = 0; i < len; i++) {
|
|
8289
8290
|
var e = matchedEntries[i];
|
|
8290
8291
|
if (prefix) if (prefix !== "/") e = prefix + "/" + e;
|
|
8291
8292
|
else e = prefix + e;
|
|
8292
8293
|
if (e.charAt(0) === "/" && !this.nomount) e = path__default["default"].join(this.root, e);
|
|
8293
|
-
this._emitMatch(index
|
|
8294
|
+
this._emitMatch(index, e);
|
|
8294
8295
|
}
|
|
8295
8296
|
return cb();
|
|
8296
8297
|
}
|
|
@@ -8299,26 +8300,26 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8299
8300
|
var e = matchedEntries[i];
|
|
8300
8301
|
if (prefix) if (prefix !== "/") e = prefix + "/" + e;
|
|
8301
8302
|
else e = prefix + e;
|
|
8302
|
-
this._process([e].concat(remain), index
|
|
8303
|
+
this._process([e].concat(remain), index, inGlobStar, cb);
|
|
8303
8304
|
}
|
|
8304
8305
|
cb();
|
|
8305
8306
|
};
|
|
8306
|
-
Glob.prototype._emitMatch = function(index
|
|
8307
|
+
Glob.prototype._emitMatch = function(index, e) {
|
|
8307
8308
|
if (this.aborted) return;
|
|
8308
8309
|
if (isIgnored(this, e)) return;
|
|
8309
8310
|
if (this.paused) {
|
|
8310
|
-
this._emitQueue.push([index
|
|
8311
|
+
this._emitQueue.push([index, e]);
|
|
8311
8312
|
return;
|
|
8312
8313
|
}
|
|
8313
8314
|
var abs = pathIsAbsolute(e) ? e : this._makeAbs(e);
|
|
8314
8315
|
if (this.mark) e = this._mark(e);
|
|
8315
8316
|
if (this.absolute) e = abs;
|
|
8316
|
-
if (this.matches[index
|
|
8317
|
+
if (this.matches[index][e]) return;
|
|
8317
8318
|
if (this.nodir) {
|
|
8318
8319
|
var c = this.cache[abs];
|
|
8319
8320
|
if (c === "DIR" || Array.isArray(c)) return;
|
|
8320
8321
|
}
|
|
8321
|
-
this.matches[index
|
|
8322
|
+
this.matches[index][e] = true;
|
|
8322
8323
|
var st = this.statCache[abs];
|
|
8323
8324
|
if (st) this.emit("stat", e, st);
|
|
8324
8325
|
this.emit("match", e);
|
|
@@ -8401,38 +8402,38 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8401
8402
|
}
|
|
8402
8403
|
return cb();
|
|
8403
8404
|
};
|
|
8404
|
-
Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index
|
|
8405
|
+
Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
|
|
8405
8406
|
var self$1 = this;
|
|
8406
8407
|
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
8407
|
-
self$1._processGlobStar2(prefix, read, abs, remain, index
|
|
8408
|
+
self$1._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
|
|
8408
8409
|
});
|
|
8409
8410
|
};
|
|
8410
|
-
Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index
|
|
8411
|
+
Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
|
8411
8412
|
if (!entries) return cb();
|
|
8412
8413
|
var remainWithoutGlobStar = remain.slice(1);
|
|
8413
8414
|
var gspref = prefix ? [prefix] : [];
|
|
8414
8415
|
var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
|
8415
|
-
this._process(noGlobStar, index
|
|
8416
|
+
this._process(noGlobStar, index, false, cb);
|
|
8416
8417
|
var isSym = this.symlinks[abs];
|
|
8417
8418
|
var len = entries.length;
|
|
8418
8419
|
if (isSym && inGlobStar) return cb();
|
|
8419
8420
|
for (var i = 0; i < len; i++) {
|
|
8420
8421
|
if (entries[i].charAt(0) === "." && !this.dot) continue;
|
|
8421
8422
|
var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
|
8422
|
-
this._process(instead, index
|
|
8423
|
+
this._process(instead, index, true, cb);
|
|
8423
8424
|
var below = gspref.concat(entries[i], remain);
|
|
8424
|
-
this._process(below, index
|
|
8425
|
+
this._process(below, index, true, cb);
|
|
8425
8426
|
}
|
|
8426
8427
|
cb();
|
|
8427
8428
|
};
|
|
8428
|
-
Glob.prototype._processSimple = function(prefix, index
|
|
8429
|
+
Glob.prototype._processSimple = function(prefix, index, cb) {
|
|
8429
8430
|
var self$1 = this;
|
|
8430
8431
|
this._stat(prefix, function(er, exists) {
|
|
8431
|
-
self$1._processSimple2(prefix, index
|
|
8432
|
+
self$1._processSimple2(prefix, index, er, exists, cb);
|
|
8432
8433
|
});
|
|
8433
8434
|
};
|
|
8434
|
-
Glob.prototype._processSimple2 = function(prefix, index
|
|
8435
|
-
if (!this.matches[index
|
|
8435
|
+
Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
|
|
8436
|
+
if (!this.matches[index]) this.matches[index] = Object.create(null);
|
|
8436
8437
|
if (!exists) return cb();
|
|
8437
8438
|
if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
|
|
8438
8439
|
var trail = /[\/\\]$/.test(prefix);
|
|
@@ -8443,7 +8444,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8443
8444
|
}
|
|
8444
8445
|
}
|
|
8445
8446
|
if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/");
|
|
8446
|
-
this._emitMatch(index
|
|
8447
|
+
this._emitMatch(index, prefix);
|
|
8447
8448
|
cb();
|
|
8448
8449
|
};
|
|
8449
8450
|
Glob.prototype._stat = function(f, cb) {
|
|
@@ -8509,10 +8510,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8509
8510
|
"lstat",
|
|
8510
8511
|
"rmdir",
|
|
8511
8512
|
"readdir"
|
|
8512
|
-
].forEach(function(m
|
|
8513
|
-
options[m
|
|
8514
|
-
m
|
|
8515
|
-
options[m
|
|
8513
|
+
].forEach(function(m) {
|
|
8514
|
+
options[m] = options[m] || fs__default["default"][m];
|
|
8515
|
+
m = m + "Sync";
|
|
8516
|
+
options[m] = options[m] || fs__default["default"][m];
|
|
8516
8517
|
});
|
|
8517
8518
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
8518
8519
|
options.emfileWait = options.emfileWait || 1e3;
|
|
@@ -8743,23 +8744,23 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8743
8744
|
}
|
|
8744
8745
|
function copydirSync() {
|
|
8745
8746
|
var ref = resolvePathAndOptions(arguments);
|
|
8746
|
-
var src
|
|
8747
|
+
var src = ref.resolvedPath;
|
|
8747
8748
|
var readOptions = ref.options;
|
|
8748
8749
|
return { to: function to() {
|
|
8749
8750
|
var ref$1 = resolvePathAndOptions(arguments);
|
|
8750
8751
|
var dest = ref$1.resolvedPath;
|
|
8751
8752
|
var writeOptions = ref$1.options;
|
|
8752
|
-
function copydir(src$
|
|
8753
|
+
function copydir(src$1, dest$1) {
|
|
8753
8754
|
mkdirp$1.sync(dest$1);
|
|
8754
|
-
gracefulFs.readdirSync(src$
|
|
8755
|
-
var srcpath = src$
|
|
8755
|
+
gracefulFs.readdirSync(src$1).forEach(function(filename) {
|
|
8756
|
+
var srcpath = src$1 + path__default["default"].sep + filename;
|
|
8756
8757
|
var destpath = dest$1 + path__default["default"].sep + filename;
|
|
8757
8758
|
if (gracefulFs.statSync(srcpath).isDirectory()) return copydir(srcpath, destpath);
|
|
8758
8759
|
var data = gracefulFs.readFileSync(srcpath, readOptions);
|
|
8759
8760
|
gracefulFs.writeFileSync(destpath, data, writeOptions);
|
|
8760
8761
|
});
|
|
8761
8762
|
}
|
|
8762
|
-
copydir(src
|
|
8763
|
+
copydir(src, dest);
|
|
8763
8764
|
} };
|
|
8764
8765
|
}
|
|
8765
8766
|
function rimrafSync() {
|
|
@@ -8816,10 +8817,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8816
8817
|
function parse$1(str) {
|
|
8817
8818
|
str = String(str);
|
|
8818
8819
|
if (str.length > 100) return;
|
|
8819
|
-
var match
|
|
8820
|
-
if (!match
|
|
8821
|
-
var n = parseFloat(match
|
|
8822
|
-
switch ((match
|
|
8820
|
+
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);
|
|
8821
|
+
if (!match) return;
|
|
8822
|
+
var n = parseFloat(match[1]);
|
|
8823
|
+
switch ((match[2] || "ms").toLowerCase()) {
|
|
8823
8824
|
case "years":
|
|
8824
8825
|
case "year":
|
|
8825
8826
|
case "yrs":
|
|
@@ -8861,13 +8862,13 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8861
8862
|
* @return {String}
|
|
8862
8863
|
* @api private
|
|
8863
8864
|
*/
|
|
8864
|
-
function fmtShort(ms
|
|
8865
|
-
var msAbs = Math.abs(ms
|
|
8866
|
-
if (msAbs >= d) return Math.round(ms
|
|
8867
|
-
if (msAbs >= h) return Math.round(ms
|
|
8868
|
-
if (msAbs >= m) return Math.round(ms
|
|
8869
|
-
if (msAbs >= s) return Math.round(ms
|
|
8870
|
-
return ms
|
|
8865
|
+
function fmtShort(ms) {
|
|
8866
|
+
var msAbs = Math.abs(ms);
|
|
8867
|
+
if (msAbs >= d) return Math.round(ms / d) + "d";
|
|
8868
|
+
if (msAbs >= h) return Math.round(ms / h) + "h";
|
|
8869
|
+
if (msAbs >= m) return Math.round(ms / m) + "m";
|
|
8870
|
+
if (msAbs >= s) return Math.round(ms / s) + "s";
|
|
8871
|
+
return ms + "ms";
|
|
8871
8872
|
}
|
|
8872
8873
|
/**
|
|
8873
8874
|
* Long format for `ms`.
|
|
@@ -8876,26 +8877,26 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8876
8877
|
* @return {String}
|
|
8877
8878
|
* @api private
|
|
8878
8879
|
*/
|
|
8879
|
-
function fmtLong(ms
|
|
8880
|
-
var msAbs = Math.abs(ms
|
|
8881
|
-
if (msAbs >= d) return plural(ms
|
|
8882
|
-
if (msAbs >= h) return plural(ms
|
|
8883
|
-
if (msAbs >= m) return plural(ms
|
|
8884
|
-
if (msAbs >= s) return plural(ms
|
|
8885
|
-
return ms
|
|
8880
|
+
function fmtLong(ms) {
|
|
8881
|
+
var msAbs = Math.abs(ms);
|
|
8882
|
+
if (msAbs >= d) return plural(ms, msAbs, d, "day");
|
|
8883
|
+
if (msAbs >= h) return plural(ms, msAbs, h, "hour");
|
|
8884
|
+
if (msAbs >= m) return plural(ms, msAbs, m, "minute");
|
|
8885
|
+
if (msAbs >= s) return plural(ms, msAbs, s, "second");
|
|
8886
|
+
return ms + " ms";
|
|
8886
8887
|
}
|
|
8887
8888
|
/**
|
|
8888
8889
|
* Pluralization helper.
|
|
8889
8890
|
*/
|
|
8890
|
-
function plural(ms
|
|
8891
|
+
function plural(ms, msAbs, n, name) {
|
|
8891
8892
|
var isPlural = msAbs >= n * 1.5;
|
|
8892
|
-
return Math.round(ms
|
|
8893
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
8893
8894
|
}
|
|
8894
8895
|
/**
|
|
8895
8896
|
* This is the common logic for both the Node.js and web browser
|
|
8896
8897
|
* implementations of `debug()`.
|
|
8897
8898
|
*/
|
|
8898
|
-
function setup
|
|
8899
|
+
function setup(env) {
|
|
8899
8900
|
createDebug.debug = createDebug;
|
|
8900
8901
|
createDebug.default = createDebug;
|
|
8901
8902
|
createDebug.coerce = coerce;
|
|
@@ -8904,8 +8905,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8904
8905
|
createDebug.enabled = enabled;
|
|
8905
8906
|
createDebug.humanize = ms;
|
|
8906
8907
|
createDebug.destroy = destroy;
|
|
8907
|
-
Object.keys(env
|
|
8908
|
-
createDebug[key] = env
|
|
8908
|
+
Object.keys(env).forEach((key) => {
|
|
8909
|
+
createDebug[key] = env[key];
|
|
8909
8910
|
});
|
|
8910
8911
|
/**
|
|
8911
8912
|
* The currently active debug mode names, and names to skip.
|
|
@@ -8943,9 +8944,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8943
8944
|
function createDebug(namespace) {
|
|
8944
8945
|
let prevTime;
|
|
8945
8946
|
let enableOverride = null;
|
|
8946
|
-
function debug
|
|
8947
|
-
if (!debug
|
|
8948
|
-
const self$1 = debug
|
|
8947
|
+
function debug(...args) {
|
|
8948
|
+
if (!debug.enabled) return;
|
|
8949
|
+
const self$1 = debug;
|
|
8949
8950
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
8950
8951
|
self$1.diff = curr - (prevTime || curr);
|
|
8951
8952
|
self$1.prev = prevTime;
|
|
@@ -8953,28 +8954,28 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8953
8954
|
prevTime = curr;
|
|
8954
8955
|
args[0] = createDebug.coerce(args[0]);
|
|
8955
8956
|
if (typeof args[0] !== "string") args.unshift("%O");
|
|
8956
|
-
let index
|
|
8957
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match
|
|
8958
|
-
if (match
|
|
8959
|
-
index
|
|
8957
|
+
let index = 0;
|
|
8958
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
8959
|
+
if (match === "%%") return "%";
|
|
8960
|
+
index++;
|
|
8960
8961
|
const formatter = createDebug.formatters[format];
|
|
8961
8962
|
if (typeof formatter === "function") {
|
|
8962
|
-
const val = args[index
|
|
8963
|
-
match
|
|
8964
|
-
args.splice(index
|
|
8965
|
-
index
|
|
8963
|
+
const val = args[index];
|
|
8964
|
+
match = formatter.call(self$1, val);
|
|
8965
|
+
args.splice(index, 1);
|
|
8966
|
+
index--;
|
|
8966
8967
|
}
|
|
8967
|
-
return match
|
|
8968
|
+
return match;
|
|
8968
8969
|
});
|
|
8969
8970
|
createDebug.formatArgs.call(self$1, args);
|
|
8970
8971
|
(self$1.log || createDebug.log).apply(self$1, args);
|
|
8971
8972
|
}
|
|
8972
|
-
debug
|
|
8973
|
-
debug
|
|
8974
|
-
debug
|
|
8975
|
-
debug
|
|
8976
|
-
debug
|
|
8977
|
-
Object.defineProperty(debug
|
|
8973
|
+
debug.namespace = namespace;
|
|
8974
|
+
debug.useColors = createDebug.useColors();
|
|
8975
|
+
debug.color = createDebug.selectColor(namespace);
|
|
8976
|
+
debug.extend = extend;
|
|
8977
|
+
debug.destroy = createDebug.destroy;
|
|
8978
|
+
Object.defineProperty(debug, "enabled", {
|
|
8978
8979
|
enumerable: true,
|
|
8979
8980
|
configurable: false,
|
|
8980
8981
|
get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
|
|
@@ -8982,10 +8983,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
8982
8983
|
enableOverride = v;
|
|
8983
8984
|
}
|
|
8984
8985
|
});
|
|
8985
|
-
if (typeof createDebug.init === "function") createDebug.init(debug
|
|
8986
|
-
return debug
|
|
8986
|
+
if (typeof createDebug.init === "function") createDebug.init(debug);
|
|
8987
|
+
return debug;
|
|
8987
8988
|
}
|
|
8988
|
-
function extend
|
|
8989
|
+
function extend(namespace, delimiter$1) {
|
|
8989
8990
|
const newDebug = createDebug(this.namespace + (typeof delimiter$1 === "undefined" ? ":" : delimiter$1) + namespace);
|
|
8990
8991
|
newDebug.log = this.log;
|
|
8991
8992
|
return newDebug;
|
|
@@ -9002,11 +9003,11 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9002
9003
|
createDebug.names = [];
|
|
9003
9004
|
createDebug.skips = [];
|
|
9004
9005
|
let i;
|
|
9005
|
-
const split$
|
|
9006
|
-
const len = split$
|
|
9006
|
+
const split$1 = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
9007
|
+
const len = split$1.length;
|
|
9007
9008
|
for (i = 0; i < len; i++) {
|
|
9008
|
-
if (!split$
|
|
9009
|
-
namespaces = split$
|
|
9009
|
+
if (!split$1[i]) continue;
|
|
9010
|
+
namespaces = split$1[i].replace(/\*/g, ".*?");
|
|
9010
9011
|
if (namespaces[0] === "-") createDebug.skips.push(/* @__PURE__ */ new RegExp("^" + namespaces.substr(1) + "$"));
|
|
9011
9012
|
else createDebug.names.push(/* @__PURE__ */ new RegExp("^" + namespaces + "$"));
|
|
9012
9013
|
}
|
|
@@ -9068,7 +9069,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9068
9069
|
createDebug.enable(createDebug.load());
|
|
9069
9070
|
return createDebug;
|
|
9070
9071
|
}
|
|
9071
|
-
var common = setup
|
|
9072
|
+
var common = setup;
|
|
9072
9073
|
var browser = createCommonjsModule(function(module$1, exports$1) {
|
|
9073
9074
|
/**
|
|
9074
9075
|
* This is the web browser implementation of `debug()`.
|
|
@@ -9190,12 +9191,12 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9190
9191
|
if (!this.useColors) return;
|
|
9191
9192
|
const c = "color: " + this.color;
|
|
9192
9193
|
args.splice(1, 0, c, "color: inherit");
|
|
9193
|
-
let index
|
|
9194
|
+
let index = 0;
|
|
9194
9195
|
let lastC = 0;
|
|
9195
|
-
args[0].replace(/%[a-zA-Z%]/g, (match
|
|
9196
|
-
if (match
|
|
9197
|
-
index
|
|
9198
|
-
if (match
|
|
9196
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
9197
|
+
if (match === "%%") return;
|
|
9198
|
+
index++;
|
|
9199
|
+
if (match === "%c") lastC = index;
|
|
9199
9200
|
});
|
|
9200
9201
|
args.splice(lastC, 0, c);
|
|
9201
9202
|
}
|
|
@@ -9288,8 +9289,8 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9288
9289
|
1
|
|
9289
9290
|
];
|
|
9290
9291
|
try {
|
|
9291
|
-
const supportsColor
|
|
9292
|
-
if (supportsColor
|
|
9292
|
+
const supportsColor = supportsColor_1;
|
|
9293
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports$1.colors = [
|
|
9293
9294
|
20,
|
|
9294
9295
|
21,
|
|
9295
9296
|
26,
|
|
@@ -9443,10 +9444,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9443
9444
|
* Create a new `inspectOpts` object in case `useColors` is set
|
|
9444
9445
|
* differently for a particular `debug` instance.
|
|
9445
9446
|
*/
|
|
9446
|
-
function init(debug
|
|
9447
|
-
debug
|
|
9447
|
+
function init(debug) {
|
|
9448
|
+
debug.inspectOpts = {};
|
|
9448
9449
|
const keys = Object.keys(exports$1.inspectOpts);
|
|
9449
|
-
for (let i = 0; i < keys.length; i++) debug
|
|
9450
|
+
for (let i = 0; i < keys.length; i++) debug.inspectOpts[keys[i]] = exports$1.inspectOpts[keys[i]];
|
|
9450
9451
|
}
|
|
9451
9452
|
module$1.exports = common(exports$1);
|
|
9452
9453
|
const { formatters } = module$1.exports;
|
|
@@ -9475,10 +9476,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9475
9476
|
});
|
|
9476
9477
|
function promisify(fn) {
|
|
9477
9478
|
return function(req, opts) {
|
|
9478
|
-
return new Promise((resolve$
|
|
9479
|
+
return new Promise((resolve$1, reject) => {
|
|
9479
9480
|
fn.call(this, req, opts, (err, rtn) => {
|
|
9480
9481
|
if (err) reject(err);
|
|
9481
|
-
else resolve$
|
|
9482
|
+
else resolve$1(rtn);
|
|
9482
9483
|
});
|
|
9483
9484
|
});
|
|
9484
9485
|
};
|
|
@@ -9502,7 +9503,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9502
9503
|
function createAgent(callback, opts) {
|
|
9503
9504
|
return new createAgent.Agent(callback, opts);
|
|
9504
9505
|
}
|
|
9505
|
-
(function(createAgent
|
|
9506
|
+
(function(createAgent) {
|
|
9506
9507
|
/**
|
|
9507
9508
|
* Base `http.Agent` implementation.
|
|
9508
9509
|
* No pooling/keep-alive is implemented by default.
|
|
@@ -9631,15 +9632,15 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9631
9632
|
debug$2("Destroying agent %o", this.constructor.name);
|
|
9632
9633
|
}
|
|
9633
9634
|
}
|
|
9634
|
-
createAgent
|
|
9635
|
-
createAgent
|
|
9635
|
+
createAgent.Agent = Agent;
|
|
9636
|
+
createAgent.prototype = createAgent.Agent.prototype;
|
|
9636
9637
|
})(createAgent || (createAgent = {}));
|
|
9637
9638
|
var src = createAgent;
|
|
9638
9639
|
const debug$1 = (commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
|
9639
9640
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
9640
9641
|
})(src$1).default("https-proxy-agent:parse-proxy-response");
|
|
9641
9642
|
function parseProxyResponse(socket) {
|
|
9642
|
-
return new Promise((resolve$
|
|
9643
|
+
return new Promise((resolve$1, reject) => {
|
|
9643
9644
|
let buffersLength = 0;
|
|
9644
9645
|
const buffers = [];
|
|
9645
9646
|
function read() {
|
|
@@ -9676,7 +9677,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9676
9677
|
const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
|
|
9677
9678
|
const statusCode = +firstLine.split(" ")[1];
|
|
9678
9679
|
debug$1("got proxy server response: %o", firstLine);
|
|
9679
|
-
resolve$
|
|
9680
|
+
resolve$1({
|
|
9680
9681
|
statusCode,
|
|
9681
9682
|
buffered
|
|
9682
9683
|
});
|
|
@@ -9691,11 +9692,11 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9691
9692
|
var parseProxyResponse_1 = /* @__PURE__ */ Object.defineProperty({ default: _default$1 }, "__esModule", { value: true });
|
|
9692
9693
|
var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
9693
9694
|
function adopt(value) {
|
|
9694
|
-
return value instanceof P ? value : new P(function(resolve$
|
|
9695
|
-
resolve$
|
|
9695
|
+
return value instanceof P ? value : new P(function(resolve$1) {
|
|
9696
|
+
resolve$1(value);
|
|
9696
9697
|
});
|
|
9697
9698
|
}
|
|
9698
|
-
return new (P || (P = Promise))(function(resolve$
|
|
9699
|
+
return new (P || (P = Promise))(function(resolve$1, reject) {
|
|
9699
9700
|
function fulfilled(value) {
|
|
9700
9701
|
try {
|
|
9701
9702
|
step(generator.next(value));
|
|
@@ -9711,7 +9712,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9711
9712
|
}
|
|
9712
9713
|
}
|
|
9713
9714
|
function step(result) {
|
|
9714
|
-
result.done ? resolve$
|
|
9715
|
+
result.done ? resolve$1(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
9715
9716
|
}
|
|
9716
9717
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9717
9718
|
});
|
|
@@ -9804,11 +9805,11 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9804
9805
|
socket.destroy();
|
|
9805
9806
|
const fakeSocket = new net_1.default.Socket();
|
|
9806
9807
|
fakeSocket.readable = true;
|
|
9807
|
-
req.once("socket", (s
|
|
9808
|
+
req.once("socket", (s) => {
|
|
9808
9809
|
debug("replaying proxy buffer for failed request");
|
|
9809
|
-
assert_1.default(s
|
|
9810
|
-
s
|
|
9811
|
-
s
|
|
9810
|
+
assert_1.default(s.listenerCount("data") > 0);
|
|
9811
|
+
s.push(buffered);
|
|
9812
|
+
s.push(null);
|
|
9812
9813
|
});
|
|
9813
9814
|
return fakeSocket;
|
|
9814
9815
|
});
|
|
@@ -9837,9 +9838,9 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9837
9838
|
function createHttpsProxyAgent(opts) {
|
|
9838
9839
|
return new agent_1.default(opts);
|
|
9839
9840
|
}
|
|
9840
|
-
(function(createHttpsProxyAgent
|
|
9841
|
-
createHttpsProxyAgent
|
|
9842
|
-
createHttpsProxyAgent
|
|
9841
|
+
(function(createHttpsProxyAgent) {
|
|
9842
|
+
createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;
|
|
9843
|
+
createHttpsProxyAgent.prototype = agent_1.default.prototype;
|
|
9843
9844
|
})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
|
|
9844
9845
|
var dist = createHttpsProxyAgent;
|
|
9845
9846
|
const tmpDirName = "tmp";
|
|
@@ -9937,18 +9938,18 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9937
9938
|
}
|
|
9938
9939
|
const base = path__default["default"].join(homeOrTmp, ".degit");
|
|
9939
9940
|
const validModes = new Set(["tar", "git"]);
|
|
9940
|
-
function degit
|
|
9941
|
-
return new Degit(src
|
|
9941
|
+
function degit(src, opts) {
|
|
9942
|
+
return new Degit(src, opts);
|
|
9942
9943
|
}
|
|
9943
9944
|
var Degit = class extends Events__default["default"] {
|
|
9944
|
-
constructor(src
|
|
9945
|
+
constructor(src, opts = {}) {
|
|
9945
9946
|
super();
|
|
9946
|
-
this.src = src
|
|
9947
|
+
this.src = src;
|
|
9947
9948
|
this.cache = opts.cache;
|
|
9948
9949
|
this.force = opts.force;
|
|
9949
9950
|
this.verbose = opts.verbose;
|
|
9950
9951
|
this.proxy = process.env.https_proxy;
|
|
9951
|
-
this.repo = parse(src
|
|
9952
|
+
this.repo = parse(src);
|
|
9952
9953
|
this.mode = opts.mode || this.repo.mode;
|
|
9953
9954
|
if (!validModes.has(this.mode)) throw new Error(`Valid modes are ${Array.from(validModes).join(", ")}`);
|
|
9954
9955
|
this._hasStashed = false;
|
|
@@ -9962,14 +9963,14 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9962
9963
|
cache: action.cache,
|
|
9963
9964
|
verbose: action.verbose
|
|
9964
9965
|
});
|
|
9965
|
-
const d
|
|
9966
|
-
d
|
|
9966
|
+
const d = degit(action.src, opts$1);
|
|
9967
|
+
d.on("info", (event) => {
|
|
9967
9968
|
console.error(source.cyan(`> ${event.message.replace("options.", "--")}`));
|
|
9968
9969
|
});
|
|
9969
|
-
d
|
|
9970
|
+
d.on("warn", (event) => {
|
|
9970
9971
|
console.error(source.magenta(`! ${event.message.replace("options.", "--")}`));
|
|
9971
9972
|
});
|
|
9972
|
-
await d
|
|
9973
|
+
await d.clone(dest).catch((err) => {
|
|
9973
9974
|
console.error(source.red(`! ${err.message}`));
|
|
9974
9975
|
process.exit(1);
|
|
9975
9976
|
});
|
|
@@ -9997,7 +9998,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
9997
9998
|
});
|
|
9998
9999
|
const directives = this._getDirectives(dest);
|
|
9999
10000
|
if (directives) {
|
|
10000
|
-
for (const d
|
|
10001
|
+
for (const d of directives) await this.directiveActions[d.action](dir, dest, d);
|
|
10001
10002
|
if (this._hasStashed === true) unstashFiles(dir, dest);
|
|
10002
10003
|
}
|
|
10003
10004
|
}
|
|
@@ -10020,10 +10021,10 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
10020
10021
|
});
|
|
10021
10022
|
return null;
|
|
10022
10023
|
}
|
|
10023
|
-
}).filter((d
|
|
10024
|
+
}).filter((d) => d);
|
|
10024
10025
|
if (removedFiles.length > 0) this._info({
|
|
10025
10026
|
code: "REMOVED",
|
|
10026
|
-
message: `removed: ${source.bold(removedFiles.map((d
|
|
10027
|
+
message: `removed: ${source.bold(removedFiles.map((d) => source.bold(d)).join(", "))}`
|
|
10027
10028
|
});
|
|
10028
10029
|
}
|
|
10029
10030
|
_checkDirIsEmpty(dir) {
|
|
@@ -10138,15 +10139,15 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
10138
10139
|
"bitbucket",
|
|
10139
10140
|
"git.sr.ht"
|
|
10140
10141
|
]);
|
|
10141
|
-
function parse(src
|
|
10142
|
-
const match
|
|
10143
|
-
if (!match
|
|
10144
|
-
const site = (match
|
|
10142
|
+
function parse(src) {
|
|
10143
|
+
const match = /^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(src);
|
|
10144
|
+
if (!match) throw new DegitError(`could not parse ${src}`, { code: "BAD_SRC" });
|
|
10145
|
+
const site = (match[1] || match[2] || match[3] || "github").replace(/\.(com|org)$/, "");
|
|
10145
10146
|
if (!supported.has(site)) throw new DegitError(`degit supports GitHub, GitLab, Sourcehut and BitBucket`, { code: "UNSUPPORTED_HOST" });
|
|
10146
|
-
const user = match
|
|
10147
|
-
const name = match
|
|
10148
|
-
const subdir = match
|
|
10149
|
-
const ref = match
|
|
10147
|
+
const user = match[4];
|
|
10148
|
+
const name = match[5].replace(/\.git$/, "");
|
|
10149
|
+
const subdir = match[6];
|
|
10150
|
+
const ref = match[7] || "HEAD";
|
|
10150
10151
|
const domain = `${site}.${site === "bitbucket" ? "org" : site === "git.sr.ht" ? "" : "com"}`;
|
|
10151
10152
|
return {
|
|
10152
10153
|
site,
|
|
@@ -10175,11 +10176,11 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
10175
10176
|
type: "HEAD",
|
|
10176
10177
|
hash
|
|
10177
10178
|
};
|
|
10178
|
-
const match
|
|
10179
|
-
if (!match
|
|
10179
|
+
const match = /refs\/(\w+)\/(.+)/.exec(ref);
|
|
10180
|
+
if (!match) throw new DegitError(`could not parse ${ref}`, { code: "BAD_REF" });
|
|
10180
10181
|
return {
|
|
10181
|
-
type: match
|
|
10182
|
-
name: match
|
|
10182
|
+
type: match[1] === "heads" ? "branch" : match[1] === "refs" ? "ref" : match[1],
|
|
10183
|
+
name: match[2],
|
|
10183
10184
|
hash
|
|
10184
10185
|
};
|
|
10185
10186
|
});
|
|
@@ -10212,7 +10213,7 @@ while (this[PROCESSENTRY](this[QUEUE].shift()));
|
|
|
10212
10213
|
}
|
|
10213
10214
|
exports.base = base;
|
|
10214
10215
|
exports.createCommonjsModule = createCommonjsModule;
|
|
10215
|
-
exports.degit = degit
|
|
10216
|
+
exports.degit = degit;
|
|
10216
10217
|
exports.source = source;
|
|
10217
10218
|
exports.tryRequire = tryRequire;
|
|
10218
10219
|
}));
|
|
@@ -10246,16 +10247,16 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10246
10247
|
//#region ../../node_modules/.pnpm/through@2.3.8/node_modules/through/index.js
|
|
10247
10248
|
var require_through = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10248
10249
|
var Stream$4 = __require("stream");
|
|
10249
|
-
exports = module.exports = through
|
|
10250
|
-
through
|
|
10251
|
-
function through
|
|
10250
|
+
exports = module.exports = through;
|
|
10251
|
+
through.through = through;
|
|
10252
|
+
function through(write, end, opts) {
|
|
10252
10253
|
write = write || function(data) {
|
|
10253
10254
|
this.queue(data);
|
|
10254
10255
|
};
|
|
10255
10256
|
end = end || function() {
|
|
10256
10257
|
this.queue(null);
|
|
10257
10258
|
};
|
|
10258
|
-
var ended = false, destroyed = false, buffer = [], _ended
|
|
10259
|
+
var ended = false, destroyed = false, buffer = [], _ended = false;
|
|
10259
10260
|
var stream = new Stream$4();
|
|
10260
10261
|
stream.readable = stream.writable = true;
|
|
10261
10262
|
stream.paused = false;
|
|
@@ -10272,8 +10273,8 @@ var require_through = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10272
10273
|
}
|
|
10273
10274
|
}
|
|
10274
10275
|
stream.queue = stream.push = function(data) {
|
|
10275
|
-
if (_ended
|
|
10276
|
-
if (data === null) _ended
|
|
10276
|
+
if (_ended) return stream;
|
|
10277
|
+
if (data === null) _ended = true;
|
|
10277
10278
|
buffer.push(data);
|
|
10278
10279
|
drain();
|
|
10279
10280
|
return stream;
|
|
@@ -10327,51 +10328,51 @@ var require_through = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10327
10328
|
//#region ../../node_modules/.pnpm/from@0.1.7/node_modules/from/index.js
|
|
10328
10329
|
var require_from = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10329
10330
|
var Stream$3 = __require("stream");
|
|
10330
|
-
module.exports = function from$1(source
|
|
10331
|
-
if (Array.isArray(source
|
|
10332
|
-
var source_index = 0, source_len = source
|
|
10331
|
+
module.exports = function from$1(source) {
|
|
10332
|
+
if (Array.isArray(source)) {
|
|
10333
|
+
var source_index = 0, source_len = source.length;
|
|
10333
10334
|
return from$1(function(i$1) {
|
|
10334
|
-
if (source_index < source_len) this.emit("data", source
|
|
10335
|
+
if (source_index < source_len) this.emit("data", source[source_index++]);
|
|
10335
10336
|
else this.emit("end");
|
|
10336
10337
|
return true;
|
|
10337
10338
|
});
|
|
10338
10339
|
}
|
|
10339
|
-
var s
|
|
10340
|
-
s
|
|
10341
|
-
s
|
|
10342
|
-
s
|
|
10343
|
-
s
|
|
10344
|
-
s
|
|
10345
|
-
s
|
|
10346
|
-
s
|
|
10347
|
-
s
|
|
10348
|
-
s
|
|
10340
|
+
var s = new Stream$3(), i = 0;
|
|
10341
|
+
s.ended = false;
|
|
10342
|
+
s.started = false;
|
|
10343
|
+
s.readable = true;
|
|
10344
|
+
s.writable = false;
|
|
10345
|
+
s.paused = false;
|
|
10346
|
+
s.ended = false;
|
|
10347
|
+
s.pause = function() {
|
|
10348
|
+
s.started = true;
|
|
10349
|
+
s.paused = true;
|
|
10349
10350
|
};
|
|
10350
10351
|
function next() {
|
|
10351
|
-
s
|
|
10352
|
-
if (s
|
|
10353
|
-
while (!s
|
|
10354
|
-
if (!s
|
|
10352
|
+
s.started = true;
|
|
10353
|
+
if (s.ended) return;
|
|
10354
|
+
while (!s.ended && !s.paused && source.call(s, i++, function() {
|
|
10355
|
+
if (!s.ended && !s.paused) process.nextTick(next);
|
|
10355
10356
|
}));
|
|
10356
10357
|
}
|
|
10357
|
-
s
|
|
10358
|
-
s
|
|
10359
|
-
s
|
|
10358
|
+
s.resume = function() {
|
|
10359
|
+
s.started = true;
|
|
10360
|
+
s.paused = false;
|
|
10360
10361
|
next();
|
|
10361
10362
|
};
|
|
10362
|
-
s
|
|
10363
|
-
s
|
|
10364
|
-
s
|
|
10365
|
-
process.nextTick(s
|
|
10363
|
+
s.on("end", function() {
|
|
10364
|
+
s.ended = true;
|
|
10365
|
+
s.readable = false;
|
|
10366
|
+
process.nextTick(s.destroy);
|
|
10366
10367
|
});
|
|
10367
|
-
s
|
|
10368
|
-
s
|
|
10369
|
-
s
|
|
10368
|
+
s.destroy = function() {
|
|
10369
|
+
s.ended = true;
|
|
10370
|
+
s.emit("close");
|
|
10370
10371
|
};
|
|
10371
10372
|
process.nextTick(function() {
|
|
10372
|
-
if (!s
|
|
10373
|
+
if (!s.started) s.resume();
|
|
10373
10374
|
});
|
|
10374
|
-
return s
|
|
10375
|
+
return s;
|
|
10375
10376
|
};
|
|
10376
10377
|
}));
|
|
10377
10378
|
|
|
@@ -10387,12 +10388,12 @@ var require_duplexer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10387
10388
|
var readMethods = ["resume", "pause"];
|
|
10388
10389
|
var readEvents = ["data", "close"];
|
|
10389
10390
|
var slice = Array.prototype.slice;
|
|
10390
|
-
module.exports = duplex
|
|
10391
|
+
module.exports = duplex;
|
|
10391
10392
|
function forEach(arr, fn) {
|
|
10392
10393
|
if (arr.forEach) return arr.forEach(fn);
|
|
10393
10394
|
for (var i = 0; i < arr.length; i++) fn(arr[i], i);
|
|
10394
10395
|
}
|
|
10395
|
-
function duplex
|
|
10396
|
+
function duplex(writer, reader) {
|
|
10396
10397
|
var stream = new Stream$2();
|
|
10397
10398
|
var ended = false;
|
|
10398
10399
|
forEach(writeMethods, proxyWriter);
|
|
@@ -10533,10 +10534,10 @@ var require_pause_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10533
10534
|
//#endregion
|
|
10534
10535
|
//#region ../../node_modules/.pnpm/split@0.3.3/node_modules/split/index.js
|
|
10535
10536
|
var require_split = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10536
|
-
var through
|
|
10537
|
+
var through = require_through();
|
|
10537
10538
|
var Decoder = __require("string_decoder").StringDecoder;
|
|
10538
|
-
module.exports = split
|
|
10539
|
-
function split
|
|
10539
|
+
module.exports = split;
|
|
10540
|
+
function split(matcher, mapper, options) {
|
|
10540
10541
|
var decoder = new Decoder();
|
|
10541
10542
|
var soFar = "";
|
|
10542
10543
|
var maxLength = options && options.maxLength;
|
|
@@ -10561,7 +10562,7 @@ var require_split = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10561
10562
|
emit(stream, piece);
|
|
10562
10563
|
}
|
|
10563
10564
|
}
|
|
10564
|
-
return through
|
|
10565
|
+
return through(function(b) {
|
|
10565
10566
|
next(this, decoder.write(b));
|
|
10566
10567
|
}, function() {
|
|
10567
10568
|
if (decoder.end) next(this, decoder.end());
|
|
@@ -10719,11 +10720,11 @@ var require_event_stream = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10719
10720
|
};
|
|
10720
10721
|
return stream;
|
|
10721
10722
|
};
|
|
10722
|
-
es$1.mapSync = function(sync
|
|
10723
|
+
es$1.mapSync = function(sync) {
|
|
10723
10724
|
return es$1.through(function write(data) {
|
|
10724
10725
|
var mappedData;
|
|
10725
10726
|
try {
|
|
10726
|
-
mappedData = sync
|
|
10727
|
+
mappedData = sync(data);
|
|
10727
10728
|
} catch (err) {
|
|
10728
10729
|
return this.emit("error", err);
|
|
10729
10730
|
}
|
|
@@ -10792,18 +10793,18 @@ var require_event_stream = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10792
10793
|
//#endregion
|
|
10793
10794
|
//#region ../../node_modules/.pnpm/ps-tree@1.2.0/node_modules/ps-tree/index.js
|
|
10794
10795
|
var require_ps_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10795
|
-
var spawn = __require("child_process").spawn, es = require_event_stream();
|
|
10796
|
+
var spawn$1 = __require("child_process").spawn, es = require_event_stream();
|
|
10796
10797
|
module.exports = function childrenOfPid(pid, callback) {
|
|
10797
10798
|
var headers = null;
|
|
10798
10799
|
if (typeof callback !== "function") throw new Error("childrenOfPid(pid, callback) expects callback");
|
|
10799
10800
|
if (typeof pid === "number") pid = pid.toString();
|
|
10800
10801
|
var processLister;
|
|
10801
|
-
if (process.platform === "win32") processLister = spawn("wmic.exe", [
|
|
10802
|
+
if (process.platform === "win32") processLister = spawn$1("wmic.exe", [
|
|
10802
10803
|
"PROCESS",
|
|
10803
10804
|
"GET",
|
|
10804
10805
|
"Name,ProcessId,ParentProcessId,Status"
|
|
10805
10806
|
]);
|
|
10806
|
-
else processLister = spawn("ps", [
|
|
10807
|
+
else processLister = spawn$1("ps", [
|
|
10807
10808
|
"-A",
|
|
10808
10809
|
"-o",
|
|
10809
10810
|
"ppid,pid,stat,comm"
|
|
@@ -10816,8 +10817,8 @@ var require_ps_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10816
10817
|
return cb();
|
|
10817
10818
|
}
|
|
10818
10819
|
var row = {};
|
|
10819
|
-
var h
|
|
10820
|
-
while (h
|
|
10820
|
+
var h = headers.slice();
|
|
10821
|
+
while (h.length) row[h.shift()] = h.length ? columns.shift() : columns.join(" ");
|
|
10821
10822
|
return cb(null, row);
|
|
10822
10823
|
}), es.writeArray(function(err, ps) {
|
|
10823
10824
|
var parents = {}, children = [];
|
|
@@ -10853,16 +10854,22 @@ var require_ps_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10853
10854
|
//#region lib/testing.ts
|
|
10854
10855
|
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
10855
10856
|
var import_ps_tree = /* @__PURE__ */ __toESM(require_ps_tree(), 1);
|
|
10857
|
+
const variants = [
|
|
10858
|
+
"kit-js",
|
|
10859
|
+
"kit-ts",
|
|
10860
|
+
"vite-js",
|
|
10861
|
+
"vite-ts"
|
|
10862
|
+
];
|
|
10856
10863
|
const TEMPLATES_DIR = ".templates";
|
|
10857
|
-
async function setup({ cwd: cwd$
|
|
10858
|
-
const workingDir = path.resolve(cwd$
|
|
10864
|
+
async function setup({ cwd: cwd$1, clean = false, variants: variants$1 }) {
|
|
10865
|
+
const workingDir = path.resolve(cwd$1);
|
|
10859
10866
|
if (clean && fs.existsSync(workingDir)) fs.rmSync(workingDir, {
|
|
10860
10867
|
force: true,
|
|
10861
10868
|
recursive: true
|
|
10862
10869
|
});
|
|
10863
10870
|
const templatesDir = path.resolve(workingDir, TEMPLATES_DIR);
|
|
10864
10871
|
fs.mkdirSync(templatesDir, { recursive: true });
|
|
10865
|
-
for (const variant of variants) {
|
|
10872
|
+
for (const variant of variants$1) {
|
|
10866
10873
|
const templatePath = path.resolve(templatesDir, variant);
|
|
10867
10874
|
if (fs.existsSync(templatePath)) continue;
|
|
10868
10875
|
if (variant === "kit-js") create(templatePath, {
|
|
@@ -10886,8 +10893,8 @@ async function setup({ cwd: cwd$2, clean = false, variants }) {
|
|
|
10886
10893
|
}
|
|
10887
10894
|
return { templatesDir };
|
|
10888
10895
|
}
|
|
10889
|
-
function createProject({ cwd: cwd$
|
|
10890
|
-
const testDir = path.resolve(cwd$
|
|
10896
|
+
function createProject({ cwd: cwd$1, testName, templatesDir }) {
|
|
10897
|
+
const testDir = path.resolve(cwd$1, testName);
|
|
10891
10898
|
fs.mkdirSync(testDir, { recursive: true });
|
|
10892
10899
|
return ({ testId, variant, clean = true }) => {
|
|
10893
10900
|
const targetDir = path.resolve(testDir, testId);
|
|
@@ -10903,27 +10910,27 @@ function createProject({ cwd: cwd$2, testName, templatesDir }) {
|
|
|
10903
10910
|
return targetDir;
|
|
10904
10911
|
};
|
|
10905
10912
|
}
|
|
10906
|
-
async function startPreview({ cwd: cwd$
|
|
10913
|
+
async function startPreview({ cwd: cwd$1, command = "npm run preview" }) {
|
|
10907
10914
|
const [cmd, ...args] = command.split(" ");
|
|
10908
10915
|
const proc = q(cmd, args, {
|
|
10909
10916
|
nodeOptions: {
|
|
10910
|
-
cwd: cwd$
|
|
10917
|
+
cwd: cwd$1,
|
|
10911
10918
|
stdio: "pipe"
|
|
10912
10919
|
},
|
|
10913
10920
|
throwOnError: true,
|
|
10914
|
-
timeout:
|
|
10921
|
+
timeout: 66999
|
|
10915
10922
|
});
|
|
10916
10923
|
const close = async () => {
|
|
10917
10924
|
if (!proc.pid) return;
|
|
10918
10925
|
await terminate(proc.pid);
|
|
10919
10926
|
};
|
|
10920
|
-
return await new Promise((resolve$
|
|
10927
|
+
return await new Promise((resolve$1, reject) => {
|
|
10921
10928
|
if (!proc.process?.stdout) return reject("impossible state");
|
|
10922
10929
|
proc.process.stdout.on("data", (data) => {
|
|
10923
10930
|
const urls = data.toString().replace(/[^\x20-\xaf]+/g, "").replace(/\[[0-9]{1,2}m/g, "").match(/http:\/\/[^:\s]+:[0-9]+\//g);
|
|
10924
10931
|
if (urls && urls.length > 0) {
|
|
10925
10932
|
const url = urls[0];
|
|
10926
|
-
resolve$
|
|
10933
|
+
resolve$1({
|
|
10927
10934
|
url,
|
|
10928
10935
|
close
|
|
10929
10936
|
});
|
|
@@ -10961,6 +10968,42 @@ function kill(pid) {
|
|
|
10961
10968
|
process$1.kill(pid);
|
|
10962
10969
|
} catch {}
|
|
10963
10970
|
}
|
|
10971
|
+
function setupGlobal({ TEST_DIR, pre, post }) {
|
|
10972
|
+
return async function({ provide }) {
|
|
10973
|
+
await pre?.();
|
|
10974
|
+
const { templatesDir } = await setup({
|
|
10975
|
+
cwd: TEST_DIR,
|
|
10976
|
+
variants
|
|
10977
|
+
});
|
|
10978
|
+
provide("testDir", TEST_DIR);
|
|
10979
|
+
provide("templatesDir", templatesDir);
|
|
10980
|
+
provide("variants", variants);
|
|
10981
|
+
return async () => {
|
|
10982
|
+
await post?.();
|
|
10983
|
+
};
|
|
10984
|
+
};
|
|
10985
|
+
}
|
|
10986
|
+
async function prepareServer({ cwd: cwd$1, page, buildCommand = "pnpm build", previewCommand = "pnpm preview" }) {
|
|
10987
|
+
if (buildCommand) execSync(buildCommand, {
|
|
10988
|
+
cwd: cwd$1,
|
|
10989
|
+
stdio: "pipe"
|
|
10990
|
+
});
|
|
10991
|
+
const { url, close } = await startPreview({
|
|
10992
|
+
cwd: cwd$1,
|
|
10993
|
+
command: previewCommand
|
|
10994
|
+
});
|
|
10995
|
+
page.setDefaultNavigationTimeout(62e3);
|
|
10996
|
+
try {
|
|
10997
|
+
await page.goto(url);
|
|
10998
|
+
} catch (e) {
|
|
10999
|
+
await close();
|
|
11000
|
+
throw e;
|
|
11001
|
+
}
|
|
11002
|
+
return {
|
|
11003
|
+
url,
|
|
11004
|
+
close
|
|
11005
|
+
};
|
|
11006
|
+
}
|
|
10964
11007
|
|
|
10965
11008
|
//#endregion
|
|
10966
|
-
export { addPnpmBuildDependencies, createProject, setup, startPreview };
|
|
11009
|
+
export { addPnpmBuildDependencies, createProject, prepareServer, setup, setupGlobal, startPreview, variants };
|