@parcel/utils 2.10.3 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +389 -286
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/PromiseQueue.js +13 -0
- package/test/PromiseQueue.test.js +28 -0
package/lib/index.js
CHANGED
|
@@ -1119,7 +1119,18 @@ var $9kveb = parcelRequire("9kveb");
|
|
|
1119
1119
|
let extglobStar = star;
|
|
1120
1120
|
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
|
|
1121
1121
|
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
|
|
1122
|
-
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest))
|
|
1122
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
1123
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
1124
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
1125
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
1126
|
+
//
|
|
1127
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
1128
|
+
const expression = $8b2f0c2eaecf2312$var$parse(rest, {
|
|
1129
|
+
...options,
|
|
1130
|
+
fastpaths: false
|
|
1131
|
+
}).output;
|
|
1132
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
1133
|
+
}
|
|
1123
1134
|
if (token.prev.type === "bos") state.negatedExtglob = true;
|
|
1124
1135
|
}
|
|
1125
1136
|
push({
|
|
@@ -1168,7 +1179,7 @@ var $9kveb = parcelRequire("9kveb");
|
|
|
1168
1179
|
* Tokenize input until we reach end-of-string
|
|
1169
1180
|
*/ while(!eos()){
|
|
1170
1181
|
value = advance();
|
|
1171
|
-
if (value === "\
|
|
1182
|
+
if (value === "\0") continue;
|
|
1172
1183
|
/**
|
|
1173
1184
|
* Escaped characters
|
|
1174
1185
|
*/ if (value === "\\") {
|
|
@@ -1854,19 +1865,19 @@ parcelRegister("2nj4a", function(module, exports) {
|
|
|
1854
1865
|
/* eslint-disable no-new-wrappers, no-eval, camelcase, operator-linebreak */ module.exports = makeParserClass((parcelRequire("ibqqh")));
|
|
1855
1866
|
module.exports.makeParserClass = makeParserClass;
|
|
1856
1867
|
class TomlError extends Error {
|
|
1857
|
-
constructor(
|
|
1858
|
-
super(
|
|
1868
|
+
constructor(msg){
|
|
1869
|
+
super(msg);
|
|
1859
1870
|
this.name = "TomlError";
|
|
1860
1871
|
/* istanbul ignore next */ if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError);
|
|
1861
1872
|
this.fromTOML = true;
|
|
1862
1873
|
this.wrapped = null;
|
|
1863
1874
|
}
|
|
1864
1875
|
}
|
|
1865
|
-
TomlError.wrap = (
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
return
|
|
1876
|
+
TomlError.wrap = (err)=>{
|
|
1877
|
+
const terr = new TomlError(err.message);
|
|
1878
|
+
terr.code = err.code;
|
|
1879
|
+
terr.wrapped = err;
|
|
1880
|
+
return terr;
|
|
1870
1881
|
};
|
|
1871
1882
|
module.exports.TomlError = TomlError;
|
|
1872
1883
|
|
|
@@ -1934,23 +1945,23 @@ const escapes = {
|
|
|
1934
1945
|
[CHAR_QUOT]: '"',
|
|
1935
1946
|
[CHAR_BSOL]: "\\"
|
|
1936
1947
|
};
|
|
1937
|
-
function isDigit(
|
|
1938
|
-
return
|
|
1948
|
+
function isDigit(cp) {
|
|
1949
|
+
return cp >= CHAR_0 && cp <= CHAR_9;
|
|
1939
1950
|
}
|
|
1940
|
-
function isHexit(
|
|
1941
|
-
return
|
|
1951
|
+
function isHexit(cp) {
|
|
1952
|
+
return cp >= CHAR_A && cp <= CHAR_F || cp >= CHAR_a && cp <= CHAR_f || cp >= CHAR_0 && cp <= CHAR_9;
|
|
1942
1953
|
}
|
|
1943
|
-
function isBit(
|
|
1944
|
-
return
|
|
1954
|
+
function isBit(cp) {
|
|
1955
|
+
return cp === CHAR_1 || cp === CHAR_0;
|
|
1945
1956
|
}
|
|
1946
|
-
function isOctit(
|
|
1947
|
-
return
|
|
1957
|
+
function isOctit(cp) {
|
|
1958
|
+
return cp >= CHAR_0 && cp <= CHAR_7;
|
|
1948
1959
|
}
|
|
1949
|
-
function isAlphaNumQuoteHyphen(
|
|
1950
|
-
return
|
|
1960
|
+
function isAlphaNumQuoteHyphen(cp) {
|
|
1961
|
+
return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_APOS || cp === CHAR_QUOT || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
|
|
1951
1962
|
}
|
|
1952
|
-
function isAlphaNumHyphen(
|
|
1953
|
-
return
|
|
1963
|
+
function isAlphaNumHyphen(cp) {
|
|
1964
|
+
return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
|
|
1954
1965
|
}
|
|
1955
1966
|
const _type = Symbol("type");
|
|
1956
1967
|
const _declared = Symbol("declared");
|
|
@@ -1962,9 +1973,9 @@ const descriptor = {
|
|
|
1962
1973
|
writable: true,
|
|
1963
1974
|
value: undefined
|
|
1964
1975
|
};
|
|
1965
|
-
function hasKey(
|
|
1966
|
-
if (hasOwnProperty.call(
|
|
1967
|
-
if (
|
|
1976
|
+
function hasKey(obj, key) {
|
|
1977
|
+
if (hasOwnProperty.call(obj, key)) return true;
|
|
1978
|
+
if (key === "__proto__") defineProperty(obj, "__proto__", descriptor);
|
|
1968
1979
|
return false;
|
|
1969
1980
|
}
|
|
1970
1981
|
const INLINE_TABLE = Symbol("inline-table");
|
|
@@ -1975,9 +1986,9 @@ function InlineTable() {
|
|
|
1975
1986
|
}
|
|
1976
1987
|
});
|
|
1977
1988
|
}
|
|
1978
|
-
function isInlineTable(
|
|
1979
|
-
if (
|
|
1980
|
-
return
|
|
1989
|
+
function isInlineTable(obj) {
|
|
1990
|
+
if (obj === null || typeof obj !== "object") return false;
|
|
1991
|
+
return obj[_type] === INLINE_TABLE;
|
|
1981
1992
|
}
|
|
1982
1993
|
const TABLE = Symbol("table");
|
|
1983
1994
|
function Table() {
|
|
@@ -1991,25 +2002,25 @@ function Table() {
|
|
|
1991
2002
|
}
|
|
1992
2003
|
});
|
|
1993
2004
|
}
|
|
1994
|
-
function isTable(
|
|
1995
|
-
if (
|
|
1996
|
-
return
|
|
2005
|
+
function isTable(obj) {
|
|
2006
|
+
if (obj === null || typeof obj !== "object") return false;
|
|
2007
|
+
return obj[_type] === TABLE;
|
|
1997
2008
|
}
|
|
1998
2009
|
const _contentType = Symbol("content-type");
|
|
1999
2010
|
const INLINE_LIST = Symbol("inline-list");
|
|
2000
|
-
function InlineList(
|
|
2011
|
+
function InlineList(type) {
|
|
2001
2012
|
return Object.defineProperties([], {
|
|
2002
2013
|
[_type]: {
|
|
2003
2014
|
value: INLINE_LIST
|
|
2004
2015
|
},
|
|
2005
2016
|
[_contentType]: {
|
|
2006
|
-
value:
|
|
2017
|
+
value: type
|
|
2007
2018
|
}
|
|
2008
2019
|
});
|
|
2009
2020
|
}
|
|
2010
|
-
function isInlineList(
|
|
2011
|
-
if (
|
|
2012
|
-
return
|
|
2021
|
+
function isInlineList(obj) {
|
|
2022
|
+
if (obj === null || typeof obj !== "object") return false;
|
|
2023
|
+
return obj[_type] === INLINE_LIST;
|
|
2013
2024
|
}
|
|
2014
2025
|
const LIST = Symbol("list");
|
|
2015
2026
|
function List() {
|
|
@@ -2019,9 +2030,9 @@ function List() {
|
|
|
2019
2030
|
}
|
|
2020
2031
|
});
|
|
2021
2032
|
}
|
|
2022
|
-
function isList(
|
|
2023
|
-
if (
|
|
2024
|
-
return
|
|
2033
|
+
function isList(obj) {
|
|
2034
|
+
if (obj === null || typeof obj !== "object") return false;
|
|
2035
|
+
return obj[_type] === LIST;
|
|
2025
2036
|
}
|
|
2026
2037
|
// in an eval, to let bundlers not slurp in a util proxy
|
|
2027
2038
|
let _custom;
|
|
@@ -2032,10 +2043,10 @@ try {
|
|
|
2032
2043
|
/* eval require not available in transpiled bundle */ }
|
|
2033
2044
|
/* istanbul ignore next */ const _inspect = _custom || "inspect";
|
|
2034
2045
|
class BoxedBigInt {
|
|
2035
|
-
constructor(
|
|
2046
|
+
constructor(value){
|
|
2036
2047
|
try {
|
|
2037
|
-
this.value = $parcel$global.BigInt.asIntN(64,
|
|
2038
|
-
} catch (
|
|
2048
|
+
this.value = $parcel$global.BigInt.asIntN(64, value);
|
|
2049
|
+
} catch (_) {
|
|
2039
2050
|
/* istanbul ignore next */ this.value = null;
|
|
2040
2051
|
}
|
|
2041
2052
|
Object.defineProperty(this, _type, {
|
|
@@ -2056,12 +2067,12 @@ class BoxedBigInt {
|
|
|
2056
2067
|
}
|
|
2057
2068
|
}
|
|
2058
2069
|
const INTEGER = Symbol("integer");
|
|
2059
|
-
function Integer(
|
|
2060
|
-
let
|
|
2070
|
+
function Integer(value) {
|
|
2071
|
+
let num = Number(value);
|
|
2061
2072
|
// -0 is a float thing, not an int thing
|
|
2062
|
-
if (Object.is(
|
|
2063
|
-
/* istanbul ignore else */ if ($parcel$global.BigInt && !Number.isSafeInteger(
|
|
2064
|
-
else /* istanbul ignore next */ return Object.defineProperties(new Number(
|
|
2073
|
+
if (Object.is(num, -0)) num = 0;
|
|
2074
|
+
/* istanbul ignore else */ if ($parcel$global.BigInt && !Number.isSafeInteger(num)) return new BoxedBigInt(value);
|
|
2075
|
+
else /* istanbul ignore next */ return Object.defineProperties(new Number(num), {
|
|
2065
2076
|
isNaN: {
|
|
2066
2077
|
value: function() {
|
|
2067
2078
|
return isNaN(this);
|
|
@@ -2071,35 +2082,35 @@ function Integer(value11) {
|
|
|
2071
2082
|
value: INTEGER
|
|
2072
2083
|
},
|
|
2073
2084
|
[_inspect]: {
|
|
2074
|
-
value: ()=>`[Integer: ${
|
|
2085
|
+
value: ()=>`[Integer: ${value}]`
|
|
2075
2086
|
}
|
|
2076
2087
|
});
|
|
2077
2088
|
}
|
|
2078
|
-
function isInteger(
|
|
2079
|
-
if (
|
|
2080
|
-
return
|
|
2089
|
+
function isInteger(obj) {
|
|
2090
|
+
if (obj === null || typeof obj !== "object") return false;
|
|
2091
|
+
return obj[_type] === INTEGER;
|
|
2081
2092
|
}
|
|
2082
2093
|
const FLOAT = Symbol("float");
|
|
2083
|
-
function Float(
|
|
2084
|
-
/* istanbul ignore next */ return Object.defineProperties(new Number(
|
|
2094
|
+
function Float(value) {
|
|
2095
|
+
/* istanbul ignore next */ return Object.defineProperties(new Number(value), {
|
|
2085
2096
|
[_type]: {
|
|
2086
2097
|
value: FLOAT
|
|
2087
2098
|
},
|
|
2088
2099
|
[_inspect]: {
|
|
2089
|
-
value: ()=>`[Float: ${
|
|
2100
|
+
value: ()=>`[Float: ${value}]`
|
|
2090
2101
|
}
|
|
2091
2102
|
});
|
|
2092
2103
|
}
|
|
2093
|
-
function isFloat(
|
|
2094
|
-
if (
|
|
2095
|
-
return
|
|
2104
|
+
function isFloat(obj) {
|
|
2105
|
+
if (obj === null || typeof obj !== "object") return false;
|
|
2106
|
+
return obj[_type] === FLOAT;
|
|
2096
2107
|
}
|
|
2097
|
-
function tomlType(
|
|
2098
|
-
const
|
|
2099
|
-
if (
|
|
2100
|
-
/* istanbul ignore if */ if (
|
|
2101
|
-
if (
|
|
2102
|
-
/* istanbul ignore else */ if (_type in
|
|
2108
|
+
function tomlType(value) {
|
|
2109
|
+
const type = typeof value;
|
|
2110
|
+
if (type === "object") {
|
|
2111
|
+
/* istanbul ignore if */ if (value === null) return "null";
|
|
2112
|
+
if (value instanceof Date) return "datetime";
|
|
2113
|
+
/* istanbul ignore else */ if (_type in value) switch(value[_type]){
|
|
2103
2114
|
case INLINE_TABLE:
|
|
2104
2115
|
return "inline-table";
|
|
2105
2116
|
case INLINE_LIST:
|
|
@@ -2114,10 +2125,10 @@ function tomlType(value11) {
|
|
|
2114
2125
|
return "integer";
|
|
2115
2126
|
}
|
|
2116
2127
|
}
|
|
2117
|
-
return
|
|
2128
|
+
return type;
|
|
2118
2129
|
}
|
|
2119
|
-
function makeParserClass(
|
|
2120
|
-
class
|
|
2130
|
+
function makeParserClass(Parser) {
|
|
2131
|
+
class TOMLParser extends Parser {
|
|
2121
2132
|
constructor(){
|
|
2122
2133
|
super();
|
|
2123
2134
|
this.ctx = this.obj = Table();
|
|
@@ -2126,10 +2137,10 @@ function makeParserClass(Parser11) {
|
|
|
2126
2137
|
return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine();
|
|
2127
2138
|
}
|
|
2128
2139
|
atEndOfLine() {
|
|
2129
|
-
return this.char ===
|
|
2140
|
+
return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M;
|
|
2130
2141
|
}
|
|
2131
2142
|
parseStart() {
|
|
2132
|
-
if (this.char ===
|
|
2143
|
+
if (this.char === Parser.END) return null;
|
|
2133
2144
|
else if (this.char === CHAR_LSQB) return this.call(this.parseTableOrList);
|
|
2134
2145
|
else if (this.char === CHAR_NUM) return this.call(this.parseComment);
|
|
2135
2146
|
else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) return null;
|
|
@@ -2141,32 +2152,32 @@ function makeParserClass(Parser11) {
|
|
|
2141
2152
|
parseWhitespaceToEOL() {
|
|
2142
2153
|
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) return null;
|
|
2143
2154
|
else if (this.char === CHAR_NUM) return this.goto(this.parseComment);
|
|
2144
|
-
else if (this.char ===
|
|
2155
|
+
else if (this.char === Parser.END || this.char === CTRL_J) return this.return();
|
|
2145
2156
|
else throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"));
|
|
2146
2157
|
}
|
|
2147
2158
|
/* ASSIGNMENT: key = value */ parseAssignStatement() {
|
|
2148
2159
|
return this.callNow(this.parseAssign, this.recordAssignStatement);
|
|
2149
2160
|
}
|
|
2150
|
-
recordAssignStatement(
|
|
2151
|
-
let
|
|
2152
|
-
let
|
|
2153
|
-
for (let
|
|
2154
|
-
if (hasKey(
|
|
2155
|
-
|
|
2161
|
+
recordAssignStatement(kv) {
|
|
2162
|
+
let target = this.ctx;
|
|
2163
|
+
let finalKey = kv.key.pop();
|
|
2164
|
+
for (let kw of kv.key){
|
|
2165
|
+
if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) throw this.error(new TomlError("Can't redefine existing key"));
|
|
2166
|
+
target = target[kw] = target[kw] || Table();
|
|
2156
2167
|
}
|
|
2157
|
-
if (hasKey(
|
|
2168
|
+
if (hasKey(target, finalKey)) throw this.error(new TomlError("Can't redefine existing key"));
|
|
2158
2169
|
// unbox our numbers
|
|
2159
|
-
if (isInteger(
|
|
2160
|
-
else
|
|
2170
|
+
if (isInteger(kv.value) || isFloat(kv.value)) target[finalKey] = kv.value.valueOf();
|
|
2171
|
+
else target[finalKey] = kv.value;
|
|
2161
2172
|
return this.goto(this.parseWhitespaceToEOL);
|
|
2162
2173
|
}
|
|
2163
2174
|
/* ASSSIGNMENT expression, key = value possibly inside an inline table */ parseAssign() {
|
|
2164
2175
|
return this.callNow(this.parseKeyword, this.recordAssignKeyword);
|
|
2165
2176
|
}
|
|
2166
|
-
recordAssignKeyword(
|
|
2167
|
-
if (this.state.resultTable) this.state.resultTable.push(
|
|
2177
|
+
recordAssignKeyword(key) {
|
|
2178
|
+
if (this.state.resultTable) this.state.resultTable.push(key);
|
|
2168
2179
|
else this.state.resultTable = [
|
|
2169
|
-
|
|
2180
|
+
key
|
|
2170
2181
|
];
|
|
2171
2182
|
return this.goto(this.parseAssignKeywordPreDot);
|
|
2172
2183
|
}
|
|
@@ -2185,15 +2196,15 @@ function makeParserClass(Parser11) {
|
|
|
2185
2196
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2186
2197
|
else return this.callNow(this.parseValue, this.recordAssignValue);
|
|
2187
2198
|
}
|
|
2188
|
-
recordAssignValue(
|
|
2199
|
+
recordAssignValue(value) {
|
|
2189
2200
|
return this.returnNow({
|
|
2190
2201
|
key: this.state.resultTable,
|
|
2191
|
-
value:
|
|
2202
|
+
value: value
|
|
2192
2203
|
});
|
|
2193
2204
|
}
|
|
2194
2205
|
/* COMMENTS: #...eol */ parseComment() {
|
|
2195
2206
|
do {
|
|
2196
|
-
if (this.char ===
|
|
2207
|
+
if (this.char === Parser.END || this.char === CTRL_J) return this.return();
|
|
2197
2208
|
}while (this.nextChar());
|
|
2198
2209
|
}
|
|
2199
2210
|
/* TABLES AND LISTS, [foo] and [[foo]] */ parseTableOrList() {
|
|
@@ -2208,19 +2219,19 @@ function makeParserClass(Parser11) {
|
|
|
2208
2219
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2209
2220
|
else return this.callNow(this.parseKeyword, this.parseTableMore);
|
|
2210
2221
|
}
|
|
2211
|
-
parseTableMore(
|
|
2222
|
+
parseTableMore(keyword) {
|
|
2212
2223
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2213
2224
|
else if (this.char === CHAR_RSQB) {
|
|
2214
|
-
if (hasKey(this.ctx,
|
|
2225
|
+
if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) throw this.error(new TomlError("Can't redefine existing key"));
|
|
2215
2226
|
else {
|
|
2216
|
-
this.ctx = this.ctx[
|
|
2227
|
+
this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table();
|
|
2217
2228
|
this.ctx[_declared] = true;
|
|
2218
2229
|
}
|
|
2219
2230
|
return this.next(this.parseWhitespaceToEOL);
|
|
2220
2231
|
} else if (this.char === CHAR_PERIOD) {
|
|
2221
|
-
if (!hasKey(this.ctx,
|
|
2222
|
-
else if (isTable(this.ctx[
|
|
2223
|
-
else if (isList(this.ctx[
|
|
2232
|
+
if (!hasKey(this.ctx, keyword)) this.ctx = this.ctx[keyword] = Table();
|
|
2233
|
+
else if (isTable(this.ctx[keyword])) this.ctx = this.ctx[keyword];
|
|
2234
|
+
else if (isList(this.ctx[keyword])) this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
|
|
2224
2235
|
else throw this.error(new TomlError("Can't redefine existing key"));
|
|
2225
2236
|
return this.next(this.parseTableNext);
|
|
2226
2237
|
} else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
|
|
@@ -2233,33 +2244,33 @@ function makeParserClass(Parser11) {
|
|
|
2233
2244
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2234
2245
|
else return this.callNow(this.parseKeyword, this.parseListMore);
|
|
2235
2246
|
}
|
|
2236
|
-
parseListMore(
|
|
2247
|
+
parseListMore(keyword) {
|
|
2237
2248
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2238
2249
|
else if (this.char === CHAR_RSQB) {
|
|
2239
|
-
if (!hasKey(this.ctx,
|
|
2240
|
-
if (isInlineList(this.ctx[
|
|
2241
|
-
else if (isList(this.ctx[
|
|
2242
|
-
const
|
|
2243
|
-
this.ctx[
|
|
2244
|
-
this.ctx =
|
|
2250
|
+
if (!hasKey(this.ctx, keyword)) this.ctx[keyword] = List();
|
|
2251
|
+
if (isInlineList(this.ctx[keyword])) throw this.error(new TomlError("Can't extend an inline array"));
|
|
2252
|
+
else if (isList(this.ctx[keyword])) {
|
|
2253
|
+
const next = Table();
|
|
2254
|
+
this.ctx[keyword].push(next);
|
|
2255
|
+
this.ctx = next;
|
|
2245
2256
|
} else throw this.error(new TomlError("Can't redefine an existing key"));
|
|
2246
2257
|
return this.next(this.parseListEnd);
|
|
2247
2258
|
} else if (this.char === CHAR_PERIOD) {
|
|
2248
|
-
if (!hasKey(this.ctx,
|
|
2249
|
-
else if (isInlineList(this.ctx[
|
|
2250
|
-
else if (isInlineTable(this.ctx[
|
|
2251
|
-
else if (isList(this.ctx[
|
|
2252
|
-
else if (isTable(this.ctx[
|
|
2259
|
+
if (!hasKey(this.ctx, keyword)) this.ctx = this.ctx[keyword] = Table();
|
|
2260
|
+
else if (isInlineList(this.ctx[keyword])) throw this.error(new TomlError("Can't extend an inline array"));
|
|
2261
|
+
else if (isInlineTable(this.ctx[keyword])) throw this.error(new TomlError("Can't extend an inline table"));
|
|
2262
|
+
else if (isList(this.ctx[keyword])) this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
|
|
2263
|
+
else if (isTable(this.ctx[keyword])) this.ctx = this.ctx[keyword];
|
|
2253
2264
|
else throw this.error(new TomlError("Can't redefine an existing key"));
|
|
2254
2265
|
return this.next(this.parseListNext);
|
|
2255
2266
|
} else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
|
|
2256
2267
|
}
|
|
2257
|
-
parseListEnd(
|
|
2268
|
+
parseListEnd(keyword) {
|
|
2258
2269
|
if (this.char === CHAR_RSQB) return this.next(this.parseWhitespaceToEOL);
|
|
2259
2270
|
else throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
|
|
2260
2271
|
}
|
|
2261
2272
|
/* VALUE string, number, boolean, inline list, inline object */ parseValue() {
|
|
2262
|
-
if (this.char ===
|
|
2273
|
+
if (this.char === Parser.END) throw this.error(new TomlError("Key without value"));
|
|
2263
2274
|
else if (this.char === CHAR_QUOT) return this.next(this.parseDoubleString);
|
|
2264
2275
|
if (this.char === CHAR_APOS) return this.next(this.parseSingleString);
|
|
2265
2276
|
else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) return this.goto(this.parseNumberSign);
|
|
@@ -2271,8 +2282,8 @@ function makeParserClass(Parser11) {
|
|
|
2271
2282
|
else if (this.char === CHAR_LCUB) return this.call(this.parseInlineTable, this.recordValue);
|
|
2272
2283
|
else throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"));
|
|
2273
2284
|
}
|
|
2274
|
-
recordValue(
|
|
2275
|
-
return this.returnNow(
|
|
2285
|
+
recordValue(value) {
|
|
2286
|
+
return this.returnNow(value);
|
|
2276
2287
|
}
|
|
2277
2288
|
parseInf() {
|
|
2278
2289
|
if (this.char === CHAR_n) return this.next(this.parseInf2);
|
|
@@ -2299,7 +2310,7 @@ function makeParserClass(Parser11) {
|
|
|
2299
2310
|
}
|
|
2300
2311
|
/* KEYS: barewords */ parseBareKey() {
|
|
2301
2312
|
do {
|
|
2302
|
-
if (this.char ===
|
|
2313
|
+
if (this.char === Parser.END) throw this.error(new TomlError("Key ended without value"));
|
|
2303
2314
|
else if (isAlphaNumHyphen(this.char)) this.consume();
|
|
2304
2315
|
else if (this.state.buf.length === 0) throw this.error(new TomlError("Empty bare keys are not allowed"));
|
|
2305
2316
|
else return this.returnNow();
|
|
@@ -2329,7 +2340,7 @@ function makeParserClass(Parser11) {
|
|
|
2329
2340
|
parseLiteralMultiStringContent() {
|
|
2330
2341
|
do {
|
|
2331
2342
|
if (this.char === CHAR_APOS) return this.next(this.parseLiteralMultiEnd);
|
|
2332
|
-
else if (this.char ===
|
|
2343
|
+
else if (this.char === Parser.END) throw this.error(new TomlError("Unterminated multi-line string"));
|
|
2333
2344
|
else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) throw this.errorControlCharInString();
|
|
2334
2345
|
else this.consume();
|
|
2335
2346
|
}while (this.nextChar());
|
|
@@ -2361,8 +2372,8 @@ function makeParserClass(Parser11) {
|
|
|
2361
2372
|
else this.consume();
|
|
2362
2373
|
}while (this.nextChar());
|
|
2363
2374
|
}
|
|
2364
|
-
recordEscapeReplacement(
|
|
2365
|
-
this.state.buf +=
|
|
2375
|
+
recordEscapeReplacement(replacement) {
|
|
2376
|
+
this.state.buf += replacement;
|
|
2366
2377
|
return this.goto(this.parseBasicString);
|
|
2367
2378
|
}
|
|
2368
2379
|
parseMultiStringMaybe() {
|
|
@@ -2378,19 +2389,19 @@ function makeParserClass(Parser11) {
|
|
|
2378
2389
|
do {
|
|
2379
2390
|
if (this.char === CHAR_BSOL) return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement);
|
|
2380
2391
|
else if (this.char === CHAR_QUOT) return this.next(this.parseMultiEnd);
|
|
2381
|
-
else if (this.char ===
|
|
2392
|
+
else if (this.char === Parser.END) throw this.error(new TomlError("Unterminated multi-line string"));
|
|
2382
2393
|
else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) throw this.errorControlCharInString();
|
|
2383
2394
|
else this.consume();
|
|
2384
2395
|
}while (this.nextChar());
|
|
2385
2396
|
}
|
|
2386
2397
|
errorControlCharInString() {
|
|
2387
|
-
let
|
|
2388
|
-
if (this.char < 16)
|
|
2389
|
-
|
|
2390
|
-
return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${
|
|
2398
|
+
let displayCode = "\\u00";
|
|
2399
|
+
if (this.char < 16) displayCode += "0";
|
|
2400
|
+
displayCode += this.char.toString(16);
|
|
2401
|
+
return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${displayCode} instead`));
|
|
2391
2402
|
}
|
|
2392
|
-
recordMultiEscapeReplacement(
|
|
2393
|
-
this.state.buf +=
|
|
2403
|
+
recordMultiEscapeReplacement(replacement) {
|
|
2404
|
+
this.state.buf += replacement;
|
|
2394
2405
|
return this.goto(this.parseMultiStringContent);
|
|
2395
2406
|
}
|
|
2396
2407
|
parseMultiEnd() {
|
|
@@ -2428,13 +2439,13 @@ function makeParserClass(Parser11) {
|
|
|
2428
2439
|
else if (this.char === CHAR_U) return this.call(this.parseLargeUnicode, this.parseUnicodeReturn);
|
|
2429
2440
|
else throw this.error(new TomlError("Unknown escape character: " + this.char));
|
|
2430
2441
|
}
|
|
2431
|
-
parseUnicodeReturn(
|
|
2442
|
+
parseUnicodeReturn(char) {
|
|
2432
2443
|
try {
|
|
2433
|
-
const
|
|
2434
|
-
if (
|
|
2435
|
-
return this.returnNow(String.fromCodePoint(
|
|
2436
|
-
} catch (
|
|
2437
|
-
throw this.error(TomlError.wrap(
|
|
2444
|
+
const codePoint = parseInt(char, 16);
|
|
2445
|
+
if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));
|
|
2446
|
+
return this.returnNow(String.fromCodePoint(codePoint));
|
|
2447
|
+
} catch (err) {
|
|
2448
|
+
throw this.error(TomlError.wrap(err));
|
|
2438
2449
|
}
|
|
2439
2450
|
}
|
|
2440
2451
|
parseSmallUnicode() {
|
|
@@ -2485,9 +2496,9 @@ function makeParserClass(Parser11) {
|
|
|
2485
2496
|
this.consume();
|
|
2486
2497
|
return this.call(this.parseNoUnder, this.parseNumberFloat);
|
|
2487
2498
|
} else {
|
|
2488
|
-
const
|
|
2489
|
-
/* istanbul ignore if */ if (
|
|
2490
|
-
else return this.returnNow(
|
|
2499
|
+
const result = Integer(this.state.buf);
|
|
2500
|
+
/* istanbul ignore if */ if (result.isNaN()) throw this.error(new TomlError("Invalid number"));
|
|
2501
|
+
else return this.returnNow(result);
|
|
2491
2502
|
}
|
|
2492
2503
|
}
|
|
2493
2504
|
parseNoUnder() {
|
|
@@ -2565,27 +2576,27 @@ function makeParserClass(Parser11) {
|
|
|
2565
2576
|
if (isHexit(this.char)) this.consume();
|
|
2566
2577
|
else if (this.char === CHAR_LOWBAR) return this.call(this.parseNoUnder);
|
|
2567
2578
|
else {
|
|
2568
|
-
const
|
|
2569
|
-
/* istanbul ignore if */ if (
|
|
2570
|
-
else return this.returnNow(
|
|
2579
|
+
const result = Integer(this.state.buf);
|
|
2580
|
+
/* istanbul ignore if */ if (result.isNaN()) throw this.error(new TomlError("Invalid number"));
|
|
2581
|
+
else return this.returnNow(result);
|
|
2571
2582
|
}
|
|
2572
2583
|
}
|
|
2573
2584
|
parseIntegerOct() {
|
|
2574
2585
|
if (isOctit(this.char)) this.consume();
|
|
2575
2586
|
else if (this.char === CHAR_LOWBAR) return this.call(this.parseNoUnder);
|
|
2576
2587
|
else {
|
|
2577
|
-
const
|
|
2578
|
-
/* istanbul ignore if */ if (
|
|
2579
|
-
else return this.returnNow(
|
|
2588
|
+
const result = Integer(this.state.buf);
|
|
2589
|
+
/* istanbul ignore if */ if (result.isNaN()) throw this.error(new TomlError("Invalid number"));
|
|
2590
|
+
else return this.returnNow(result);
|
|
2580
2591
|
}
|
|
2581
2592
|
}
|
|
2582
2593
|
parseIntegerBin() {
|
|
2583
2594
|
if (isBit(this.char)) this.consume();
|
|
2584
2595
|
else if (this.char === CHAR_LOWBAR) return this.call(this.parseNoUnder);
|
|
2585
2596
|
else {
|
|
2586
|
-
const
|
|
2587
|
-
/* istanbul ignore if */ if (
|
|
2588
|
-
else return this.returnNow(
|
|
2597
|
+
const result = Integer(this.state.buf);
|
|
2598
|
+
/* istanbul ignore if */ if (result.isNaN()) throw this.error(new TomlError("Invalid number"));
|
|
2599
|
+
else return this.returnNow(result);
|
|
2589
2600
|
}
|
|
2590
2601
|
}
|
|
2591
2602
|
/* DATETIME */ parseDateTime() {
|
|
@@ -2774,20 +2785,20 @@ function makeParserClass(Parser11) {
|
|
|
2774
2785
|
}
|
|
2775
2786
|
/* INLINE LISTS */ parseInlineList() {
|
|
2776
2787
|
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) return null;
|
|
2777
|
-
else if (this.char ===
|
|
2788
|
+
else if (this.char === Parser.END) throw this.error(new TomlError("Unterminated inline array"));
|
|
2778
2789
|
else if (this.char === CHAR_NUM) return this.call(this.parseComment);
|
|
2779
2790
|
else if (this.char === CHAR_RSQB) return this.return(this.state.resultArr || InlineList());
|
|
2780
2791
|
else return this.callNow(this.parseValue, this.recordInlineListValue);
|
|
2781
2792
|
}
|
|
2782
|
-
recordInlineListValue(
|
|
2793
|
+
recordInlineListValue(value) {
|
|
2783
2794
|
if (this.state.resultArr) {
|
|
2784
|
-
const
|
|
2785
|
-
const
|
|
2786
|
-
if (
|
|
2787
|
-
} else this.state.resultArr = InlineList(tomlType(
|
|
2788
|
-
if (isFloat(
|
|
2789
|
-
this.state.resultArr.push(
|
|
2790
|
-
else this.state.resultArr.push(
|
|
2795
|
+
const listType = this.state.resultArr[_contentType];
|
|
2796
|
+
const valueType = tomlType(value);
|
|
2797
|
+
if (listType !== valueType) throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${listType} and ${valueType}`));
|
|
2798
|
+
} else this.state.resultArr = InlineList(tomlType(value));
|
|
2799
|
+
if (isFloat(value) || isInteger(value)) // unbox now that we've verified they're ok
|
|
2800
|
+
this.state.resultArr.push(value.valueOf());
|
|
2801
|
+
else this.state.resultArr.push(value);
|
|
2791
2802
|
return this.goto(this.parseInlineListNext);
|
|
2792
2803
|
}
|
|
2793
2804
|
parseInlineListNext() {
|
|
@@ -2799,34 +2810,34 @@ function makeParserClass(Parser11) {
|
|
|
2799
2810
|
}
|
|
2800
2811
|
/* INLINE TABLE */ parseInlineTable() {
|
|
2801
2812
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2802
|
-
else if (this.char ===
|
|
2813
|
+
else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) throw this.error(new TomlError("Unterminated inline array"));
|
|
2803
2814
|
else if (this.char === CHAR_RCUB) return this.return(this.state.resultTable || InlineTable());
|
|
2804
2815
|
else {
|
|
2805
2816
|
if (!this.state.resultTable) this.state.resultTable = InlineTable();
|
|
2806
2817
|
return this.callNow(this.parseAssign, this.recordInlineTableValue);
|
|
2807
2818
|
}
|
|
2808
2819
|
}
|
|
2809
|
-
recordInlineTableValue(
|
|
2810
|
-
let
|
|
2811
|
-
let
|
|
2812
|
-
for (let
|
|
2813
|
-
if (hasKey(
|
|
2814
|
-
|
|
2820
|
+
recordInlineTableValue(kv) {
|
|
2821
|
+
let target = this.state.resultTable;
|
|
2822
|
+
let finalKey = kv.key.pop();
|
|
2823
|
+
for (let kw of kv.key){
|
|
2824
|
+
if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) throw this.error(new TomlError("Can't redefine existing key"));
|
|
2825
|
+
target = target[kw] = target[kw] || Table();
|
|
2815
2826
|
}
|
|
2816
|
-
if (hasKey(
|
|
2817
|
-
if (isInteger(
|
|
2818
|
-
else
|
|
2827
|
+
if (hasKey(target, finalKey)) throw this.error(new TomlError("Can't redefine existing key"));
|
|
2828
|
+
if (isInteger(kv.value) || isFloat(kv.value)) target[finalKey] = kv.value.valueOf();
|
|
2829
|
+
else target[finalKey] = kv.value;
|
|
2819
2830
|
return this.goto(this.parseInlineTableNext);
|
|
2820
2831
|
}
|
|
2821
2832
|
parseInlineTableNext() {
|
|
2822
2833
|
if (this.char === CHAR_SP || this.char === CTRL_I) return null;
|
|
2823
|
-
else if (this.char ===
|
|
2834
|
+
else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) throw this.error(new TomlError("Unterminated inline array"));
|
|
2824
2835
|
else if (this.char === CHAR_COMMA) return this.next(this.parseInlineTable);
|
|
2825
2836
|
else if (this.char === CHAR_RCUB) return this.goto(this.parseInlineTable);
|
|
2826
2837
|
else throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
|
|
2827
2838
|
}
|
|
2828
2839
|
}
|
|
2829
|
-
return
|
|
2840
|
+
return TOMLParser;
|
|
2830
2841
|
}
|
|
2831
2842
|
|
|
2832
2843
|
});
|
|
@@ -14672,7 +14683,7 @@ var $465b080b3357c6b8$var$pkcs1 = $465b080b3357c6b8$exports = $aX5SS.pkcs1 = $aX
|
|
|
14672
14683
|
var lHash = md.digest();
|
|
14673
14684
|
var PS = "";
|
|
14674
14685
|
var PS_length = maxLength - message.length;
|
|
14675
|
-
for(var i = 0; i < PS_length; i++)PS += "\
|
|
14686
|
+
for(var i = 0; i < PS_length; i++)PS += "\0";
|
|
14676
14687
|
var DB = lHash.getBytes() + PS + "\x01" + message;
|
|
14677
14688
|
if (!seed) seed = $aX5SS.random.getBytes(md.digestLength);
|
|
14678
14689
|
else if (seed.length !== md.digestLength) {
|
|
@@ -14686,7 +14697,7 @@ var $465b080b3357c6b8$var$pkcs1 = $465b080b3357c6b8$exports = $aX5SS.pkcs1 = $aX
|
|
|
14686
14697
|
var seedMask = $465b080b3357c6b8$var$rsa_mgf1(maskedDB, md.digestLength, mgf1Md);
|
|
14687
14698
|
var maskedSeed = $aX5SS.util.xorBytes(seed, seedMask, seed.length);
|
|
14688
14699
|
// return encoded message
|
|
14689
|
-
return "\
|
|
14700
|
+
return "\0" + maskedSeed + maskedDB;
|
|
14690
14701
|
};
|
|
14691
14702
|
/**
|
|
14692
14703
|
* Decode the given RSAES-OAEP encoded message (EM) using key, with optional
|
|
@@ -14745,7 +14756,7 @@ var $465b080b3357c6b8$var$pkcs1 = $465b080b3357c6b8$exports = $aX5SS.pkcs1 = $aX
|
|
|
14745
14756
|
var db = $aX5SS.util.xorBytes(maskedDB, dbMask, maskedDB.length);
|
|
14746
14757
|
var lHashPrime = db.substring(0, md.digestLength);
|
|
14747
14758
|
// constant time check that all values match what is expected
|
|
14748
|
-
var error = y !== "\
|
|
14759
|
+
var error = y !== "\0";
|
|
14749
14760
|
// constant time check lHash vs lHashPrime
|
|
14750
14761
|
for(var i = 0; i < md.digestLength; ++i)error |= lHash.charAt(i) !== lHashPrime.charAt(i);
|
|
14751
14762
|
// "constant time" find the 0x1 byte separating the padding (zeros) from the
|
|
@@ -29329,8 +29340,8 @@ var $1bb7c2e3e32c99fc$var$ssh = $1bb7c2e3e32c99fc$exports = $aX5SS.ssh = $aX5SS.
|
|
|
29329
29340
|
padding.truncate(padding.length() - encLen + privbuffer.length());
|
|
29330
29341
|
privbuffer.putBuffer(padding);
|
|
29331
29342
|
var aeskey = $aX5SS.util.createBuffer();
|
|
29332
|
-
aeskey.putBuffer($1bb7c2e3e32c99fc$var$_sha1("\
|
|
29333
|
-
aeskey.putBuffer($1bb7c2e3e32c99fc$var$_sha1("\
|
|
29343
|
+
aeskey.putBuffer($1bb7c2e3e32c99fc$var$_sha1("\0\0\0\0", passphrase));
|
|
29344
|
+
aeskey.putBuffer($1bb7c2e3e32c99fc$var$_sha1("\0\0\0\x01", passphrase));
|
|
29334
29345
|
// encrypt some bytes using CBC mode
|
|
29335
29346
|
// key is 40 bytes, so truncate *by* 8 bytes
|
|
29336
29347
|
var cipher = $aX5SS.aes.createEncryptionCipher(aeskey.truncate(8), "CBC");
|
|
@@ -31136,11 +31147,11 @@ const $69e4bed225e2da9c$var$isEmptyString = (val)=>val === "" || val === "./";
|
|
|
31136
31147
|
if (options.onResult) options.onResult(state);
|
|
31137
31148
|
items.push(state.output);
|
|
31138
31149
|
};
|
|
31139
|
-
let matches = $69e4bed225e2da9c$var$micromatch(list, patterns, {
|
|
31150
|
+
let matches = new Set($69e4bed225e2da9c$var$micromatch(list, patterns, {
|
|
31140
31151
|
...options,
|
|
31141
31152
|
onResult: onResult
|
|
31142
|
-
});
|
|
31143
|
-
for (let item of items)if (!matches.
|
|
31153
|
+
}));
|
|
31154
|
+
for (let item of items)if (!matches.has(item)) result.add(item);
|
|
31144
31155
|
return [
|
|
31145
31156
|
...result
|
|
31146
31157
|
];
|
|
@@ -31344,7 +31355,7 @@ const $69e4bed225e2da9c$var$isEmptyString = (val)=>val === "" || val === "./";
|
|
|
31344
31355
|
*
|
|
31345
31356
|
* ```js
|
|
31346
31357
|
* const mm = require('micromatch');
|
|
31347
|
-
* const state = mm(pattern[, options]);
|
|
31358
|
+
* const state = mm.parse(pattern[, options]);
|
|
31348
31359
|
* ```
|
|
31349
31360
|
* @param {String} `glob`
|
|
31350
31361
|
* @param {Object} `options`
|
|
@@ -31781,6 +31792,7 @@ var $317df5a2d050a904$exports = {};
|
|
|
31781
31792
|
Object.defineProperty($317df5a2d050a904$exports, "__esModule", {
|
|
31782
31793
|
value: true
|
|
31783
31794
|
});
|
|
31795
|
+
$317df5a2d050a904$exports.Settings = $317df5a2d050a904$exports.walkStream = $317df5a2d050a904$exports.walkSync = $317df5a2d050a904$exports.walk = void 0;
|
|
31784
31796
|
var $5b03973b11b9b194$exports = {};
|
|
31785
31797
|
"use strict";
|
|
31786
31798
|
Object.defineProperty($5b03973b11b9b194$exports, "__esModule", {
|
|
@@ -31797,29 +31809,43 @@ var $e0d812f240931569$exports = {};
|
|
|
31797
31809
|
Object.defineProperty($e0d812f240931569$exports, "__esModule", {
|
|
31798
31810
|
value: true
|
|
31799
31811
|
});
|
|
31812
|
+
$e0d812f240931569$exports.Settings = $e0d812f240931569$exports.scandirSync = $e0d812f240931569$exports.scandir = void 0;
|
|
31800
31813
|
var $8c82b681478b71a0$exports = {};
|
|
31801
31814
|
"use strict";
|
|
31802
31815
|
Object.defineProperty($8c82b681478b71a0$exports, "__esModule", {
|
|
31803
31816
|
value: true
|
|
31804
31817
|
});
|
|
31818
|
+
$8c82b681478b71a0$exports.readdir = $8c82b681478b71a0$exports.readdirWithFileTypes = $8c82b681478b71a0$exports.read = void 0;
|
|
31805
31819
|
var $48b7d65b50efb0b8$exports = {};
|
|
31806
31820
|
"use strict";
|
|
31807
31821
|
Object.defineProperty($48b7d65b50efb0b8$exports, "__esModule", {
|
|
31808
31822
|
value: true
|
|
31809
31823
|
});
|
|
31824
|
+
$48b7d65b50efb0b8$exports.statSync = $48b7d65b50efb0b8$exports.stat = $48b7d65b50efb0b8$exports.Settings = void 0;
|
|
31810
31825
|
var $79e2bbccd27c60ef$exports = {};
|
|
31811
31826
|
"use strict";
|
|
31812
31827
|
Object.defineProperty($79e2bbccd27c60ef$exports, "__esModule", {
|
|
31813
31828
|
value: true
|
|
31814
31829
|
});
|
|
31830
|
+
$79e2bbccd27c60ef$exports.read = void 0;
|
|
31815
31831
|
function $79e2bbccd27c60ef$var$read(path, settings, callback) {
|
|
31816
31832
|
settings.fs.lstat(path, (lstatError, lstat)=>{
|
|
31817
|
-
if (lstatError !== null)
|
|
31818
|
-
|
|
31833
|
+
if (lstatError !== null) {
|
|
31834
|
+
$79e2bbccd27c60ef$var$callFailureCallback(callback, lstatError);
|
|
31835
|
+
return;
|
|
31836
|
+
}
|
|
31837
|
+
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
31838
|
+
$79e2bbccd27c60ef$var$callSuccessCallback(callback, lstat);
|
|
31839
|
+
return;
|
|
31840
|
+
}
|
|
31819
31841
|
settings.fs.stat(path, (statError, stat)=>{
|
|
31820
31842
|
if (statError !== null) {
|
|
31821
|
-
if (settings.throwErrorOnBrokenSymbolicLink)
|
|
31822
|
-
|
|
31843
|
+
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
31844
|
+
$79e2bbccd27c60ef$var$callFailureCallback(callback, statError);
|
|
31845
|
+
return;
|
|
31846
|
+
}
|
|
31847
|
+
$79e2bbccd27c60ef$var$callSuccessCallback(callback, lstat);
|
|
31848
|
+
return;
|
|
31823
31849
|
}
|
|
31824
31850
|
if (settings.markSymbolicLink) stat.isSymbolicLink = ()=>true;
|
|
31825
31851
|
$79e2bbccd27c60ef$var$callSuccessCallback(callback, stat);
|
|
@@ -31840,6 +31866,7 @@ var $3454c7a954c13fc6$exports = {};
|
|
|
31840
31866
|
Object.defineProperty($3454c7a954c13fc6$exports, "__esModule", {
|
|
31841
31867
|
value: true
|
|
31842
31868
|
});
|
|
31869
|
+
$3454c7a954c13fc6$exports.read = void 0;
|
|
31843
31870
|
function $3454c7a954c13fc6$var$read(path, settings) {
|
|
31844
31871
|
const lstat = settings.fs.lstatSync(path);
|
|
31845
31872
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
|
|
@@ -31865,6 +31892,7 @@ var $8b5ba49f0cfc39f7$exports = {};
|
|
|
31865
31892
|
Object.defineProperty($8b5ba49f0cfc39f7$exports, "__esModule", {
|
|
31866
31893
|
value: true
|
|
31867
31894
|
});
|
|
31895
|
+
$8b5ba49f0cfc39f7$exports.createFileSystemAdapter = $8b5ba49f0cfc39f7$exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
31868
31896
|
|
|
31869
31897
|
$8b5ba49f0cfc39f7$exports.FILE_SYSTEM_ADAPTER = {
|
|
31870
31898
|
lstat: $eJUMF$fs.lstat,
|
|
@@ -31888,7 +31916,7 @@ class $0beccc825807a5ff$var$Settings {
|
|
|
31888
31916
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
31889
31917
|
}
|
|
31890
31918
|
_getValue(option, value) {
|
|
31891
|
-
return option
|
|
31919
|
+
return option !== null && option !== void 0 ? option : value;
|
|
31892
31920
|
}
|
|
31893
31921
|
}
|
|
31894
31922
|
$0beccc825807a5ff$exports.default = $0beccc825807a5ff$var$Settings;
|
|
@@ -31896,7 +31924,10 @@ $0beccc825807a5ff$exports.default = $0beccc825807a5ff$var$Settings;
|
|
|
31896
31924
|
|
|
31897
31925
|
$48b7d65b50efb0b8$exports.Settings = $0beccc825807a5ff$exports.default;
|
|
31898
31926
|
function $48b7d65b50efb0b8$var$stat(path, optionsOrSettingsOrCallback, callback) {
|
|
31899
|
-
if (typeof optionsOrSettingsOrCallback === "function")
|
|
31927
|
+
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
31928
|
+
$79e2bbccd27c60ef$exports.read(path, $48b7d65b50efb0b8$var$getSettings(), optionsOrSettingsOrCallback);
|
|
31929
|
+
return;
|
|
31930
|
+
}
|
|
31900
31931
|
$79e2bbccd27c60ef$exports.read(path, $48b7d65b50efb0b8$var$getSettings(optionsOrSettingsOrCallback), callback);
|
|
31901
31932
|
}
|
|
31902
31933
|
$48b7d65b50efb0b8$exports.stat = $48b7d65b50efb0b8$var$stat;
|
|
@@ -31959,16 +31990,7 @@ var $f4853698f1f81687$exports = {};
|
|
|
31959
31990
|
Object.defineProperty($f4853698f1f81687$exports, "__esModule", {
|
|
31960
31991
|
value: true
|
|
31961
31992
|
});
|
|
31962
|
-
|
|
31963
|
-
const $f4853698f1f81687$var$MAJOR_VERSION = parseInt($f4853698f1f81687$var$NODE_PROCESS_VERSION_PARTS[0], 10);
|
|
31964
|
-
const $f4853698f1f81687$var$MINOR_VERSION = parseInt($f4853698f1f81687$var$NODE_PROCESS_VERSION_PARTS[1], 10);
|
|
31965
|
-
const $f4853698f1f81687$var$SUPPORTED_MAJOR_VERSION = 10;
|
|
31966
|
-
const $f4853698f1f81687$var$SUPPORTED_MINOR_VERSION = 10;
|
|
31967
|
-
const $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR = $f4853698f1f81687$var$MAJOR_VERSION > $f4853698f1f81687$var$SUPPORTED_MAJOR_VERSION;
|
|
31968
|
-
const $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR_AND_MINOR = $f4853698f1f81687$var$MAJOR_VERSION === $f4853698f1f81687$var$SUPPORTED_MAJOR_VERSION && $f4853698f1f81687$var$MINOR_VERSION >= $f4853698f1f81687$var$SUPPORTED_MINOR_VERSION;
|
|
31969
|
-
/**
|
|
31970
|
-
* IS `true` for Node.js 10.10 and greater.
|
|
31971
|
-
*/ $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR || $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR_AND_MINOR;
|
|
31993
|
+
$f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = true;
|
|
31972
31994
|
|
|
31973
31995
|
|
|
31974
31996
|
var $9793ec236c80d044$exports = {};
|
|
@@ -31976,11 +31998,13 @@ var $9793ec236c80d044$exports = {};
|
|
|
31976
31998
|
Object.defineProperty($9793ec236c80d044$exports, "__esModule", {
|
|
31977
31999
|
value: true
|
|
31978
32000
|
});
|
|
32001
|
+
$9793ec236c80d044$exports.fs = void 0;
|
|
31979
32002
|
var $388b7846d9ee0898$exports = {};
|
|
31980
32003
|
"use strict";
|
|
31981
32004
|
Object.defineProperty($388b7846d9ee0898$exports, "__esModule", {
|
|
31982
32005
|
value: true
|
|
31983
32006
|
});
|
|
32007
|
+
$388b7846d9ee0898$exports.createDirentFromStats = void 0;
|
|
31984
32008
|
class $388b7846d9ee0898$var$DirentFromStats {
|
|
31985
32009
|
constructor(name, stats){
|
|
31986
32010
|
this.name = name;
|
|
@@ -32002,25 +32026,52 @@ $388b7846d9ee0898$exports.createDirentFromStats = $388b7846d9ee0898$var$createDi
|
|
|
32002
32026
|
$9793ec236c80d044$exports.fs = $388b7846d9ee0898$exports;
|
|
32003
32027
|
|
|
32004
32028
|
|
|
32029
|
+
var $743d85a8d1333002$exports = {};
|
|
32030
|
+
"use strict";
|
|
32031
|
+
Object.defineProperty($743d85a8d1333002$exports, "__esModule", {
|
|
32032
|
+
value: true
|
|
32033
|
+
});
|
|
32034
|
+
$743d85a8d1333002$exports.joinPathSegments = void 0;
|
|
32035
|
+
function $743d85a8d1333002$var$joinPathSegments(a, b, separator) {
|
|
32036
|
+
/**
|
|
32037
|
+
* The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
|
|
32038
|
+
*/ if (a.endsWith(separator)) return a + b;
|
|
32039
|
+
return a + separator + b;
|
|
32040
|
+
}
|
|
32041
|
+
$743d85a8d1333002$exports.joinPathSegments = $743d85a8d1333002$var$joinPathSegments;
|
|
32042
|
+
|
|
32043
|
+
|
|
32005
32044
|
function $8c82b681478b71a0$var$read(directory, settings, callback) {
|
|
32006
|
-
if (!settings.stats && $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES)
|
|
32007
|
-
|
|
32045
|
+
if (!settings.stats && $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
32046
|
+
$8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callback);
|
|
32047
|
+
return;
|
|
32048
|
+
}
|
|
32049
|
+
$8c82b681478b71a0$var$readdir(directory, settings, callback);
|
|
32008
32050
|
}
|
|
32009
32051
|
$8c82b681478b71a0$exports.read = $8c82b681478b71a0$var$read;
|
|
32010
32052
|
function $8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callback) {
|
|
32011
32053
|
settings.fs.readdir(directory, {
|
|
32012
32054
|
withFileTypes: true
|
|
32013
32055
|
}, (readdirError, dirents)=>{
|
|
32014
|
-
if (readdirError !== null)
|
|
32056
|
+
if (readdirError !== null) {
|
|
32057
|
+
$8c82b681478b71a0$var$callFailureCallback(callback, readdirError);
|
|
32058
|
+
return;
|
|
32059
|
+
}
|
|
32015
32060
|
const entries = dirents.map((dirent)=>({
|
|
32016
32061
|
dirent: dirent,
|
|
32017
32062
|
name: dirent.name,
|
|
32018
|
-
path:
|
|
32063
|
+
path: $743d85a8d1333002$exports.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
|
32019
32064
|
}));
|
|
32020
|
-
if (!settings.followSymbolicLinks)
|
|
32065
|
+
if (!settings.followSymbolicLinks) {
|
|
32066
|
+
$8c82b681478b71a0$var$callSuccessCallback(callback, entries);
|
|
32067
|
+
return;
|
|
32068
|
+
}
|
|
32021
32069
|
const tasks = entries.map((entry)=>$8c82b681478b71a0$var$makeRplTaskEntry(entry, settings));
|
|
32022
32070
|
$811497678ff58323$exports(tasks, (rplError, rplEntries)=>{
|
|
32023
|
-
if (rplError !== null)
|
|
32071
|
+
if (rplError !== null) {
|
|
32072
|
+
$8c82b681478b71a0$var$callFailureCallback(callback, rplError);
|
|
32073
|
+
return;
|
|
32074
|
+
}
|
|
32024
32075
|
$8c82b681478b71a0$var$callSuccessCallback(callback, rplEntries);
|
|
32025
32076
|
});
|
|
32026
32077
|
});
|
|
@@ -32028,37 +32079,53 @@ function $8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callbac
|
|
|
32028
32079
|
$8c82b681478b71a0$exports.readdirWithFileTypes = $8c82b681478b71a0$var$readdirWithFileTypes;
|
|
32029
32080
|
function $8c82b681478b71a0$var$makeRplTaskEntry(entry, settings) {
|
|
32030
32081
|
return (done)=>{
|
|
32031
|
-
if (!entry.dirent.isSymbolicLink())
|
|
32082
|
+
if (!entry.dirent.isSymbolicLink()) {
|
|
32083
|
+
done(null, entry);
|
|
32084
|
+
return;
|
|
32085
|
+
}
|
|
32032
32086
|
settings.fs.stat(entry.path, (statError, stats)=>{
|
|
32033
32087
|
if (statError !== null) {
|
|
32034
|
-
if (settings.throwErrorOnBrokenSymbolicLink)
|
|
32035
|
-
|
|
32088
|
+
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
32089
|
+
done(statError);
|
|
32090
|
+
return;
|
|
32091
|
+
}
|
|
32092
|
+
done(null, entry);
|
|
32093
|
+
return;
|
|
32036
32094
|
}
|
|
32037
32095
|
entry.dirent = $9793ec236c80d044$exports.fs.createDirentFromStats(entry.name, stats);
|
|
32038
|
-
|
|
32096
|
+
done(null, entry);
|
|
32039
32097
|
});
|
|
32040
32098
|
};
|
|
32041
32099
|
}
|
|
32042
32100
|
function $8c82b681478b71a0$var$readdir(directory, settings, callback) {
|
|
32043
32101
|
settings.fs.readdir(directory, (readdirError, names)=>{
|
|
32044
|
-
if (readdirError !== null)
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32102
|
+
if (readdirError !== null) {
|
|
32103
|
+
$8c82b681478b71a0$var$callFailureCallback(callback, readdirError);
|
|
32104
|
+
return;
|
|
32105
|
+
}
|
|
32106
|
+
const tasks = names.map((name)=>{
|
|
32107
|
+
const path = $743d85a8d1333002$exports.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
32108
|
+
return (done)=>{
|
|
32109
|
+
$48b7d65b50efb0b8$exports.stat(path, settings.fsStatSettings, (error, stats)=>{
|
|
32110
|
+
if (error !== null) {
|
|
32111
|
+
done(error);
|
|
32112
|
+
return;
|
|
32113
|
+
}
|
|
32114
|
+
const entry = {
|
|
32115
|
+
name: name,
|
|
32116
|
+
path: path,
|
|
32117
|
+
dirent: $9793ec236c80d044$exports.fs.createDirentFromStats(name, stats)
|
|
32118
|
+
};
|
|
32119
|
+
if (settings.stats) entry.stats = stats;
|
|
32120
|
+
done(null, entry);
|
|
32121
|
+
});
|
|
32122
|
+
};
|
|
32048
32123
|
});
|
|
32049
|
-
$811497678ff58323$exports(tasks, (rplError,
|
|
32050
|
-
if (rplError !== null)
|
|
32051
|
-
|
|
32052
|
-
|
|
32053
|
-
|
|
32054
|
-
const entry = {
|
|
32055
|
-
name: name,
|
|
32056
|
-
path: filepaths[index],
|
|
32057
|
-
dirent: $9793ec236c80d044$exports.fs.createDirentFromStats(name, stats)
|
|
32058
|
-
};
|
|
32059
|
-
if (settings.stats) entry.stats = stats;
|
|
32060
|
-
entries.push(entry);
|
|
32061
|
-
});
|
|
32124
|
+
$811497678ff58323$exports(tasks, (rplError, entries)=>{
|
|
32125
|
+
if (rplError !== null) {
|
|
32126
|
+
$8c82b681478b71a0$var$callFailureCallback(callback, rplError);
|
|
32127
|
+
return;
|
|
32128
|
+
}
|
|
32062
32129
|
$8c82b681478b71a0$var$callSuccessCallback(callback, entries);
|
|
32063
32130
|
});
|
|
32064
32131
|
});
|
|
@@ -32077,6 +32144,8 @@ var $e69266c637240849$exports = {};
|
|
|
32077
32144
|
Object.defineProperty($e69266c637240849$exports, "__esModule", {
|
|
32078
32145
|
value: true
|
|
32079
32146
|
});
|
|
32147
|
+
$e69266c637240849$exports.readdir = $e69266c637240849$exports.readdirWithFileTypes = $e69266c637240849$exports.read = void 0;
|
|
32148
|
+
|
|
32080
32149
|
|
|
32081
32150
|
|
|
32082
32151
|
|
|
@@ -32093,7 +32162,7 @@ function $e69266c637240849$var$readdirWithFileTypes(directory, settings) {
|
|
|
32093
32162
|
const entry = {
|
|
32094
32163
|
dirent: dirent,
|
|
32095
32164
|
name: dirent.name,
|
|
32096
|
-
path:
|
|
32165
|
+
path: $743d85a8d1333002$exports.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
|
|
32097
32166
|
};
|
|
32098
32167
|
if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) try {
|
|
32099
32168
|
const stats = settings.fs.statSync(entry.path);
|
|
@@ -32108,7 +32177,7 @@ $e69266c637240849$exports.readdirWithFileTypes = $e69266c637240849$var$readdirWi
|
|
|
32108
32177
|
function $e69266c637240849$var$readdir(directory, settings) {
|
|
32109
32178
|
const names = settings.fs.readdirSync(directory);
|
|
32110
32179
|
return names.map((name)=>{
|
|
32111
|
-
const entryPath =
|
|
32180
|
+
const entryPath = $743d85a8d1333002$exports.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
32112
32181
|
const stats = $48b7d65b50efb0b8$exports.statSync(entryPath, settings.fsStatSettings);
|
|
32113
32182
|
const entry = {
|
|
32114
32183
|
name: name,
|
|
@@ -32134,6 +32203,7 @@ var $775521ec67a4fc64$exports = {};
|
|
|
32134
32203
|
Object.defineProperty($775521ec67a4fc64$exports, "__esModule", {
|
|
32135
32204
|
value: true
|
|
32136
32205
|
});
|
|
32206
|
+
$775521ec67a4fc64$exports.createFileSystemAdapter = $775521ec67a4fc64$exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
32137
32207
|
|
|
32138
32208
|
$775521ec67a4fc64$exports.FILE_SYSTEM_ADAPTER = {
|
|
32139
32209
|
lstat: $eJUMF$fs.lstat,
|
|
@@ -32165,7 +32235,7 @@ class $a5cd045e5a6748b0$var$Settings {
|
|
|
32165
32235
|
});
|
|
32166
32236
|
}
|
|
32167
32237
|
_getValue(option, value) {
|
|
32168
|
-
return option
|
|
32238
|
+
return option !== null && option !== void 0 ? option : value;
|
|
32169
32239
|
}
|
|
32170
32240
|
}
|
|
32171
32241
|
$a5cd045e5a6748b0$exports.default = $a5cd045e5a6748b0$var$Settings;
|
|
@@ -32173,7 +32243,10 @@ $a5cd045e5a6748b0$exports.default = $a5cd045e5a6748b0$var$Settings;
|
|
|
32173
32243
|
|
|
32174
32244
|
$e0d812f240931569$exports.Settings = $a5cd045e5a6748b0$exports.default;
|
|
32175
32245
|
function $e0d812f240931569$var$scandir(path, optionsOrSettingsOrCallback, callback) {
|
|
32176
|
-
if (typeof optionsOrSettingsOrCallback === "function")
|
|
32246
|
+
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
32247
|
+
$8c82b681478b71a0$exports.read(path, $e0d812f240931569$var$getSettings(), optionsOrSettingsOrCallback);
|
|
32248
|
+
return;
|
|
32249
|
+
}
|
|
32177
32250
|
$8c82b681478b71a0$exports.read(path, $e0d812f240931569$var$getSettings(optionsOrSettingsOrCallback), callback);
|
|
32178
32251
|
}
|
|
32179
32252
|
$e0d812f240931569$exports.scandir = $e0d812f240931569$var$scandir;
|
|
@@ -32359,6 +32432,7 @@ var $d842871c1b1b7421$exports = {};
|
|
|
32359
32432
|
Object.defineProperty($d842871c1b1b7421$exports, "__esModule", {
|
|
32360
32433
|
value: true
|
|
32361
32434
|
});
|
|
32435
|
+
$d842871c1b1b7421$exports.joinPathSegments = $d842871c1b1b7421$exports.replacePathSegmentSeparator = $d842871c1b1b7421$exports.isAppliedFilter = $d842871c1b1b7421$exports.isFatalError = void 0;
|
|
32362
32436
|
function $d842871c1b1b7421$var$isFatalError(settings, error) {
|
|
32363
32437
|
if (settings.errorFilter === null) return true;
|
|
32364
32438
|
return !settings.errorFilter(error);
|
|
@@ -32369,11 +32443,14 @@ function $d842871c1b1b7421$var$isAppliedFilter(filter, value) {
|
|
|
32369
32443
|
}
|
|
32370
32444
|
$d842871c1b1b7421$exports.isAppliedFilter = $d842871c1b1b7421$var$isAppliedFilter;
|
|
32371
32445
|
function $d842871c1b1b7421$var$replacePathSegmentSeparator(filepath, separator) {
|
|
32372
|
-
return filepath.split(/[
|
|
32446
|
+
return filepath.split(/[/\\]/).join(separator);
|
|
32373
32447
|
}
|
|
32374
32448
|
$d842871c1b1b7421$exports.replacePathSegmentSeparator = $d842871c1b1b7421$var$replacePathSegmentSeparator;
|
|
32375
32449
|
function $d842871c1b1b7421$var$joinPathSegments(a, b, separator) {
|
|
32376
32450
|
if (a === "") return b;
|
|
32451
|
+
/**
|
|
32452
|
+
* The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
|
|
32453
|
+
*/ if (a.endsWith(separator)) return a + b;
|
|
32377
32454
|
return a + separator + b;
|
|
32378
32455
|
}
|
|
32379
32456
|
$d842871c1b1b7421$exports.joinPathSegments = $d842871c1b1b7421$var$joinPathSegments;
|
|
@@ -32416,6 +32493,9 @@ class $b02d22213ae11a8a$var$AsyncReader extends $4be968f0d018c0c1$exports.defaul
|
|
|
32416
32493
|
});
|
|
32417
32494
|
return this._emitter;
|
|
32418
32495
|
}
|
|
32496
|
+
get isDestroyed() {
|
|
32497
|
+
return this._isDestroyed;
|
|
32498
|
+
}
|
|
32419
32499
|
destroy() {
|
|
32420
32500
|
if (this._isDestroyed) throw new Error("The reader is already destroyed");
|
|
32421
32501
|
this._isDestroyed = true;
|
|
@@ -32441,13 +32521,16 @@ class $b02d22213ae11a8a$var$AsyncReader extends $4be968f0d018c0c1$exports.defaul
|
|
|
32441
32521
|
}
|
|
32442
32522
|
_worker(item, done) {
|
|
32443
32523
|
this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries)=>{
|
|
32444
|
-
if (error !== null)
|
|
32524
|
+
if (error !== null) {
|
|
32525
|
+
done(error, undefined);
|
|
32526
|
+
return;
|
|
32527
|
+
}
|
|
32445
32528
|
for (const entry of entries)this._handleEntry(entry, item.base);
|
|
32446
32529
|
done(null, undefined);
|
|
32447
32530
|
});
|
|
32448
32531
|
}
|
|
32449
32532
|
_handleError(error) {
|
|
32450
|
-
if (!$d842871c1b1b7421$exports.isFatalError(this._settings, error)) return;
|
|
32533
|
+
if (this._isDestroyed || !$d842871c1b1b7421$exports.isFatalError(this._settings, error)) return;
|
|
32451
32534
|
this._isFatalError = true;
|
|
32452
32535
|
this._isDestroyed = true;
|
|
32453
32536
|
this._emitter.emit("error", error);
|
|
@@ -32457,7 +32540,7 @@ class $b02d22213ae11a8a$var$AsyncReader extends $4be968f0d018c0c1$exports.defaul
|
|
|
32457
32540
|
const fullpath = entry.path;
|
|
32458
32541
|
if (base !== undefined) entry.path = $d842871c1b1b7421$exports.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
|
32459
32542
|
if ($d842871c1b1b7421$exports.isAppliedFilter(this._settings.entryFilter, entry)) this._emitEntry(entry);
|
|
32460
|
-
if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, entry.path);
|
|
32543
|
+
if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
|
|
32461
32544
|
}
|
|
32462
32545
|
_emitEntry(entry) {
|
|
32463
32546
|
this._emitter.emit("entry", entry);
|
|
@@ -32471,19 +32554,17 @@ class $5b03973b11b9b194$var$AsyncProvider {
|
|
|
32471
32554
|
this._root = _root;
|
|
32472
32555
|
this._settings = _settings;
|
|
32473
32556
|
this._reader = new $b02d22213ae11a8a$exports.default(this._root, this._settings);
|
|
32474
|
-
this._storage =
|
|
32557
|
+
this._storage = [];
|
|
32475
32558
|
}
|
|
32476
32559
|
read(callback) {
|
|
32477
32560
|
this._reader.onError((error)=>{
|
|
32478
32561
|
$5b03973b11b9b194$var$callFailureCallback(callback, error);
|
|
32479
32562
|
});
|
|
32480
32563
|
this._reader.onEntry((entry)=>{
|
|
32481
|
-
this._storage.
|
|
32564
|
+
this._storage.push(entry);
|
|
32482
32565
|
});
|
|
32483
32566
|
this._reader.onEnd(()=>{
|
|
32484
|
-
$5b03973b11b9b194$var$callSuccessCallback(callback,
|
|
32485
|
-
...this._storage
|
|
32486
|
-
]);
|
|
32567
|
+
$5b03973b11b9b194$var$callSuccessCallback(callback, this._storage);
|
|
32487
32568
|
});
|
|
32488
32569
|
this._reader.read();
|
|
32489
32570
|
}
|
|
@@ -32512,7 +32593,9 @@ class $327790ac3132dcf6$var$StreamProvider {
|
|
|
32512
32593
|
this._stream = new $eJUMF$stream.Readable({
|
|
32513
32594
|
objectMode: true,
|
|
32514
32595
|
read: ()=>{},
|
|
32515
|
-
destroy:
|
|
32596
|
+
destroy: ()=>{
|
|
32597
|
+
if (!this._reader.isDestroyed) this._reader.destroy();
|
|
32598
|
+
}
|
|
32516
32599
|
});
|
|
32517
32600
|
}
|
|
32518
32601
|
read() {
|
|
@@ -32549,15 +32632,13 @@ class $c5f7cf7adb14757e$var$SyncReader extends $4be968f0d018c0c1$exports.default
|
|
|
32549
32632
|
constructor(){
|
|
32550
32633
|
super(...arguments);
|
|
32551
32634
|
this._scandir = $e0d812f240931569$exports.scandirSync;
|
|
32552
|
-
this._storage =
|
|
32635
|
+
this._storage = [];
|
|
32553
32636
|
this._queue = new Set();
|
|
32554
32637
|
}
|
|
32555
32638
|
read() {
|
|
32556
32639
|
this._pushToQueue(this._root, this._settings.basePath);
|
|
32557
32640
|
this._handleQueue();
|
|
32558
|
-
return
|
|
32559
|
-
...this._storage
|
|
32560
|
-
];
|
|
32641
|
+
return this._storage;
|
|
32561
32642
|
}
|
|
32562
32643
|
_pushToQueue(directory, base) {
|
|
32563
32644
|
this._queue.add({
|
|
@@ -32584,10 +32665,10 @@ class $c5f7cf7adb14757e$var$SyncReader extends $4be968f0d018c0c1$exports.default
|
|
|
32584
32665
|
const fullpath = entry.path;
|
|
32585
32666
|
if (base !== undefined) entry.path = $d842871c1b1b7421$exports.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
|
|
32586
32667
|
if ($d842871c1b1b7421$exports.isAppliedFilter(this._settings.entryFilter, entry)) this._pushToStorage(entry);
|
|
32587
|
-
if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, entry.path);
|
|
32668
|
+
if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
|
|
32588
32669
|
}
|
|
32589
32670
|
_pushToStorage(entry) {
|
|
32590
|
-
this._storage.
|
|
32671
|
+
this._storage.push(entry);
|
|
32591
32672
|
}
|
|
32592
32673
|
}
|
|
32593
32674
|
$c5f7cf7adb14757e$exports.default = $c5f7cf7adb14757e$var$SyncReader;
|
|
@@ -32617,7 +32698,7 @@ class $8d237ca08a544ff3$var$Settings {
|
|
|
32617
32698
|
constructor(_options = {}){
|
|
32618
32699
|
this._options = _options;
|
|
32619
32700
|
this.basePath = this._getValue(this._options.basePath, undefined);
|
|
32620
|
-
this.concurrency = this._getValue(this._options.concurrency,
|
|
32701
|
+
this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
|
|
32621
32702
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
32622
32703
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
32623
32704
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
@@ -32631,7 +32712,7 @@ class $8d237ca08a544ff3$var$Settings {
|
|
|
32631
32712
|
});
|
|
32632
32713
|
}
|
|
32633
32714
|
_getValue(option, value) {
|
|
32634
|
-
return option
|
|
32715
|
+
return option !== null && option !== void 0 ? option : value;
|
|
32635
32716
|
}
|
|
32636
32717
|
}
|
|
32637
32718
|
$8d237ca08a544ff3$exports.default = $8d237ca08a544ff3$var$Settings;
|
|
@@ -32639,7 +32720,10 @@ $8d237ca08a544ff3$exports.default = $8d237ca08a544ff3$var$Settings;
|
|
|
32639
32720
|
|
|
32640
32721
|
$317df5a2d050a904$exports.Settings = $8d237ca08a544ff3$exports.default;
|
|
32641
32722
|
function $317df5a2d050a904$var$walk(directory, optionsOrSettingsOrCallback, callback) {
|
|
32642
|
-
if (typeof optionsOrSettingsOrCallback === "function")
|
|
32723
|
+
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
32724
|
+
new $5b03973b11b9b194$exports.default(directory, $317df5a2d050a904$var$getSettings()).read(optionsOrSettingsOrCallback);
|
|
32725
|
+
return;
|
|
32726
|
+
}
|
|
32643
32727
|
new $5b03973b11b9b194$exports.default(directory, $317df5a2d050a904$var$getSettings(optionsOrSettingsOrCallback)).read(callback);
|
|
32644
32728
|
}
|
|
32645
32729
|
$317df5a2d050a904$exports.walk = $317df5a2d050a904$var$walk;
|
|
@@ -33435,11 +33519,11 @@ const $3f4e287414e2d74a$var$isEmptyString = (val)=>val === "" || val === "./";
|
|
|
33435
33519
|
if (options.onResult) options.onResult(state);
|
|
33436
33520
|
items.push(state.output);
|
|
33437
33521
|
};
|
|
33438
|
-
let matches = $3f4e287414e2d74a$var$micromatch(list, patterns, {
|
|
33522
|
+
let matches = new Set($3f4e287414e2d74a$var$micromatch(list, patterns, {
|
|
33439
33523
|
...options,
|
|
33440
33524
|
onResult: onResult
|
|
33441
|
-
});
|
|
33442
|
-
for (let item of items)if (!matches.
|
|
33525
|
+
}));
|
|
33526
|
+
for (let item of items)if (!matches.has(item)) result.add(item);
|
|
33443
33527
|
return [
|
|
33444
33528
|
...result
|
|
33445
33529
|
];
|
|
@@ -33643,7 +33727,7 @@ const $3f4e287414e2d74a$var$isEmptyString = (val)=>val === "" || val === "./";
|
|
|
33643
33727
|
*
|
|
33644
33728
|
* ```js
|
|
33645
33729
|
* const mm = require('micromatch');
|
|
33646
|
-
* const state = mm(pattern[, options]);
|
|
33730
|
+
* const state = mm.parse(pattern[, options]);
|
|
33647
33731
|
* ```
|
|
33648
33732
|
* @param {String} `glob`
|
|
33649
33733
|
* @param {Object} `options`
|
|
@@ -34251,6 +34335,7 @@ class $31bd78e367586e0a$export$2e2bcd8739ae039 {
|
|
|
34251
34335
|
_runPromise = null;
|
|
34252
34336
|
_count = 0;
|
|
34253
34337
|
_results = [];
|
|
34338
|
+
_addSubscriptions = new Set();
|
|
34254
34339
|
constructor(opts = {
|
|
34255
34340
|
maxConcurrent: Infinity
|
|
34256
34341
|
}){
|
|
@@ -34270,9 +34355,16 @@ class $31bd78e367586e0a$export$2e2bcd8739ae039 {
|
|
|
34270
34355
|
reject(err);
|
|
34271
34356
|
throw err;
|
|
34272
34357
|
}));
|
|
34358
|
+
for (const addFn of this._addSubscriptions)addFn();
|
|
34273
34359
|
if (this._numRunning > 0 && this._numRunning < this._maxConcurrent) this._next();
|
|
34274
34360
|
});
|
|
34275
34361
|
}
|
|
34362
|
+
subscribeToAdd(fn) {
|
|
34363
|
+
this._addSubscriptions.add(fn);
|
|
34364
|
+
return ()=>{
|
|
34365
|
+
this._addSubscriptions.delete(fn);
|
|
34366
|
+
};
|
|
34367
|
+
}
|
|
34276
34368
|
run() {
|
|
34277
34369
|
if (this._runPromise != null) return this._runPromise;
|
|
34278
34370
|
if (this._queue.length === 0) return Promise.resolve([]);
|
|
@@ -34844,73 +34936,84 @@ else $152536acc51e0ffd$exports = $152536acc51e0ffd$var$isWsl();
|
|
|
34844
34936
|
|
|
34845
34937
|
|
|
34846
34938
|
const $de07249fe885e737$var$pAccess = $de07249fe885e737$require$promisify($eJUMF$fs.access);
|
|
34847
|
-
const $de07249fe885e737$var$
|
|
34939
|
+
const $de07249fe885e737$var$pReadFile = $de07249fe885e737$require$promisify($eJUMF$fs.readFile);
|
|
34848
34940
|
// Path to included `xdg-open`.
|
|
34849
34941
|
const $de07249fe885e737$var$localXdgOpenPath = $eJUMF$path.join($de07249fe885e737$var$$parcel$__dirname, "xdg-open");
|
|
34850
|
-
|
|
34851
|
-
|
|
34852
|
-
|
|
34853
|
-
|
|
34854
|
-
|
|
34855
|
-
|
|
34856
|
-
|
|
34857
|
-
|
|
34858
|
-
|
|
34942
|
+
/**
|
|
34943
|
+
Get the mount point for fixed drives in WSL.
|
|
34944
|
+
|
|
34945
|
+
@inner
|
|
34946
|
+
@returns {string} The mount point.
|
|
34947
|
+
*/ const $de07249fe885e737$var$getWslDrivesMountPoint = (()=>{
|
|
34948
|
+
// Default value for "root" param
|
|
34949
|
+
// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config
|
|
34950
|
+
const defaultMountPoint = "/mnt/";
|
|
34951
|
+
let mountPoint;
|
|
34952
|
+
return async function() {
|
|
34953
|
+
if (mountPoint) // Return memoized mount point value
|
|
34954
|
+
return mountPoint;
|
|
34955
|
+
const configFilePath = "/etc/wsl.conf";
|
|
34956
|
+
let isConfigFileExists = false;
|
|
34957
|
+
try {
|
|
34958
|
+
await $de07249fe885e737$var$pAccess(configFilePath, $eJUMF$fs.constants.F_OK);
|
|
34959
|
+
isConfigFileExists = true;
|
|
34960
|
+
} catch (_) {}
|
|
34961
|
+
if (!isConfigFileExists) return defaultMountPoint;
|
|
34962
|
+
const configContent = await $de07249fe885e737$var$pReadFile(configFilePath, {
|
|
34963
|
+
encoding: "utf8"
|
|
34964
|
+
});
|
|
34965
|
+
const configMountPoint = /root\s*=\s*(.*)/g.exec(configContent);
|
|
34966
|
+
if (!configMountPoint) return defaultMountPoint;
|
|
34967
|
+
mountPoint = configMountPoint[1].trim();
|
|
34968
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : mountPoint + "/";
|
|
34969
|
+
return mountPoint;
|
|
34970
|
+
};
|
|
34971
|
+
})();
|
|
34859
34972
|
$de07249fe885e737$exports = async (target, options)=>{
|
|
34860
34973
|
if (typeof target !== "string") throw new TypeError("Expected a `target`");
|
|
34861
34974
|
options = {
|
|
34862
34975
|
wait: false,
|
|
34863
34976
|
background: false,
|
|
34864
|
-
|
|
34977
|
+
allowNonzeroExitCode: false,
|
|
34865
34978
|
...options
|
|
34866
34979
|
};
|
|
34867
34980
|
let command;
|
|
34981
|
+
let { app: app } = options;
|
|
34868
34982
|
let appArguments = [];
|
|
34869
34983
|
const cliArguments = [];
|
|
34870
34984
|
const childProcessOptions = {};
|
|
34871
|
-
if (Array.isArray(
|
|
34872
|
-
appArguments =
|
|
34873
|
-
|
|
34874
|
-
}
|
|
34875
|
-
// Encodes the target as if it were an URL. Especially useful to get
|
|
34876
|
-
// double-quotes through the “double-quotes on Windows caveat”, but it
|
|
34877
|
-
// can be used on any platform.
|
|
34878
|
-
if (options.url) {
|
|
34879
|
-
target = encodeURI(target);
|
|
34880
|
-
if ($152536acc51e0ffd$exports) target = target.replace(/&/g, "^&");
|
|
34985
|
+
if (Array.isArray(app)) {
|
|
34986
|
+
appArguments = app.slice(1);
|
|
34987
|
+
app = app[0];
|
|
34881
34988
|
}
|
|
34882
34989
|
if (process.platform === "darwin") {
|
|
34883
34990
|
command = "open";
|
|
34884
34991
|
if (options.wait) cliArguments.push("--wait-apps");
|
|
34885
34992
|
if (options.background) cliArguments.push("--background");
|
|
34886
|
-
if (
|
|
34993
|
+
if (app) cliArguments.push("-a", app);
|
|
34887
34994
|
} else if (process.platform === "win32" || $152536acc51e0ffd$exports && !$511188f033b8926c$exports()) {
|
|
34888
|
-
|
|
34889
|
-
|
|
34890
|
-
|
|
34891
|
-
|
|
34892
|
-
|
|
34893
|
-
|
|
34894
|
-
|
|
34895
|
-
|
|
34896
|
-
|
|
34897
|
-
//
|
|
34898
|
-
//
|
|
34899
|
-
|
|
34900
|
-
|
|
34901
|
-
|
|
34902
|
-
|
|
34903
|
-
|
|
34904
|
-
|
|
34905
|
-
|
|
34906
|
-
|
|
34907
|
-
|
|
34908
|
-
}
|
|
34909
|
-
cliArguments.push(options.app);
|
|
34910
|
-
}
|
|
34911
|
-
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
34995
|
+
const mountPoint = await $de07249fe885e737$var$getWslDrivesMountPoint();
|
|
34996
|
+
command = $152536acc51e0ffd$exports ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
34997
|
+
cliArguments.push("-NoProfile", "-NonInteractive", "\u2013ExecutionPolicy", "Bypass", "-EncodedCommand");
|
|
34998
|
+
if (!$152536acc51e0ffd$exports) childProcessOptions.windowsVerbatimArguments = true;
|
|
34999
|
+
const encodedArguments = [
|
|
35000
|
+
"Start"
|
|
35001
|
+
];
|
|
35002
|
+
if (options.wait) encodedArguments.push("-Wait");
|
|
35003
|
+
if (app) {
|
|
35004
|
+
// Double quote with double quotes to ensure the inner quotes are passed through.
|
|
35005
|
+
// Inner quotes are delimited for PowerShell interpretation with backticks.
|
|
35006
|
+
encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
|
|
35007
|
+
appArguments.unshift(target);
|
|
35008
|
+
} else encodedArguments.push(`"${target}"`);
|
|
35009
|
+
if (appArguments.length > 0) {
|
|
35010
|
+
appArguments = appArguments.map((arg)=>`"\`"${arg}\`""`);
|
|
35011
|
+
encodedArguments.push(appArguments.join(","));
|
|
35012
|
+
}
|
|
35013
|
+
// Using Base64-encoded command, accepted by PowerShell, to allow special characters.
|
|
35014
|
+
target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
34912
35015
|
} else {
|
|
34913
|
-
if (
|
|
35016
|
+
if (app) command = app;
|
|
34914
35017
|
else {
|
|
34915
35018
|
// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.
|
|
34916
35019
|
const isBundled = !$de07249fe885e737$var$$parcel$__dirname || $de07249fe885e737$var$$parcel$__dirname === "/";
|
|
@@ -34937,7 +35040,7 @@ $de07249fe885e737$exports = async (target, options)=>{
|
|
|
34937
35040
|
if (options.wait) return new Promise((resolve, reject)=>{
|
|
34938
35041
|
subprocess.once("error", reject);
|
|
34939
35042
|
subprocess.once("close", (exitCode)=>{
|
|
34940
|
-
if (exitCode > 0) {
|
|
35043
|
+
if (options.allowNonzeroExitCode && exitCode > 0) {
|
|
34941
35044
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
34942
35045
|
return;
|
|
34943
35046
|
}
|
|
@@ -35804,7 +35907,7 @@ function $fc60114c9ddc0bb9$var$escape() {
|
|
|
35804
35907
|
case "0":
|
|
35805
35908
|
$fc60114c9ddc0bb9$var$read();
|
|
35806
35909
|
if ($fc60114c9ddc0bb9$var$util.isDigit($fc60114c9ddc0bb9$var$peek())) throw $fc60114c9ddc0bb9$var$invalidChar($fc60114c9ddc0bb9$var$read());
|
|
35807
|
-
return "\
|
|
35910
|
+
return "\0";
|
|
35808
35911
|
case "x":
|
|
35809
35912
|
$fc60114c9ddc0bb9$var$read();
|
|
35810
35913
|
return $fc60114c9ddc0bb9$var$hexEscape();
|
|
@@ -36029,7 +36132,7 @@ function $fc60114c9ddc0bb9$var$formatChar(c) {
|
|
|
36029
36132
|
"\r": "\\r",
|
|
36030
36133
|
" ": "\\t",
|
|
36031
36134
|
"\v": "\\v",
|
|
36032
|
-
"\
|
|
36135
|
+
"\0": "\\0",
|
|
36033
36136
|
"\u2028": "\\u2028",
|
|
36034
36137
|
"\u2029": "\\u2029"
|
|
36035
36138
|
};
|
|
@@ -36117,7 +36220,7 @@ var $fc60114c9ddc0bb9$var$stringify = function stringify(value, replacer, space)
|
|
|
36117
36220
|
"\r": "\\r",
|
|
36118
36221
|
" ": "\\t",
|
|
36119
36222
|
"\v": "\\v",
|
|
36120
|
-
"\
|
|
36223
|
+
"\0": "\\0",
|
|
36121
36224
|
"\u2028": "\\u2028",
|
|
36122
36225
|
"\u2029": "\\u2029"
|
|
36123
36226
|
};
|
|
@@ -36130,7 +36233,7 @@ var $fc60114c9ddc0bb9$var$stringify = function stringify(value, replacer, space)
|
|
|
36130
36233
|
quotes[c]++;
|
|
36131
36234
|
product += c;
|
|
36132
36235
|
continue;
|
|
36133
|
-
case "\
|
|
36236
|
+
case "\0":
|
|
36134
36237
|
if ($fc60114c9ddc0bb9$var$util.isDigit(value[i + 1])) {
|
|
36135
36238
|
product += "\\x00";
|
|
36136
36239
|
continue;
|