@parcel/utils 2.0.0-canary.1837 → 2.0.0-canary.1849
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 +26 -26
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -100,7 +100,7 @@ var $5H8Dk = parcelRequire("5H8Dk");
|
|
|
100
100
|
|
|
101
101
|
var $ahJIq = parcelRequire("ahJIq");
|
|
102
102
|
|
|
103
|
-
var $
|
|
103
|
+
var $7UcG9 = parcelRequire("7UcG9");
|
|
104
104
|
|
|
105
105
|
var $4DgJ9 = parcelRequire("4DgJ9");
|
|
106
106
|
const $504a0778da8270dd$var$isObject = (val)=>val && typeof val === 'object' && !Array.isArray(val);
|
|
@@ -139,7 +139,7 @@ const $504a0778da8270dd$var$isObject = (val)=>val && typeof val === 'object' &&
|
|
|
139
139
|
const isState = $504a0778da8270dd$var$isObject(glob) && glob.tokens && glob.input;
|
|
140
140
|
if (glob === '' || typeof glob !== 'string' && !isState) throw new TypeError('Expected pattern to be a non-empty string');
|
|
141
141
|
const opts = options || {};
|
|
142
|
-
const posix = $
|
|
142
|
+
const posix = $7UcG9.isWindows(options);
|
|
143
143
|
const regex = isState ? $504a0778da8270dd$var$picomatch.compileRe(glob, options) : $504a0778da8270dd$var$picomatch.makeRe(glob, options, false, true);
|
|
144
144
|
const state = regex.state;
|
|
145
145
|
delete regex.state;
|
|
@@ -206,7 +206,7 @@ const $504a0778da8270dd$var$isObject = (val)=>val && typeof val === 'object' &&
|
|
|
206
206
|
output: ''
|
|
207
207
|
};
|
|
208
208
|
const opts = options || {};
|
|
209
|
-
const format = opts.format || (posix ? $
|
|
209
|
+
const format = opts.format || (posix ? $7UcG9.toPosixSlashes : null);
|
|
210
210
|
let match = input === glob;
|
|
211
211
|
let output = match && format ? format(input) : input;
|
|
212
212
|
if (match === false) {
|
|
@@ -235,7 +235,7 @@ const $504a0778da8270dd$var$isObject = (val)=>val && typeof val === 'object' &&
|
|
|
235
235
|
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
236
236
|
* @return {Boolean}
|
|
237
237
|
* @api public
|
|
238
|
-
*/ $504a0778da8270dd$var$picomatch.matchBase = (input, glob, options, posix = $
|
|
238
|
+
*/ $504a0778da8270dd$var$picomatch.matchBase = (input, glob, options, posix = $7UcG9.isWindows(options))=>{
|
|
239
239
|
const regex = glob instanceof RegExp ? glob : $504a0778da8270dd$var$picomatch.makeRe(glob, options);
|
|
240
240
|
return regex.test($houHs$path.basename(input));
|
|
241
241
|
};
|
|
@@ -384,7 +384,7 @@ const $504a0778da8270dd$var$isObject = (val)=>val && typeof val === 'object' &&
|
|
|
384
384
|
parcelRegister("5H8Dk", function(module, exports) {
|
|
385
385
|
'use strict';
|
|
386
386
|
|
|
387
|
-
var $
|
|
387
|
+
var $7UcG9 = parcelRequire("7UcG9");
|
|
388
388
|
|
|
389
389
|
var $4DgJ9 = parcelRequire("4DgJ9");
|
|
390
390
|
var $4257aa52be6213bf$require$CHAR_ASTERISK = $4DgJ9.CHAR_ASTERISK;
|
|
@@ -629,8 +629,8 @@ const $4257aa52be6213bf$var$depth = (token)=>{
|
|
|
629
629
|
if ($4257aa52be6213bf$var$isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
630
630
|
}
|
|
631
631
|
if (opts.unescape === true) {
|
|
632
|
-
if (glob) glob = $
|
|
633
|
-
if (base && backslashes === true) base = $
|
|
632
|
+
if (glob) glob = $7UcG9.removeBackslashes(glob);
|
|
633
|
+
if (base && backslashes === true) base = $7UcG9.removeBackslashes(base);
|
|
634
634
|
}
|
|
635
635
|
const state = {
|
|
636
636
|
prefix: prefix,
|
|
@@ -685,7 +685,7 @@ const $4257aa52be6213bf$var$depth = (token)=>{
|
|
|
685
685
|
module.exports = $4257aa52be6213bf$var$scan;
|
|
686
686
|
|
|
687
687
|
});
|
|
688
|
-
parcelRegister("
|
|
688
|
+
parcelRegister("7UcG9", function(module, exports) {
|
|
689
689
|
|
|
690
690
|
$parcel$export(module.exports, "isObject", () => $5c17991a3182beca$export$a6cdc56e425d0d0a, (v) => $5c17991a3182beca$export$a6cdc56e425d0d0a = v);
|
|
691
691
|
$parcel$export(module.exports, "hasRegexChars", () => $5c17991a3182beca$export$6540a013a39bb50d, (v) => $5c17991a3182beca$export$6540a013a39bb50d = v);
|
|
@@ -942,7 +942,7 @@ parcelRegister("ahJIq", function(module, exports) {
|
|
|
942
942
|
|
|
943
943
|
var $4DgJ9 = parcelRequire("4DgJ9");
|
|
944
944
|
|
|
945
|
-
var $
|
|
945
|
+
var $7UcG9 = parcelRequire("7UcG9");
|
|
946
946
|
/**
|
|
947
947
|
* Constants
|
|
948
948
|
*/ const { MAX_LENGTH: $77cef412a5a7e510$var$MAX_LENGTH, POSIX_REGEX_SOURCE: $77cef412a5a7e510$var$POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS: $77cef412a5a7e510$var$REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF: $77cef412a5a7e510$var$REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS: $77cef412a5a7e510$var$REPLACEMENTS } = $4DgJ9;
|
|
@@ -955,7 +955,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
955
955
|
try {
|
|
956
956
|
/* eslint-disable-next-line no-new */ new RegExp(value);
|
|
957
957
|
} catch (ex) {
|
|
958
|
-
return args.map((v)=>$
|
|
958
|
+
return args.map((v)=>$7UcG9.escapeRegex(v)).join('..');
|
|
959
959
|
}
|
|
960
960
|
return value;
|
|
961
961
|
};
|
|
@@ -987,7 +987,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
987
987
|
bos
|
|
988
988
|
];
|
|
989
989
|
const capture = opts.capture ? '' : '?:';
|
|
990
|
-
const win32 = $
|
|
990
|
+
const win32 = $7UcG9.isWindows(options);
|
|
991
991
|
// create constants based on platform, for windows or posix
|
|
992
992
|
const PLATFORM_CHARS = $4DgJ9.globChars(win32);
|
|
993
993
|
const EXTGLOB_CHARS = $4DgJ9.extglobChars(PLATFORM_CHARS);
|
|
@@ -1018,7 +1018,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1018
1018
|
globstar: false,
|
|
1019
1019
|
tokens: tokens
|
|
1020
1020
|
};
|
|
1021
|
-
input = $
|
|
1021
|
+
input = $7UcG9.removePrefix(input, state);
|
|
1022
1022
|
len = input.length;
|
|
1023
1023
|
const extglobs = [];
|
|
1024
1024
|
const braces = [];
|
|
@@ -1172,7 +1172,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1172
1172
|
state.output = input;
|
|
1173
1173
|
return state;
|
|
1174
1174
|
}
|
|
1175
|
-
state.output = $
|
|
1175
|
+
state.output = $7UcG9.wrapOutput(output, state, options);
|
|
1176
1176
|
return state;
|
|
1177
1177
|
}
|
|
1178
1178
|
/**
|
|
@@ -1248,7 +1248,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1248
1248
|
* If we're inside a quoted string, continue
|
|
1249
1249
|
* until we reach the closing double quote.
|
|
1250
1250
|
*/ if (state.quotes === 1 && value !== '"') {
|
|
1251
|
-
value = $
|
|
1251
|
+
value = $7UcG9.escapeRegex(value);
|
|
1252
1252
|
prev.value += value;
|
|
1253
1253
|
append({
|
|
1254
1254
|
value: value
|
|
@@ -1330,8 +1330,8 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1330
1330
|
});
|
|
1331
1331
|
// when literal brackets are explicitly disabled
|
|
1332
1332
|
// assume we should match with a regex character class
|
|
1333
|
-
if (opts.literalBrackets === false || $
|
|
1334
|
-
const escaped = $
|
|
1333
|
+
if (opts.literalBrackets === false || $7UcG9.hasRegexChars(prevValue)) continue;
|
|
1334
|
+
const escaped = $7UcG9.escapeRegex(prev.value);
|
|
1335
1335
|
state.output = state.output.slice(0, -prev.value.length);
|
|
1336
1336
|
// when literal brackets are explicitly enabled
|
|
1337
1337
|
// assume we should escape the brackets to match literal characters
|
|
@@ -1485,7 +1485,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1485
1485
|
if (prev && prev.type === 'paren') {
|
|
1486
1486
|
const next = peek();
|
|
1487
1487
|
let output = value;
|
|
1488
|
-
if (next === '<' && !$
|
|
1488
|
+
if (next === '<' && !$7UcG9.supportsLookbehinds()) throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
|
1489
1489
|
if (prev.value === '(' && !/[!=<:]/.test(next) || next === '<' && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
|
|
1490
1490
|
push({
|
|
1491
1491
|
type: 'text',
|
|
@@ -1734,17 +1734,17 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1734
1734
|
}
|
|
1735
1735
|
while(state.brackets > 0){
|
|
1736
1736
|
if (opts.strictBrackets === true) throw new SyntaxError($77cef412a5a7e510$var$syntaxError('closing', ']'));
|
|
1737
|
-
state.output = $
|
|
1737
|
+
state.output = $7UcG9.escapeLast(state.output, '[');
|
|
1738
1738
|
decrement('brackets');
|
|
1739
1739
|
}
|
|
1740
1740
|
while(state.parens > 0){
|
|
1741
1741
|
if (opts.strictBrackets === true) throw new SyntaxError($77cef412a5a7e510$var$syntaxError('closing', ')'));
|
|
1742
|
-
state.output = $
|
|
1742
|
+
state.output = $7UcG9.escapeLast(state.output, '(');
|
|
1743
1743
|
decrement('parens');
|
|
1744
1744
|
}
|
|
1745
1745
|
while(state.braces > 0){
|
|
1746
1746
|
if (opts.strictBrackets === true) throw new SyntaxError($77cef412a5a7e510$var$syntaxError('closing', '}'));
|
|
1747
|
-
state.output = $
|
|
1747
|
+
state.output = $7UcG9.escapeLast(state.output, '{');
|
|
1748
1748
|
decrement('braces');
|
|
1749
1749
|
}
|
|
1750
1750
|
if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) push({
|
|
@@ -1774,7 +1774,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1774
1774
|
const len = input.length;
|
|
1775
1775
|
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1776
1776
|
input = $77cef412a5a7e510$var$REPLACEMENTS[input] || input;
|
|
1777
|
-
const win32 = $
|
|
1777
|
+
const win32 = $7UcG9.isWindows(options);
|
|
1778
1778
|
// create constants based on platform, for windows or posix
|
|
1779
1779
|
const { DOT_LITERAL: DOT_LITERAL, SLASH_LITERAL: SLASH_LITERAL, ONE_CHAR: ONE_CHAR, DOTS_SLASH: DOTS_SLASH, NO_DOT: NO_DOT, NO_DOTS: NO_DOTS, NO_DOTS_SLASH: NO_DOTS_SLASH, STAR: STAR, START_ANCHOR: START_ANCHOR } = $4DgJ9.globChars(win32);
|
|
1780
1780
|
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
@@ -1818,7 +1818,7 @@ var $7M9UT = parcelRequire("7M9UT");
|
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
1820
|
};
|
|
1821
|
-
const output = $
|
|
1821
|
+
const output = $7UcG9.removePrefix(input, state);
|
|
1822
1822
|
let source = create(output);
|
|
1823
1823
|
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
|
|
1824
1824
|
return source;
|
|
@@ -31067,7 +31067,7 @@ $f30ff4896fda5c70$exports = (parcelRequire("6TnoJ"));
|
|
|
31067
31067
|
|
|
31068
31068
|
|
|
31069
31069
|
|
|
31070
|
-
var $
|
|
31070
|
+
var $7UcG9 = parcelRequire("7UcG9");
|
|
31071
31071
|
const $00cf20914f274048$var$isEmptyString = (v)=>v === '' || v === './';
|
|
31072
31072
|
const $00cf20914f274048$var$hasBraces = (v)=>{
|
|
31073
31073
|
const index = v.indexOf('{');
|
|
@@ -31251,7 +31251,7 @@ const $00cf20914f274048$var$hasBraces = (v)=>{
|
|
|
31251
31251
|
* @return {Object} Returns an object with only keys that match the given patterns.
|
|
31252
31252
|
* @api public
|
|
31253
31253
|
*/ $00cf20914f274048$var$micromatch.matchKeys = (obj, patterns, options)=>{
|
|
31254
|
-
if (!$
|
|
31254
|
+
if (!$7UcG9.isObject(obj)) throw new TypeError('Expected the first argument to be an object');
|
|
31255
31255
|
let keys = $00cf20914f274048$var$micromatch(Object.keys(obj), patterns, options);
|
|
31256
31256
|
let res = {};
|
|
31257
31257
|
for (let key of keys)res[key] = obj[key];
|
|
@@ -31359,12 +31359,12 @@ const $00cf20914f274048$var$hasBraces = (v)=>{
|
|
|
31359
31359
|
* @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
|
|
31360
31360
|
* @api public
|
|
31361
31361
|
*/ $00cf20914f274048$var$micromatch.capture = (glob, input, options)=>{
|
|
31362
|
-
let posix = $
|
|
31362
|
+
let posix = $7UcG9.isWindows(options);
|
|
31363
31363
|
let regex = $f30ff4896fda5c70$exports.makeRe(String(glob), {
|
|
31364
31364
|
...options,
|
|
31365
31365
|
capture: true
|
|
31366
31366
|
});
|
|
31367
|
-
let match = regex.exec(posix ? $
|
|
31367
|
+
let match = regex.exec(posix ? $7UcG9.toPosixSlashes(input) : input);
|
|
31368
31368
|
if (match) return match.slice(1).map((v)=>v === void 0 ? '' : v);
|
|
31369
31369
|
};
|
|
31370
31370
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/utils",
|
|
3
|
-
"version": "2.0.0-canary.
|
|
3
|
+
"version": "2.0.0-canary.1849+b66f37168",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@parcel/codeframe": "2.0.0-canary.
|
|
37
|
-
"@parcel/diagnostic": "2.0.0-canary.
|
|
38
|
-
"@parcel/logger": "2.0.0-canary.
|
|
39
|
-
"@parcel/markdown-ansi": "2.0.0-canary.
|
|
40
|
-
"@parcel/rust": "2.15.
|
|
36
|
+
"@parcel/codeframe": "2.0.0-canary.1849+b66f37168",
|
|
37
|
+
"@parcel/diagnostic": "2.0.0-canary.1849+b66f37168",
|
|
38
|
+
"@parcel/logger": "2.0.0-canary.1849+b66f37168",
|
|
39
|
+
"@parcel/markdown-ansi": "2.0.0-canary.1849+b66f37168",
|
|
40
|
+
"@parcel/rust": "2.15.3-canary.3472+b66f37168",
|
|
41
41
|
"@parcel/source-map": "^2.1.1",
|
|
42
42
|
"chalk": "^4.1.2",
|
|
43
43
|
"nullthrows": "^1.1.1"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"./src/openInBrowser.js": false,
|
|
67
67
|
"@parcel/markdown-ansi": false
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "b66f37168d0e830c030d0427bceac90117674cae"
|
|
70
70
|
}
|