prettier 3.0.0-alpha.10 → 3.0.0-alpha.11
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/LICENSE +2 -2
- package/index.cjs +1 -1
- package/index.d.ts +1 -3
- package/index.mjs +1660 -663
- package/package.json +1 -1
- package/plugins/acorn.js +12 -12
- package/plugins/acorn.mjs +12 -12
- package/plugins/angular.d.ts +1 -1
- package/plugins/angular.js +2 -2
- package/plugins/angular.mjs +2 -2
- package/plugins/babel.js +11 -11
- package/plugins/babel.mjs +11 -11
- package/plugins/flow.js +17 -17
- package/plugins/flow.mjs +17 -17
- package/plugins/glimmer.js +22 -22
- package/plugins/glimmer.mjs +22 -22
- package/plugins/graphql.js +15 -15
- package/plugins/graphql.mjs +15 -15
- package/plugins/html.d.ts +2 -2
- package/plugins/html.js +16 -16
- package/plugins/html.mjs +16 -16
- package/plugins/markdown.d.ts +1 -1
- package/plugins/markdown.js +47 -47
- package/plugins/markdown.mjs +47 -47
- package/plugins/meriyah.js +5 -5
- package/plugins/meriyah.mjs +5 -5
- package/plugins/postcss.js +44 -44
- package/plugins/postcss.mjs +44 -44
- package/plugins/typescript.js +19 -19
- package/plugins/typescript.mjs +19 -19
- package/plugins/yaml.js +104 -104
- package/plugins/yaml.mjs +104 -104
- package/standalone.js +15 -15
- package/standalone.mjs +15 -15
package/index.mjs
CHANGED
|
@@ -1841,16 +1841,16 @@ var require_chalk = __commonJS({
|
|
|
1841
1841
|
var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
|
|
1842
1842
|
var skipModels = /* @__PURE__ */ new Set(["gray"]);
|
|
1843
1843
|
var styles = /* @__PURE__ */ Object.create(null);
|
|
1844
|
-
function applyOptions(obj,
|
|
1845
|
-
|
|
1844
|
+
function applyOptions(obj, options8) {
|
|
1845
|
+
options8 = options8 || {};
|
|
1846
1846
|
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1847
|
-
obj.level =
|
|
1848
|
-
obj.enabled = "enabled" in
|
|
1847
|
+
obj.level = options8.level === void 0 ? scLevel : options8.level;
|
|
1848
|
+
obj.enabled = "enabled" in options8 ? options8.enabled : obj.level > 0;
|
|
1849
1849
|
}
|
|
1850
|
-
function Chalk(
|
|
1850
|
+
function Chalk(options8) {
|
|
1851
1851
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
1852
1852
|
const chalk = {};
|
|
1853
|
-
applyOptions(chalk,
|
|
1853
|
+
applyOptions(chalk, options8);
|
|
1854
1854
|
chalk.template = function() {
|
|
1855
1855
|
const args = [].slice.call(arguments);
|
|
1856
1856
|
return chalkTag.apply(null, [chalk.template].concat(args));
|
|
@@ -1860,7 +1860,7 @@ var require_chalk = __commonJS({
|
|
|
1860
1860
|
chalk.template.constructor = Chalk;
|
|
1861
1861
|
return chalk.template;
|
|
1862
1862
|
}
|
|
1863
|
-
applyOptions(this,
|
|
1863
|
+
applyOptions(this, options8);
|
|
1864
1864
|
}
|
|
1865
1865
|
if (isSimpleWindowsTerm) {
|
|
1866
1866
|
ansiStyles.blue.open = "\x1B[94m";
|
|
@@ -2599,7 +2599,7 @@ var require_normalize = __commonJS({
|
|
|
2599
2599
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2600
2600
|
var defaults_1 = require_defaults();
|
|
2601
2601
|
var utils_1 = require_utils();
|
|
2602
|
-
exports.normalize = (
|
|
2602
|
+
exports.normalize = (options8, schemas, opts) => new Normalizer(schemas, opts).normalize(options8);
|
|
2603
2603
|
var Normalizer = class {
|
|
2604
2604
|
constructor(schemas, opts) {
|
|
2605
2605
|
const { logger = console, descriptor = defaults_1.defaultDescriptor, unknown = defaults_1.defaultUnknownHandler, invalid = defaults_1.defaultInvalidHandler, deprecated = defaults_1.defaultDeprecatedHandler } = opts || {};
|
|
@@ -2625,9 +2625,9 @@ var require_normalize = __commonJS({
|
|
|
2625
2625
|
cleanHistory() {
|
|
2626
2626
|
this._hasDeprecationWarned = utils_1.createAutoChecklist();
|
|
2627
2627
|
}
|
|
2628
|
-
normalize(
|
|
2628
|
+
normalize(options8) {
|
|
2629
2629
|
const normalized = {};
|
|
2630
|
-
const restOptionsArray = [
|
|
2630
|
+
const restOptionsArray = [options8];
|
|
2631
2631
|
const applyNormalization = () => {
|
|
2632
2632
|
while (restOptionsArray.length !== 0) {
|
|
2633
2633
|
const currentOptions = restOptionsArray.shift();
|
|
@@ -2654,12 +2654,12 @@ var require_normalize = __commonJS({
|
|
|
2654
2654
|
}
|
|
2655
2655
|
return normalized;
|
|
2656
2656
|
}
|
|
2657
|
-
_applyNormalization(
|
|
2657
|
+
_applyNormalization(options8, normalized) {
|
|
2658
2658
|
const transferredOptionsArray = [];
|
|
2659
|
-
const [knownOptionNames, unknownOptionNames] = utils_1.partition(Object.keys(
|
|
2659
|
+
const [knownOptionNames, unknownOptionNames] = utils_1.partition(Object.keys(options8), (key) => key in this._utils.schemas);
|
|
2660
2660
|
for (const key of knownOptionNames) {
|
|
2661
2661
|
const schema = this._utils.schemas[key];
|
|
2662
|
-
const value = schema.preprocess(
|
|
2662
|
+
const value = schema.preprocess(options8[key], this._utils);
|
|
2663
2663
|
const validateResult = utils_1.normalizeValidateResult(schema.validate(value, this._utils), value);
|
|
2664
2664
|
if (validateResult !== true) {
|
|
2665
2665
|
const { value: invalidValue } = validateResult;
|
|
@@ -2710,7 +2710,7 @@ var require_normalize = __commonJS({
|
|
|
2710
2710
|
}
|
|
2711
2711
|
}
|
|
2712
2712
|
for (const key of unknownOptionNames) {
|
|
2713
|
-
const value =
|
|
2713
|
+
const value = options8[key];
|
|
2714
2714
|
const unknownResult = this._unknownHandler(key, value, this._utils);
|
|
2715
2715
|
if (unknownResult) {
|
|
2716
2716
|
for (const unknownKey of Object.keys(unknownResult)) {
|
|
@@ -2976,7 +2976,7 @@ var require_is_glob = __commonJS({
|
|
|
2976
2976
|
}
|
|
2977
2977
|
return false;
|
|
2978
2978
|
};
|
|
2979
|
-
module.exports = function isGlob(str,
|
|
2979
|
+
module.exports = function isGlob(str, options8) {
|
|
2980
2980
|
if (typeof str !== "string" || str === "") {
|
|
2981
2981
|
return false;
|
|
2982
2982
|
}
|
|
@@ -2984,7 +2984,7 @@ var require_is_glob = __commonJS({
|
|
|
2984
2984
|
return true;
|
|
2985
2985
|
}
|
|
2986
2986
|
var check2 = strictCheck;
|
|
2987
|
-
if (
|
|
2987
|
+
if (options8 && options8.strict === false) {
|
|
2988
2988
|
check2 = relaxedCheck;
|
|
2989
2989
|
}
|
|
2990
2990
|
return check2(str);
|
|
@@ -3005,8 +3005,8 @@ var require_glob_parent = __commonJS({
|
|
|
3005
3005
|
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
|
3006
3006
|
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
3007
3007
|
module.exports = function globParent(str, opts) {
|
|
3008
|
-
var
|
|
3009
|
-
if (
|
|
3008
|
+
var options8 = Object.assign({ flipBackslashes: true }, opts);
|
|
3009
|
+
if (options8.flipBackslashes && isWin32 && str.indexOf(slash2) < 0) {
|
|
3010
3010
|
str = str.replace(backslash, slash2);
|
|
3011
3011
|
}
|
|
3012
3012
|
if (enclosure.test(str)) {
|
|
@@ -3110,10 +3110,10 @@ var require_stringify = __commonJS({
|
|
|
3110
3110
|
"node_modules/braces/lib/stringify.js"(exports, module) {
|
|
3111
3111
|
"use strict";
|
|
3112
3112
|
var utils = require_utils2();
|
|
3113
|
-
module.exports = (ast,
|
|
3113
|
+
module.exports = (ast, options8 = {}) => {
|
|
3114
3114
|
let stringify = (node, parent = {}) => {
|
|
3115
|
-
let invalidBlock =
|
|
3116
|
-
let invalidNode = node.invalid === true &&
|
|
3115
|
+
let invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent);
|
|
3116
|
+
let invalidNode = node.invalid === true && options8.escapeInvalid === true;
|
|
3117
3117
|
let output = "";
|
|
3118
3118
|
if (node.value) {
|
|
3119
3119
|
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
|
@@ -3157,7 +3157,7 @@ var require_to_regex_range = __commonJS({
|
|
|
3157
3157
|
"node_modules/to-regex-range/index.js"(exports, module) {
|
|
3158
3158
|
"use strict";
|
|
3159
3159
|
var isNumber = require_is_number();
|
|
3160
|
-
var toRegexRange = (min, max,
|
|
3160
|
+
var toRegexRange = (min, max, options8) => {
|
|
3161
3161
|
if (isNumber(min) === false) {
|
|
3162
3162
|
throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
3163
3163
|
}
|
|
@@ -3167,7 +3167,7 @@ var require_to_regex_range = __commonJS({
|
|
|
3167
3167
|
if (isNumber(max) === false) {
|
|
3168
3168
|
throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
3169
3169
|
}
|
|
3170
|
-
let opts = { relaxZeros: true, ...
|
|
3170
|
+
let opts = { relaxZeros: true, ...options8 };
|
|
3171
3171
|
if (typeof opts.strictZeros === "boolean") {
|
|
3172
3172
|
opts.relaxZeros = opts.strictZeros === false;
|
|
3173
3173
|
}
|
|
@@ -3218,10 +3218,10 @@ var require_to_regex_range = __commonJS({
|
|
|
3218
3218
|
toRegexRange.cache[cacheKey] = state;
|
|
3219
3219
|
return state.result;
|
|
3220
3220
|
};
|
|
3221
|
-
function collatePatterns(neg, pos,
|
|
3222
|
-
let onlyNegative = filterPatterns(neg, pos, "-", false,
|
|
3223
|
-
let onlyPositive = filterPatterns(pos, neg, "", false,
|
|
3224
|
-
let intersected = filterPatterns(neg, pos, "-?", true,
|
|
3221
|
+
function collatePatterns(neg, pos, options8) {
|
|
3222
|
+
let onlyNegative = filterPatterns(neg, pos, "-", false, options8) || [];
|
|
3223
|
+
let onlyPositive = filterPatterns(pos, neg, "", false, options8) || [];
|
|
3224
|
+
let intersected = filterPatterns(neg, pos, "-?", true, options8) || [];
|
|
3225
3225
|
let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
|
|
3226
3226
|
return subpatterns.join("|");
|
|
3227
3227
|
}
|
|
@@ -3245,7 +3245,7 @@ var require_to_regex_range = __commonJS({
|
|
|
3245
3245
|
stops.sort(compare);
|
|
3246
3246
|
return stops;
|
|
3247
3247
|
}
|
|
3248
|
-
function rangeToPattern(start, stop,
|
|
3248
|
+
function rangeToPattern(start, stop, options8) {
|
|
3249
3249
|
if (start === stop) {
|
|
3250
3250
|
return { pattern: start, count: [], digits: 0 };
|
|
3251
3251
|
}
|
|
@@ -3258,24 +3258,24 @@ var require_to_regex_range = __commonJS({
|
|
|
3258
3258
|
if (startDigit === stopDigit) {
|
|
3259
3259
|
pattern += startDigit;
|
|
3260
3260
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
3261
|
-
pattern += toCharacterClass(startDigit, stopDigit,
|
|
3261
|
+
pattern += toCharacterClass(startDigit, stopDigit, options8);
|
|
3262
3262
|
} else {
|
|
3263
3263
|
count++;
|
|
3264
3264
|
}
|
|
3265
3265
|
}
|
|
3266
3266
|
if (count) {
|
|
3267
|
-
pattern +=
|
|
3267
|
+
pattern += options8.shorthand === true ? "\\d" : "[0-9]";
|
|
3268
3268
|
}
|
|
3269
3269
|
return { pattern, count: [count], digits };
|
|
3270
3270
|
}
|
|
3271
|
-
function splitToPatterns(min, max, tok,
|
|
3271
|
+
function splitToPatterns(min, max, tok, options8) {
|
|
3272
3272
|
let ranges = splitToRanges(min, max);
|
|
3273
3273
|
let tokens = [];
|
|
3274
3274
|
let start = min;
|
|
3275
3275
|
let prev;
|
|
3276
3276
|
for (let i = 0; i < ranges.length; i++) {
|
|
3277
3277
|
let max2 = ranges[i];
|
|
3278
|
-
let obj = rangeToPattern(String(start), String(max2),
|
|
3278
|
+
let obj = rangeToPattern(String(start), String(max2), options8);
|
|
3279
3279
|
let zeros = "";
|
|
3280
3280
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
3281
3281
|
if (prev.count.length > 1) {
|
|
@@ -3287,7 +3287,7 @@ var require_to_regex_range = __commonJS({
|
|
|
3287
3287
|
continue;
|
|
3288
3288
|
}
|
|
3289
3289
|
if (tok.isPadded) {
|
|
3290
|
-
zeros = padZeros(max2, tok,
|
|
3290
|
+
zeros = padZeros(max2, tok, options8);
|
|
3291
3291
|
}
|
|
3292
3292
|
obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
|
3293
3293
|
tokens.push(obj);
|
|
@@ -3296,7 +3296,7 @@ var require_to_regex_range = __commonJS({
|
|
|
3296
3296
|
}
|
|
3297
3297
|
return tokens;
|
|
3298
3298
|
}
|
|
3299
|
-
function filterPatterns(arr, comparison, prefix, intersection,
|
|
3299
|
+
function filterPatterns(arr, comparison, prefix, intersection, options8) {
|
|
3300
3300
|
let result = [];
|
|
3301
3301
|
for (let ele of arr) {
|
|
3302
3302
|
let { string } = ele;
|
|
@@ -3334,18 +3334,18 @@ var require_to_regex_range = __commonJS({
|
|
|
3334
3334
|
}
|
|
3335
3335
|
return "";
|
|
3336
3336
|
}
|
|
3337
|
-
function toCharacterClass(a, b,
|
|
3337
|
+
function toCharacterClass(a, b, options8) {
|
|
3338
3338
|
return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
|
|
3339
3339
|
}
|
|
3340
3340
|
function hasPadding(str) {
|
|
3341
3341
|
return /^-?(0+)\d/.test(str);
|
|
3342
3342
|
}
|
|
3343
|
-
function padZeros(value, tok,
|
|
3343
|
+
function padZeros(value, tok, options8) {
|
|
3344
3344
|
if (!tok.isPadded) {
|
|
3345
3345
|
return value;
|
|
3346
3346
|
}
|
|
3347
3347
|
let diff = Math.abs(tok.maxLen - String(value).length);
|
|
3348
|
-
let relax =
|
|
3348
|
+
let relax = options8.relaxZeros !== false;
|
|
3349
3349
|
switch (diff) {
|
|
3350
3350
|
case 0:
|
|
3351
3351
|
return "";
|
|
@@ -3389,11 +3389,11 @@ var require_fill_range = __commonJS({
|
|
|
3389
3389
|
;
|
|
3390
3390
|
return index > 0;
|
|
3391
3391
|
};
|
|
3392
|
-
var stringify = (start, end,
|
|
3392
|
+
var stringify = (start, end, options8) => {
|
|
3393
3393
|
if (typeof start === "string" || typeof end === "string") {
|
|
3394
3394
|
return true;
|
|
3395
3395
|
}
|
|
3396
|
-
return
|
|
3396
|
+
return options8.stringify === true;
|
|
3397
3397
|
};
|
|
3398
3398
|
var pad = (input, maxLength, toNumber) => {
|
|
3399
3399
|
if (maxLength > 0) {
|
|
@@ -3417,10 +3417,10 @@ var require_fill_range = __commonJS({
|
|
|
3417
3417
|
input = "0" + input;
|
|
3418
3418
|
return negative ? "-" + input : input;
|
|
3419
3419
|
};
|
|
3420
|
-
var toSequence = (parts,
|
|
3420
|
+
var toSequence = (parts, options8) => {
|
|
3421
3421
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
3422
3422
|
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
3423
|
-
let prefix =
|
|
3423
|
+
let prefix = options8.capture ? "" : "?:";
|
|
3424
3424
|
let positives = "";
|
|
3425
3425
|
let negatives = "";
|
|
3426
3426
|
let result;
|
|
@@ -3435,14 +3435,14 @@ var require_fill_range = __commonJS({
|
|
|
3435
3435
|
} else {
|
|
3436
3436
|
result = positives || negatives;
|
|
3437
3437
|
}
|
|
3438
|
-
if (
|
|
3438
|
+
if (options8.wrap) {
|
|
3439
3439
|
return `(${prefix}${result})`;
|
|
3440
3440
|
}
|
|
3441
3441
|
return result;
|
|
3442
3442
|
};
|
|
3443
|
-
var toRange = (a, b, isNumbers,
|
|
3443
|
+
var toRange = (a, b, isNumbers, options8) => {
|
|
3444
3444
|
if (isNumbers) {
|
|
3445
|
-
return toRegexRange(a, b, { wrap: false, ...
|
|
3445
|
+
return toRegexRange(a, b, { wrap: false, ...options8 });
|
|
3446
3446
|
}
|
|
3447
3447
|
let start = String.fromCharCode(a);
|
|
3448
3448
|
if (a === b)
|
|
@@ -3450,33 +3450,33 @@ var require_fill_range = __commonJS({
|
|
|
3450
3450
|
let stop = String.fromCharCode(b);
|
|
3451
3451
|
return `[${start}-${stop}]`;
|
|
3452
3452
|
};
|
|
3453
|
-
var toRegex = (start, end,
|
|
3453
|
+
var toRegex = (start, end, options8) => {
|
|
3454
3454
|
if (Array.isArray(start)) {
|
|
3455
|
-
let wrap =
|
|
3456
|
-
let prefix =
|
|
3455
|
+
let wrap = options8.wrap === true;
|
|
3456
|
+
let prefix = options8.capture ? "" : "?:";
|
|
3457
3457
|
return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
|
|
3458
3458
|
}
|
|
3459
|
-
return toRegexRange(start, end,
|
|
3459
|
+
return toRegexRange(start, end, options8);
|
|
3460
3460
|
};
|
|
3461
3461
|
var rangeError = (...args) => {
|
|
3462
3462
|
return new RangeError("Invalid range arguments: " + util.inspect(...args));
|
|
3463
3463
|
};
|
|
3464
|
-
var invalidRange = (start, end,
|
|
3465
|
-
if (
|
|
3464
|
+
var invalidRange = (start, end, options8) => {
|
|
3465
|
+
if (options8.strictRanges === true)
|
|
3466
3466
|
throw rangeError([start, end]);
|
|
3467
3467
|
return [];
|
|
3468
3468
|
};
|
|
3469
|
-
var invalidStep = (step,
|
|
3470
|
-
if (
|
|
3469
|
+
var invalidStep = (step, options8) => {
|
|
3470
|
+
if (options8.strictRanges === true) {
|
|
3471
3471
|
throw new TypeError(`Expected step "${step}" to be a number`);
|
|
3472
3472
|
}
|
|
3473
3473
|
return [];
|
|
3474
3474
|
};
|
|
3475
|
-
var fillNumbers = (start, end, step = 1,
|
|
3475
|
+
var fillNumbers = (start, end, step = 1, options8 = {}) => {
|
|
3476
3476
|
let a = Number(start);
|
|
3477
3477
|
let b = Number(end);
|
|
3478
3478
|
if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
|
3479
|
-
if (
|
|
3479
|
+
if (options8.strictRanges === true)
|
|
3480
3480
|
throw rangeError([start, end]);
|
|
3481
3481
|
return [];
|
|
3482
3482
|
}
|
|
@@ -3491,17 +3491,17 @@ var require_fill_range = __commonJS({
|
|
|
3491
3491
|
step = Math.max(Math.abs(step), 1);
|
|
3492
3492
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
3493
3493
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
3494
|
-
let toNumber = padded === false && stringify(start, end,
|
|
3495
|
-
let format3 =
|
|
3496
|
-
if (
|
|
3497
|
-
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true,
|
|
3494
|
+
let toNumber = padded === false && stringify(start, end, options8) === false;
|
|
3495
|
+
let format3 = options8.transform || transform2(toNumber);
|
|
3496
|
+
if (options8.toRegex && step === 1) {
|
|
3497
|
+
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options8);
|
|
3498
3498
|
}
|
|
3499
3499
|
let parts = { negatives: [], positives: [] };
|
|
3500
3500
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
3501
3501
|
let range = [];
|
|
3502
3502
|
let index = 0;
|
|
3503
3503
|
while (descending ? a >= b : a <= b) {
|
|
3504
|
-
if (
|
|
3504
|
+
if (options8.toRegex === true && step > 1) {
|
|
3505
3505
|
push(a);
|
|
3506
3506
|
} else {
|
|
3507
3507
|
range.push(pad(format3(a, index), maxLen, toNumber));
|
|
@@ -3509,23 +3509,23 @@ var require_fill_range = __commonJS({
|
|
|
3509
3509
|
a = descending ? a - step : a + step;
|
|
3510
3510
|
index++;
|
|
3511
3511
|
}
|
|
3512
|
-
if (
|
|
3513
|
-
return step > 1 ? toSequence(parts,
|
|
3512
|
+
if (options8.toRegex === true) {
|
|
3513
|
+
return step > 1 ? toSequence(parts, options8) : toRegex(range, null, { wrap: false, ...options8 });
|
|
3514
3514
|
}
|
|
3515
3515
|
return range;
|
|
3516
3516
|
};
|
|
3517
|
-
var fillLetters = (start, end, step = 1,
|
|
3517
|
+
var fillLetters = (start, end, step = 1, options8 = {}) => {
|
|
3518
3518
|
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
3519
|
-
return invalidRange(start, end,
|
|
3519
|
+
return invalidRange(start, end, options8);
|
|
3520
3520
|
}
|
|
3521
|
-
let format3 =
|
|
3521
|
+
let format3 = options8.transform || ((val) => String.fromCharCode(val));
|
|
3522
3522
|
let a = `${start}`.charCodeAt(0);
|
|
3523
3523
|
let b = `${end}`.charCodeAt(0);
|
|
3524
3524
|
let descending = a > b;
|
|
3525
3525
|
let min = Math.min(a, b);
|
|
3526
3526
|
let max = Math.max(a, b);
|
|
3527
|
-
if (
|
|
3528
|
-
return toRange(min, max, false,
|
|
3527
|
+
if (options8.toRegex && step === 1) {
|
|
3528
|
+
return toRange(min, max, false, options8);
|
|
3529
3529
|
}
|
|
3530
3530
|
let range = [];
|
|
3531
3531
|
let index = 0;
|
|
@@ -3534,17 +3534,17 @@ var require_fill_range = __commonJS({
|
|
|
3534
3534
|
a = descending ? a - step : a + step;
|
|
3535
3535
|
index++;
|
|
3536
3536
|
}
|
|
3537
|
-
if (
|
|
3538
|
-
return toRegex(range, null, { wrap: false, options });
|
|
3537
|
+
if (options8.toRegex === true) {
|
|
3538
|
+
return toRegex(range, null, { wrap: false, options: options8 });
|
|
3539
3539
|
}
|
|
3540
3540
|
return range;
|
|
3541
3541
|
};
|
|
3542
|
-
var fill2 = (start, end, step,
|
|
3542
|
+
var fill2 = (start, end, step, options8 = {}) => {
|
|
3543
3543
|
if (end == null && isValidValue(start)) {
|
|
3544
3544
|
return [start];
|
|
3545
3545
|
}
|
|
3546
3546
|
if (!isValidValue(start) || !isValidValue(end)) {
|
|
3547
|
-
return invalidRange(start, end,
|
|
3547
|
+
return invalidRange(start, end, options8);
|
|
3548
3548
|
}
|
|
3549
3549
|
if (typeof step === "function") {
|
|
3550
3550
|
return fill2(start, end, 1, { transform: step });
|
|
@@ -3552,7 +3552,7 @@ var require_fill_range = __commonJS({
|
|
|
3552
3552
|
if (isObject2(step)) {
|
|
3553
3553
|
return fill2(start, end, 0, step);
|
|
3554
3554
|
}
|
|
3555
|
-
let opts = { ...
|
|
3555
|
+
let opts = { ...options8 };
|
|
3556
3556
|
if (opts.capture === true)
|
|
3557
3557
|
opts.wrap = true;
|
|
3558
3558
|
step = step || opts.step || 1;
|
|
@@ -3576,12 +3576,12 @@ var require_compile = __commonJS({
|
|
|
3576
3576
|
"use strict";
|
|
3577
3577
|
var fill2 = require_fill_range();
|
|
3578
3578
|
var utils = require_utils2();
|
|
3579
|
-
var compile = (ast,
|
|
3579
|
+
var compile = (ast, options8 = {}) => {
|
|
3580
3580
|
let walk = (node, parent = {}) => {
|
|
3581
3581
|
let invalidBlock = utils.isInvalidBrace(parent);
|
|
3582
|
-
let invalidNode = node.invalid === true &&
|
|
3582
|
+
let invalidNode = node.invalid === true && options8.escapeInvalid === true;
|
|
3583
3583
|
let invalid = invalidBlock === true || invalidNode === true;
|
|
3584
|
-
let prefix =
|
|
3584
|
+
let prefix = options8.escapeInvalid === true ? "\\" : "";
|
|
3585
3585
|
let output = "";
|
|
3586
3586
|
if (node.isOpen === true) {
|
|
3587
3587
|
return prefix + node.value;
|
|
@@ -3603,7 +3603,7 @@ var require_compile = __commonJS({
|
|
|
3603
3603
|
}
|
|
3604
3604
|
if (node.nodes && node.ranges > 0) {
|
|
3605
3605
|
let args = utils.reduce(node.nodes);
|
|
3606
|
-
let range = fill2(...args, { ...
|
|
3606
|
+
let range = fill2(...args, { ...options8, wrap: false, toRegex: true });
|
|
3607
3607
|
if (range.length !== 0) {
|
|
3608
3608
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
3609
3609
|
}
|
|
@@ -3652,8 +3652,8 @@ var require_expand = __commonJS({
|
|
|
3652
3652
|
}
|
|
3653
3653
|
return utils.flatten(result);
|
|
3654
3654
|
};
|
|
3655
|
-
var expand = (ast,
|
|
3656
|
-
let rangeLimit =
|
|
3655
|
+
var expand = (ast, options8 = {}) => {
|
|
3656
|
+
let rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit;
|
|
3657
3657
|
let walk = (node, parent = {}) => {
|
|
3658
3658
|
node.queue = [];
|
|
3659
3659
|
let p = parent;
|
|
@@ -3663,7 +3663,7 @@ var require_expand = __commonJS({
|
|
|
3663
3663
|
q = p.queue;
|
|
3664
3664
|
}
|
|
3665
3665
|
if (node.invalid || node.dollar) {
|
|
3666
|
-
q.push(append(q.pop(), stringify(node,
|
|
3666
|
+
q.push(append(q.pop(), stringify(node, options8)));
|
|
3667
3667
|
return;
|
|
3668
3668
|
}
|
|
3669
3669
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
@@ -3672,12 +3672,12 @@ var require_expand = __commonJS({
|
|
|
3672
3672
|
}
|
|
3673
3673
|
if (node.nodes && node.ranges > 0) {
|
|
3674
3674
|
let args = utils.reduce(node.nodes);
|
|
3675
|
-
if (utils.exceedsLimit(...args,
|
|
3675
|
+
if (utils.exceedsLimit(...args, options8.step, rangeLimit)) {
|
|
3676
3676
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
3677
3677
|
}
|
|
3678
|
-
let range = fill2(...args,
|
|
3678
|
+
let range = fill2(...args, options8);
|
|
3679
3679
|
if (range.length === 0) {
|
|
3680
|
-
range = stringify(node,
|
|
3680
|
+
range = stringify(node, options8);
|
|
3681
3681
|
}
|
|
3682
3682
|
q.push(append(q.pop(), range));
|
|
3683
3683
|
node.nodes = [];
|
|
@@ -3853,11 +3853,11 @@ var require_parse = __commonJS({
|
|
|
3853
3853
|
CHAR_NO_BREAK_SPACE,
|
|
3854
3854
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
3855
3855
|
} = require_constants();
|
|
3856
|
-
var parse3 = (input,
|
|
3856
|
+
var parse3 = (input, options8 = {}) => {
|
|
3857
3857
|
if (typeof input !== "string") {
|
|
3858
3858
|
throw new TypeError("Expected a string");
|
|
3859
3859
|
}
|
|
3860
|
-
let opts =
|
|
3860
|
+
let opts = options8 || {};
|
|
3861
3861
|
let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
3862
3862
|
if (input.length > max) {
|
|
3863
3863
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
@@ -3895,7 +3895,7 @@ var require_parse = __commonJS({
|
|
|
3895
3895
|
continue;
|
|
3896
3896
|
}
|
|
3897
3897
|
if (value === CHAR_BACKSLASH) {
|
|
3898
|
-
push({ type: "text", value: (
|
|
3898
|
+
push({ type: "text", value: (options8.keepEscaping ? value : "") + advance() });
|
|
3899
3899
|
continue;
|
|
3900
3900
|
}
|
|
3901
3901
|
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
@@ -3945,7 +3945,7 @@ var require_parse = __commonJS({
|
|
|
3945
3945
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
3946
3946
|
let open = value;
|
|
3947
3947
|
let next;
|
|
3948
|
-
if (
|
|
3948
|
+
if (options8.keepQuotes !== true) {
|
|
3949
3949
|
value = "";
|
|
3950
3950
|
}
|
|
3951
3951
|
while (index < length && (next = advance())) {
|
|
@@ -3954,7 +3954,7 @@ var require_parse = __commonJS({
|
|
|
3954
3954
|
continue;
|
|
3955
3955
|
}
|
|
3956
3956
|
if (next === open) {
|
|
3957
|
-
if (
|
|
3957
|
+
if (options8.keepQuotes === true)
|
|
3958
3958
|
value += next;
|
|
3959
3959
|
break;
|
|
3960
3960
|
}
|
|
@@ -4071,11 +4071,11 @@ var require_braces = __commonJS({
|
|
|
4071
4071
|
var compile = require_compile();
|
|
4072
4072
|
var expand = require_expand();
|
|
4073
4073
|
var parse3 = require_parse();
|
|
4074
|
-
var braces = (input,
|
|
4074
|
+
var braces = (input, options8 = {}) => {
|
|
4075
4075
|
let output = [];
|
|
4076
4076
|
if (Array.isArray(input)) {
|
|
4077
4077
|
for (let pattern of input) {
|
|
4078
|
-
let result = braces.create(pattern,
|
|
4078
|
+
let result = braces.create(pattern, options8);
|
|
4079
4079
|
if (Array.isArray(result)) {
|
|
4080
4080
|
output.push(...result);
|
|
4081
4081
|
} else {
|
|
@@ -4083,44 +4083,44 @@ var require_braces = __commonJS({
|
|
|
4083
4083
|
}
|
|
4084
4084
|
}
|
|
4085
4085
|
} else {
|
|
4086
|
-
output = [].concat(braces.create(input,
|
|
4086
|
+
output = [].concat(braces.create(input, options8));
|
|
4087
4087
|
}
|
|
4088
|
-
if (
|
|
4088
|
+
if (options8 && options8.expand === true && options8.nodupes === true) {
|
|
4089
4089
|
output = [...new Set(output)];
|
|
4090
4090
|
}
|
|
4091
4091
|
return output;
|
|
4092
4092
|
};
|
|
4093
|
-
braces.parse = (input,
|
|
4094
|
-
braces.stringify = (input,
|
|
4093
|
+
braces.parse = (input, options8 = {}) => parse3(input, options8);
|
|
4094
|
+
braces.stringify = (input, options8 = {}) => {
|
|
4095
4095
|
if (typeof input === "string") {
|
|
4096
|
-
return stringify(braces.parse(input,
|
|
4096
|
+
return stringify(braces.parse(input, options8), options8);
|
|
4097
4097
|
}
|
|
4098
|
-
return stringify(input,
|
|
4098
|
+
return stringify(input, options8);
|
|
4099
4099
|
};
|
|
4100
|
-
braces.compile = (input,
|
|
4100
|
+
braces.compile = (input, options8 = {}) => {
|
|
4101
4101
|
if (typeof input === "string") {
|
|
4102
|
-
input = braces.parse(input,
|
|
4102
|
+
input = braces.parse(input, options8);
|
|
4103
4103
|
}
|
|
4104
|
-
return compile(input,
|
|
4104
|
+
return compile(input, options8);
|
|
4105
4105
|
};
|
|
4106
|
-
braces.expand = (input,
|
|
4106
|
+
braces.expand = (input, options8 = {}) => {
|
|
4107
4107
|
if (typeof input === "string") {
|
|
4108
|
-
input = braces.parse(input,
|
|
4108
|
+
input = braces.parse(input, options8);
|
|
4109
4109
|
}
|
|
4110
|
-
let result = expand(input,
|
|
4111
|
-
if (
|
|
4110
|
+
let result = expand(input, options8);
|
|
4111
|
+
if (options8.noempty === true) {
|
|
4112
4112
|
result = result.filter(Boolean);
|
|
4113
4113
|
}
|
|
4114
|
-
if (
|
|
4114
|
+
if (options8.nodupes === true) {
|
|
4115
4115
|
result = [...new Set(result)];
|
|
4116
4116
|
}
|
|
4117
4117
|
return result;
|
|
4118
4118
|
};
|
|
4119
|
-
braces.create = (input,
|
|
4119
|
+
braces.create = (input, options8 = {}) => {
|
|
4120
4120
|
if (input === "" || input.length < 3) {
|
|
4121
4121
|
return [input];
|
|
4122
4122
|
}
|
|
4123
|
-
return
|
|
4123
|
+
return options8.expand !== true ? braces.compile(input, options8) : braces.expand(input, options8);
|
|
4124
4124
|
};
|
|
4125
4125
|
module.exports = braces;
|
|
4126
4126
|
}
|
|
@@ -4352,9 +4352,9 @@ var require_utils3 = __commonJS({
|
|
|
4352
4352
|
}
|
|
4353
4353
|
return false;
|
|
4354
4354
|
};
|
|
4355
|
-
exports.isWindows = (
|
|
4356
|
-
if (
|
|
4357
|
-
return
|
|
4355
|
+
exports.isWindows = (options8) => {
|
|
4356
|
+
if (options8 && typeof options8.windows === "boolean") {
|
|
4357
|
+
return options8.windows;
|
|
4358
4358
|
}
|
|
4359
4359
|
return win32 === true || path11.sep === "\\";
|
|
4360
4360
|
};
|
|
@@ -4374,9 +4374,9 @@ var require_utils3 = __commonJS({
|
|
|
4374
4374
|
}
|
|
4375
4375
|
return output;
|
|
4376
4376
|
};
|
|
4377
|
-
exports.wrapOutput = (input, state = {},
|
|
4378
|
-
const prepend =
|
|
4379
|
-
const append =
|
|
4377
|
+
exports.wrapOutput = (input, state = {}, options8 = {}) => {
|
|
4378
|
+
const prepend = options8.contains ? "" : "^";
|
|
4379
|
+
const append = options8.contains ? "" : "$";
|
|
4380
4380
|
let output = `${prepend}(?:${input})${append}`;
|
|
4381
4381
|
if (state.negated === true) {
|
|
4382
4382
|
output = `(?:^(?!${output}).*$)`;
|
|
@@ -4431,8 +4431,8 @@ var require_scan = __commonJS({
|
|
|
4431
4431
|
token.depth = token.isGlobstar ? Infinity : 1;
|
|
4432
4432
|
}
|
|
4433
4433
|
};
|
|
4434
|
-
var scan = (input,
|
|
4435
|
-
const opts =
|
|
4434
|
+
var scan = (input, options8) => {
|
|
4435
|
+
const opts = options8 || {};
|
|
4436
4436
|
const length = input.length - 1;
|
|
4437
4437
|
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
4438
4438
|
const slashes = [];
|
|
@@ -4732,9 +4732,9 @@ var require_parse2 = __commonJS({
|
|
|
4732
4732
|
REGEX_SPECIAL_CHARS_BACKREF,
|
|
4733
4733
|
REPLACEMENTS
|
|
4734
4734
|
} = constants;
|
|
4735
|
-
var expandRange = (args,
|
|
4736
|
-
if (typeof
|
|
4737
|
-
return
|
|
4735
|
+
var expandRange = (args, options8) => {
|
|
4736
|
+
if (typeof options8.expandRange === "function") {
|
|
4737
|
+
return options8.expandRange(...args, options8);
|
|
4738
4738
|
}
|
|
4739
4739
|
args.sort();
|
|
4740
4740
|
const value = `[${args.join("-")}]`;
|
|
@@ -4748,12 +4748,12 @@ var require_parse2 = __commonJS({
|
|
|
4748
4748
|
var syntaxError = (type, char) => {
|
|
4749
4749
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
4750
4750
|
};
|
|
4751
|
-
var parse3 = (input,
|
|
4751
|
+
var parse3 = (input, options8) => {
|
|
4752
4752
|
if (typeof input !== "string") {
|
|
4753
4753
|
throw new TypeError("Expected a string");
|
|
4754
4754
|
}
|
|
4755
4755
|
input = REPLACEMENTS[input] || input;
|
|
4756
|
-
const opts = { ...
|
|
4756
|
+
const opts = { ...options8 };
|
|
4757
4757
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
4758
4758
|
let len = input.length;
|
|
4759
4759
|
if (len > max) {
|
|
@@ -4762,7 +4762,7 @@ var require_parse2 = __commonJS({
|
|
|
4762
4762
|
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
4763
4763
|
const tokens = [bos];
|
|
4764
4764
|
const capture = opts.capture ? "" : "?:";
|
|
4765
|
-
const win32 = utils.isWindows(
|
|
4765
|
+
const win32 = utils.isWindows(options8);
|
|
4766
4766
|
const PLATFORM_CHARS = constants.globChars(win32);
|
|
4767
4767
|
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
4768
4768
|
const {
|
|
@@ -4898,7 +4898,7 @@ var require_parse2 = __commonJS({
|
|
|
4898
4898
|
output = token.close = `)$))${extglobStar}`;
|
|
4899
4899
|
}
|
|
4900
4900
|
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
4901
|
-
const expression = parse3(rest, { ...
|
|
4901
|
+
const expression = parse3(rest, { ...options8, fastpaths: false }).output;
|
|
4902
4902
|
output = token.close = `)${expression})${extglobStar})`;
|
|
4903
4903
|
}
|
|
4904
4904
|
if (token.prev.type === "bos") {
|
|
@@ -4948,7 +4948,7 @@ var require_parse2 = __commonJS({
|
|
|
4948
4948
|
state.output = input;
|
|
4949
4949
|
return state;
|
|
4950
4950
|
}
|
|
4951
|
-
state.output = utils.wrapOutput(output, state,
|
|
4951
|
+
state.output = utils.wrapOutput(output, state, options8);
|
|
4952
4952
|
return state;
|
|
4953
4953
|
}
|
|
4954
4954
|
while (!eos()) {
|
|
@@ -5427,15 +5427,15 @@ var require_parse2 = __commonJS({
|
|
|
5427
5427
|
}
|
|
5428
5428
|
return state;
|
|
5429
5429
|
};
|
|
5430
|
-
parse3.fastpaths = (input,
|
|
5431
|
-
const opts = { ...
|
|
5430
|
+
parse3.fastpaths = (input, options8) => {
|
|
5431
|
+
const opts = { ...options8 };
|
|
5432
5432
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
5433
5433
|
const len = input.length;
|
|
5434
5434
|
if (len > max) {
|
|
5435
5435
|
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
5436
5436
|
}
|
|
5437
5437
|
input = REPLACEMENTS[input] || input;
|
|
5438
|
-
const win32 = utils.isWindows(
|
|
5438
|
+
const win32 = utils.isWindows(options8);
|
|
5439
5439
|
const {
|
|
5440
5440
|
DOT_LITERAL,
|
|
5441
5441
|
SLASH_LITERAL,
|
|
@@ -5510,9 +5510,9 @@ var require_picomatch = __commonJS({
|
|
|
5510
5510
|
var utils = require_utils3();
|
|
5511
5511
|
var constants = require_constants2();
|
|
5512
5512
|
var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
5513
|
-
var picomatch = (glob,
|
|
5513
|
+
var picomatch = (glob, options8, returnState = false) => {
|
|
5514
5514
|
if (Array.isArray(glob)) {
|
|
5515
|
-
const fns = glob.map((input) => picomatch(input,
|
|
5515
|
+
const fns = glob.map((input) => picomatch(input, options8, returnState));
|
|
5516
5516
|
const arrayMatcher = (str) => {
|
|
5517
5517
|
for (const isMatch of fns) {
|
|
5518
5518
|
const state2 = isMatch(str);
|
|
@@ -5527,18 +5527,18 @@ var require_picomatch = __commonJS({
|
|
|
5527
5527
|
if (glob === "" || typeof glob !== "string" && !isState) {
|
|
5528
5528
|
throw new TypeError("Expected pattern to be a non-empty string");
|
|
5529
5529
|
}
|
|
5530
|
-
const opts =
|
|
5531
|
-
const posix = utils.isWindows(
|
|
5532
|
-
const regex = isState ? picomatch.compileRe(glob,
|
|
5530
|
+
const opts = options8 || {};
|
|
5531
|
+
const posix = utils.isWindows(options8);
|
|
5532
|
+
const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
|
|
5533
5533
|
const state = regex.state;
|
|
5534
5534
|
delete regex.state;
|
|
5535
5535
|
let isIgnored2 = () => false;
|
|
5536
5536
|
if (opts.ignore) {
|
|
5537
|
-
const ignoreOpts = { ...
|
|
5537
|
+
const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
|
|
5538
5538
|
isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
5539
5539
|
}
|
|
5540
5540
|
const matcher = (input, returnObject = false) => {
|
|
5541
|
-
const { isMatch, match, output } = picomatch.test(input, regex,
|
|
5541
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
|
|
5542
5542
|
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
5543
5543
|
if (typeof opts.onResult === "function") {
|
|
5544
5544
|
opts.onResult(result);
|
|
@@ -5564,14 +5564,14 @@ var require_picomatch = __commonJS({
|
|
|
5564
5564
|
}
|
|
5565
5565
|
return matcher;
|
|
5566
5566
|
};
|
|
5567
|
-
picomatch.test = (input, regex,
|
|
5567
|
+
picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
|
|
5568
5568
|
if (typeof input !== "string") {
|
|
5569
5569
|
throw new TypeError("Expected input to be a string");
|
|
5570
5570
|
}
|
|
5571
5571
|
if (input === "") {
|
|
5572
5572
|
return { isMatch: false, output: "" };
|
|
5573
5573
|
}
|
|
5574
|
-
const opts =
|
|
5574
|
+
const opts = options8 || {};
|
|
5575
5575
|
const format3 = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
5576
5576
|
let match = input === glob;
|
|
5577
5577
|
let output = match && format3 ? format3(input) : input;
|
|
@@ -5581,60 +5581,60 @@ var require_picomatch = __commonJS({
|
|
|
5581
5581
|
}
|
|
5582
5582
|
if (match === false || opts.capture === true) {
|
|
5583
5583
|
if (opts.matchBase === true || opts.basename === true) {
|
|
5584
|
-
match = picomatch.matchBase(input, regex,
|
|
5584
|
+
match = picomatch.matchBase(input, regex, options8, posix);
|
|
5585
5585
|
} else {
|
|
5586
5586
|
match = regex.exec(output);
|
|
5587
5587
|
}
|
|
5588
5588
|
}
|
|
5589
5589
|
return { isMatch: Boolean(match), match, output };
|
|
5590
5590
|
};
|
|
5591
|
-
picomatch.matchBase = (input, glob,
|
|
5592
|
-
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob,
|
|
5591
|
+
picomatch.matchBase = (input, glob, options8, posix = utils.isWindows(options8)) => {
|
|
5592
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
|
|
5593
5593
|
return regex.test(path11.basename(input));
|
|
5594
5594
|
};
|
|
5595
|
-
picomatch.isMatch = (str, patterns,
|
|
5596
|
-
picomatch.parse = (pattern,
|
|
5595
|
+
picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
|
|
5596
|
+
picomatch.parse = (pattern, options8) => {
|
|
5597
5597
|
if (Array.isArray(pattern))
|
|
5598
|
-
return pattern.map((p) => picomatch.parse(p,
|
|
5599
|
-
return parse3(pattern, { ...
|
|
5598
|
+
return pattern.map((p) => picomatch.parse(p, options8));
|
|
5599
|
+
return parse3(pattern, { ...options8, fastpaths: false });
|
|
5600
5600
|
};
|
|
5601
|
-
picomatch.scan = (input,
|
|
5602
|
-
picomatch.compileRe = (state,
|
|
5601
|
+
picomatch.scan = (input, options8) => scan(input, options8);
|
|
5602
|
+
picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => {
|
|
5603
5603
|
if (returnOutput === true) {
|
|
5604
5604
|
return state.output;
|
|
5605
5605
|
}
|
|
5606
|
-
const opts =
|
|
5606
|
+
const opts = options8 || {};
|
|
5607
5607
|
const prepend = opts.contains ? "" : "^";
|
|
5608
5608
|
const append = opts.contains ? "" : "$";
|
|
5609
5609
|
let source = `${prepend}(?:${state.output})${append}`;
|
|
5610
5610
|
if (state && state.negated === true) {
|
|
5611
5611
|
source = `^(?!${source}).*$`;
|
|
5612
5612
|
}
|
|
5613
|
-
const regex = picomatch.toRegex(source,
|
|
5613
|
+
const regex = picomatch.toRegex(source, options8);
|
|
5614
5614
|
if (returnState === true) {
|
|
5615
5615
|
regex.state = state;
|
|
5616
5616
|
}
|
|
5617
5617
|
return regex;
|
|
5618
5618
|
};
|
|
5619
|
-
picomatch.makeRe = (input,
|
|
5619
|
+
picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
|
|
5620
5620
|
if (!input || typeof input !== "string") {
|
|
5621
5621
|
throw new TypeError("Expected a non-empty string");
|
|
5622
5622
|
}
|
|
5623
5623
|
let parsed = { negated: false, fastpaths: true };
|
|
5624
|
-
if (
|
|
5625
|
-
parsed.output = parse3.fastpaths(input,
|
|
5624
|
+
if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
5625
|
+
parsed.output = parse3.fastpaths(input, options8);
|
|
5626
5626
|
}
|
|
5627
5627
|
if (!parsed.output) {
|
|
5628
|
-
parsed = parse3(input,
|
|
5628
|
+
parsed = parse3(input, options8);
|
|
5629
5629
|
}
|
|
5630
|
-
return picomatch.compileRe(parsed,
|
|
5630
|
+
return picomatch.compileRe(parsed, options8, returnOutput, returnState);
|
|
5631
5631
|
};
|
|
5632
|
-
picomatch.toRegex = (source,
|
|
5632
|
+
picomatch.toRegex = (source, options8) => {
|
|
5633
5633
|
try {
|
|
5634
|
-
const opts =
|
|
5634
|
+
const opts = options8 || {};
|
|
5635
5635
|
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
5636
5636
|
} catch (err) {
|
|
5637
|
-
if (
|
|
5637
|
+
if (options8 && options8.debug === true)
|
|
5638
5638
|
throw err;
|
|
5639
5639
|
return /$^/;
|
|
5640
5640
|
}
|
|
@@ -5661,7 +5661,7 @@ var require_micromatch = __commonJS({
|
|
|
5661
5661
|
var picomatch = require_picomatch2();
|
|
5662
5662
|
var utils = require_utils3();
|
|
5663
5663
|
var isEmptyString = (val) => val === "" || val === "./";
|
|
5664
|
-
var micromatch2 = (list, patterns,
|
|
5664
|
+
var micromatch2 = (list, patterns, options8) => {
|
|
5665
5665
|
patterns = [].concat(patterns);
|
|
5666
5666
|
list = [].concat(list);
|
|
5667
5667
|
let omit2 = /* @__PURE__ */ new Set();
|
|
@@ -5670,12 +5670,12 @@ var require_micromatch = __commonJS({
|
|
|
5670
5670
|
let negatives = 0;
|
|
5671
5671
|
let onResult = (state) => {
|
|
5672
5672
|
items.add(state.output);
|
|
5673
|
-
if (
|
|
5674
|
-
|
|
5673
|
+
if (options8 && options8.onResult) {
|
|
5674
|
+
options8.onResult(state);
|
|
5675
5675
|
}
|
|
5676
5676
|
};
|
|
5677
5677
|
for (let i = 0; i < patterns.length; i++) {
|
|
5678
|
-
let isMatch = picomatch(String(patterns[i]), { ...
|
|
5678
|
+
let isMatch = picomatch(String(patterns[i]), { ...options8, onResult }, true);
|
|
5679
5679
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
5680
5680
|
if (negated)
|
|
5681
5681
|
negatives++;
|
|
@@ -5694,30 +5694,30 @@ var require_micromatch = __commonJS({
|
|
|
5694
5694
|
}
|
|
5695
5695
|
let result = negatives === patterns.length ? [...items] : [...keep];
|
|
5696
5696
|
let matches = result.filter((item) => !omit2.has(item));
|
|
5697
|
-
if (
|
|
5698
|
-
if (
|
|
5697
|
+
if (options8 && matches.length === 0) {
|
|
5698
|
+
if (options8.failglob === true) {
|
|
5699
5699
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
5700
5700
|
}
|
|
5701
|
-
if (
|
|
5702
|
-
return
|
|
5701
|
+
if (options8.nonull === true || options8.nullglob === true) {
|
|
5702
|
+
return options8.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
5703
5703
|
}
|
|
5704
5704
|
}
|
|
5705
5705
|
return matches;
|
|
5706
5706
|
};
|
|
5707
5707
|
micromatch2.match = micromatch2;
|
|
5708
|
-
micromatch2.matcher = (pattern,
|
|
5709
|
-
micromatch2.isMatch = (str, patterns,
|
|
5708
|
+
micromatch2.matcher = (pattern, options8) => picomatch(pattern, options8);
|
|
5709
|
+
micromatch2.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
|
|
5710
5710
|
micromatch2.any = micromatch2.isMatch;
|
|
5711
|
-
micromatch2.not = (list, patterns,
|
|
5711
|
+
micromatch2.not = (list, patterns, options8 = {}) => {
|
|
5712
5712
|
patterns = [].concat(patterns).map(String);
|
|
5713
5713
|
let result = /* @__PURE__ */ new Set();
|
|
5714
5714
|
let items = [];
|
|
5715
5715
|
let onResult = (state) => {
|
|
5716
|
-
if (
|
|
5717
|
-
|
|
5716
|
+
if (options8.onResult)
|
|
5717
|
+
options8.onResult(state);
|
|
5718
5718
|
items.push(state.output);
|
|
5719
5719
|
};
|
|
5720
|
-
let matches = new Set(micromatch2(list, patterns, { ...
|
|
5720
|
+
let matches = new Set(micromatch2(list, patterns, { ...options8, onResult }));
|
|
5721
5721
|
for (let item of items) {
|
|
5722
5722
|
if (!matches.has(item)) {
|
|
5723
5723
|
result.add(item);
|
|
@@ -5725,12 +5725,12 @@ var require_micromatch = __commonJS({
|
|
|
5725
5725
|
}
|
|
5726
5726
|
return [...result];
|
|
5727
5727
|
};
|
|
5728
|
-
micromatch2.contains = (str, pattern,
|
|
5728
|
+
micromatch2.contains = (str, pattern, options8) => {
|
|
5729
5729
|
if (typeof str !== "string") {
|
|
5730
5730
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
5731
5731
|
}
|
|
5732
5732
|
if (Array.isArray(pattern)) {
|
|
5733
|
-
return pattern.some((p) => micromatch2.contains(str, p,
|
|
5733
|
+
return pattern.some((p) => micromatch2.contains(str, p, options8));
|
|
5734
5734
|
}
|
|
5735
5735
|
if (typeof pattern === "string") {
|
|
5736
5736
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -5740,47 +5740,47 @@ var require_micromatch = __commonJS({
|
|
|
5740
5740
|
return true;
|
|
5741
5741
|
}
|
|
5742
5742
|
}
|
|
5743
|
-
return micromatch2.isMatch(str, pattern, { ...
|
|
5743
|
+
return micromatch2.isMatch(str, pattern, { ...options8, contains: true });
|
|
5744
5744
|
};
|
|
5745
|
-
micromatch2.matchKeys = (obj, patterns,
|
|
5745
|
+
micromatch2.matchKeys = (obj, patterns, options8) => {
|
|
5746
5746
|
if (!utils.isObject(obj)) {
|
|
5747
5747
|
throw new TypeError("Expected the first argument to be an object");
|
|
5748
5748
|
}
|
|
5749
|
-
let keys = micromatch2(Object.keys(obj), patterns,
|
|
5749
|
+
let keys = micromatch2(Object.keys(obj), patterns, options8);
|
|
5750
5750
|
let res = {};
|
|
5751
5751
|
for (let key of keys)
|
|
5752
5752
|
res[key] = obj[key];
|
|
5753
5753
|
return res;
|
|
5754
5754
|
};
|
|
5755
|
-
micromatch2.some = (list, patterns,
|
|
5755
|
+
micromatch2.some = (list, patterns, options8) => {
|
|
5756
5756
|
let items = [].concat(list);
|
|
5757
5757
|
for (let pattern of [].concat(patterns)) {
|
|
5758
|
-
let isMatch = picomatch(String(pattern),
|
|
5758
|
+
let isMatch = picomatch(String(pattern), options8);
|
|
5759
5759
|
if (items.some((item) => isMatch(item))) {
|
|
5760
5760
|
return true;
|
|
5761
5761
|
}
|
|
5762
5762
|
}
|
|
5763
5763
|
return false;
|
|
5764
5764
|
};
|
|
5765
|
-
micromatch2.every = (list, patterns,
|
|
5765
|
+
micromatch2.every = (list, patterns, options8) => {
|
|
5766
5766
|
let items = [].concat(list);
|
|
5767
5767
|
for (let pattern of [].concat(patterns)) {
|
|
5768
|
-
let isMatch = picomatch(String(pattern),
|
|
5768
|
+
let isMatch = picomatch(String(pattern), options8);
|
|
5769
5769
|
if (!items.every((item) => isMatch(item))) {
|
|
5770
5770
|
return false;
|
|
5771
5771
|
}
|
|
5772
5772
|
}
|
|
5773
5773
|
return true;
|
|
5774
5774
|
};
|
|
5775
|
-
micromatch2.all = (str, patterns,
|
|
5775
|
+
micromatch2.all = (str, patterns, options8) => {
|
|
5776
5776
|
if (typeof str !== "string") {
|
|
5777
5777
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
5778
5778
|
}
|
|
5779
|
-
return [].concat(patterns).every((p) => picomatch(p,
|
|
5779
|
+
return [].concat(patterns).every((p) => picomatch(p, options8)(str));
|
|
5780
5780
|
};
|
|
5781
|
-
micromatch2.capture = (glob, input,
|
|
5782
|
-
let posix = utils.isWindows(
|
|
5783
|
-
let regex = picomatch.makeRe(String(glob), { ...
|
|
5781
|
+
micromatch2.capture = (glob, input, options8) => {
|
|
5782
|
+
let posix = utils.isWindows(options8);
|
|
5783
|
+
let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
|
|
5784
5784
|
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
|
5785
5785
|
if (match) {
|
|
5786
5786
|
return match.slice(1).map((v) => v === void 0 ? "" : v);
|
|
@@ -5788,27 +5788,27 @@ var require_micromatch = __commonJS({
|
|
|
5788
5788
|
};
|
|
5789
5789
|
micromatch2.makeRe = (...args) => picomatch.makeRe(...args);
|
|
5790
5790
|
micromatch2.scan = (...args) => picomatch.scan(...args);
|
|
5791
|
-
micromatch2.parse = (patterns,
|
|
5791
|
+
micromatch2.parse = (patterns, options8) => {
|
|
5792
5792
|
let res = [];
|
|
5793
5793
|
for (let pattern of [].concat(patterns || [])) {
|
|
5794
|
-
for (let str of braces(String(pattern),
|
|
5795
|
-
res.push(picomatch.parse(str,
|
|
5794
|
+
for (let str of braces(String(pattern), options8)) {
|
|
5795
|
+
res.push(picomatch.parse(str, options8));
|
|
5796
5796
|
}
|
|
5797
5797
|
}
|
|
5798
5798
|
return res;
|
|
5799
5799
|
};
|
|
5800
|
-
micromatch2.braces = (pattern,
|
|
5800
|
+
micromatch2.braces = (pattern, options8) => {
|
|
5801
5801
|
if (typeof pattern !== "string")
|
|
5802
5802
|
throw new TypeError("Expected a string");
|
|
5803
|
-
if (
|
|
5803
|
+
if (options8 && options8.nobrace === true || !/\{.*\}/.test(pattern)) {
|
|
5804
5804
|
return [pattern];
|
|
5805
5805
|
}
|
|
5806
|
-
return braces(pattern,
|
|
5806
|
+
return braces(pattern, options8);
|
|
5807
5807
|
};
|
|
5808
|
-
micromatch2.braceExpand = (pattern,
|
|
5808
|
+
micromatch2.braceExpand = (pattern, options8) => {
|
|
5809
5809
|
if (typeof pattern !== "string")
|
|
5810
5810
|
throw new TypeError("Expected a string");
|
|
5811
|
-
return micromatch2.braces(pattern, { ...
|
|
5811
|
+
return micromatch2.braces(pattern, { ...options8, expand: true });
|
|
5812
5812
|
};
|
|
5813
5813
|
module.exports = micromatch2;
|
|
5814
5814
|
}
|
|
@@ -5830,24 +5830,24 @@ var require_pattern = __commonJS({
|
|
|
5830
5830
|
var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
|
5831
5831
|
var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
|
5832
5832
|
var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
|
5833
|
-
function isStaticPattern(pattern,
|
|
5834
|
-
return !isDynamicPattern(pattern,
|
|
5833
|
+
function isStaticPattern(pattern, options8 = {}) {
|
|
5834
|
+
return !isDynamicPattern(pattern, options8);
|
|
5835
5835
|
}
|
|
5836
5836
|
exports.isStaticPattern = isStaticPattern;
|
|
5837
|
-
function isDynamicPattern(pattern,
|
|
5837
|
+
function isDynamicPattern(pattern, options8 = {}) {
|
|
5838
5838
|
if (pattern === "") {
|
|
5839
5839
|
return false;
|
|
5840
5840
|
}
|
|
5841
|
-
if (
|
|
5841
|
+
if (options8.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
|
5842
5842
|
return true;
|
|
5843
5843
|
}
|
|
5844
5844
|
if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
|
5845
5845
|
return true;
|
|
5846
5846
|
}
|
|
5847
|
-
if (
|
|
5847
|
+
if (options8.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
|
5848
5848
|
return true;
|
|
5849
5849
|
}
|
|
5850
|
-
if (
|
|
5850
|
+
if (options8.braceExpansion !== false && hasBraceExpansion(pattern)) {
|
|
5851
5851
|
return true;
|
|
5852
5852
|
}
|
|
5853
5853
|
return false;
|
|
@@ -5931,8 +5931,8 @@ var require_pattern = __commonJS({
|
|
|
5931
5931
|
});
|
|
5932
5932
|
}
|
|
5933
5933
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
5934
|
-
function getPatternParts(pattern,
|
|
5935
|
-
let { parts } = micromatch2.scan(pattern, Object.assign(Object.assign({},
|
|
5934
|
+
function getPatternParts(pattern, options8) {
|
|
5935
|
+
let { parts } = micromatch2.scan(pattern, Object.assign(Object.assign({}, options8), { parts: true }));
|
|
5936
5936
|
if (parts.length === 0) {
|
|
5937
5937
|
parts = [pattern];
|
|
5938
5938
|
}
|
|
@@ -5943,12 +5943,12 @@ var require_pattern = __commonJS({
|
|
|
5943
5943
|
return parts;
|
|
5944
5944
|
}
|
|
5945
5945
|
exports.getPatternParts = getPatternParts;
|
|
5946
|
-
function makeRe(pattern,
|
|
5947
|
-
return micromatch2.makeRe(pattern,
|
|
5946
|
+
function makeRe(pattern, options8) {
|
|
5947
|
+
return micromatch2.makeRe(pattern, options8);
|
|
5948
5948
|
}
|
|
5949
5949
|
exports.makeRe = makeRe;
|
|
5950
|
-
function convertPatternsToRe(patterns,
|
|
5951
|
-
return patterns.map((pattern) => makeRe(pattern,
|
|
5950
|
+
function convertPatternsToRe(patterns, options8) {
|
|
5951
|
+
return patterns.map((pattern) => makeRe(pattern, options8));
|
|
5952
5952
|
}
|
|
5953
5953
|
exports.convertPatternsToRe = convertPatternsToRe;
|
|
5954
5954
|
function matchAny(entry, patternsRe) {
|
|
@@ -5970,24 +5970,24 @@ var require_merge2 = __commonJS({
|
|
|
5970
5970
|
const streamsQueue = [];
|
|
5971
5971
|
const args = slice.call(arguments);
|
|
5972
5972
|
let merging = false;
|
|
5973
|
-
let
|
|
5974
|
-
if (
|
|
5973
|
+
let options8 = args[args.length - 1];
|
|
5974
|
+
if (options8 && !Array.isArray(options8) && options8.pipe == null) {
|
|
5975
5975
|
args.pop();
|
|
5976
5976
|
} else {
|
|
5977
|
-
|
|
5977
|
+
options8 = {};
|
|
5978
5978
|
}
|
|
5979
|
-
const doEnd =
|
|
5980
|
-
const doPipeError =
|
|
5981
|
-
if (
|
|
5982
|
-
|
|
5979
|
+
const doEnd = options8.end !== false;
|
|
5980
|
+
const doPipeError = options8.pipeError === true;
|
|
5981
|
+
if (options8.objectMode == null) {
|
|
5982
|
+
options8.objectMode = true;
|
|
5983
5983
|
}
|
|
5984
|
-
if (
|
|
5985
|
-
|
|
5984
|
+
if (options8.highWaterMark == null) {
|
|
5985
|
+
options8.highWaterMark = 64 * 1024;
|
|
5986
5986
|
}
|
|
5987
|
-
const mergedStream = PassThrough(
|
|
5987
|
+
const mergedStream = PassThrough(options8);
|
|
5988
5988
|
function addStream() {
|
|
5989
5989
|
for (let i = 0, len = arguments.length; i < len; i++) {
|
|
5990
|
-
streamsQueue.push(pauseStreams(arguments[i],
|
|
5990
|
+
streamsQueue.push(pauseStreams(arguments[i], options8));
|
|
5991
5991
|
}
|
|
5992
5992
|
mergeStream();
|
|
5993
5993
|
return this;
|
|
@@ -6058,10 +6058,10 @@ var require_merge2 = __commonJS({
|
|
|
6058
6058
|
}
|
|
6059
6059
|
return mergedStream;
|
|
6060
6060
|
}
|
|
6061
|
-
function pauseStreams(streams,
|
|
6061
|
+
function pauseStreams(streams, options8) {
|
|
6062
6062
|
if (!Array.isArray(streams)) {
|
|
6063
6063
|
if (!streams._readableState && streams.pipe) {
|
|
6064
|
-
streams = streams.pipe(PassThrough(
|
|
6064
|
+
streams = streams.pipe(PassThrough(options8));
|
|
6065
6065
|
}
|
|
6066
6066
|
if (!streams._readableState || !streams.pause || !streams.pipe) {
|
|
6067
6067
|
throw new Error("Only readable stream can be merged.");
|
|
@@ -6069,7 +6069,7 @@ var require_merge2 = __commonJS({
|
|
|
6069
6069
|
streams.pause();
|
|
6070
6070
|
} else {
|
|
6071
6071
|
for (let i = 0, len = streams.length; i < len; i++) {
|
|
6072
|
-
streams[i] = pauseStreams(streams[i],
|
|
6072
|
+
streams[i] = pauseStreams(streams[i], options8);
|
|
6073
6073
|
}
|
|
6074
6074
|
}
|
|
6075
6075
|
return streams;
|
|
@@ -7488,15 +7488,15 @@ var require_stream3 = __commonJS({
|
|
|
7488
7488
|
this._walkStream = fsWalk.walkStream;
|
|
7489
7489
|
this._stat = fsStat.stat;
|
|
7490
7490
|
}
|
|
7491
|
-
dynamic(root,
|
|
7492
|
-
return this._walkStream(root,
|
|
7491
|
+
dynamic(root, options8) {
|
|
7492
|
+
return this._walkStream(root, options8);
|
|
7493
7493
|
}
|
|
7494
|
-
static(patterns,
|
|
7494
|
+
static(patterns, options8) {
|
|
7495
7495
|
const filepaths = patterns.map(this._getFullEntryPath, this);
|
|
7496
7496
|
const stream = new stream_1.PassThrough({ objectMode: true });
|
|
7497
7497
|
stream._write = (index, _enc, done) => {
|
|
7498
|
-
return this._getEntry(filepaths[index], patterns[index],
|
|
7499
|
-
if (entry !== null &&
|
|
7498
|
+
return this._getEntry(filepaths[index], patterns[index], options8).then((entry) => {
|
|
7499
|
+
if (entry !== null && options8.entryFilter(entry)) {
|
|
7500
7500
|
stream.push(entry);
|
|
7501
7501
|
}
|
|
7502
7502
|
if (index === filepaths.length - 1) {
|
|
@@ -7510,9 +7510,9 @@ var require_stream3 = __commonJS({
|
|
|
7510
7510
|
}
|
|
7511
7511
|
return stream;
|
|
7512
7512
|
}
|
|
7513
|
-
_getEntry(filepath, pattern,
|
|
7513
|
+
_getEntry(filepath, pattern, options8) {
|
|
7514
7514
|
return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
|
|
7515
|
-
if (
|
|
7515
|
+
if (options8.errorFilter(error)) {
|
|
7516
7516
|
return null;
|
|
7517
7517
|
}
|
|
7518
7518
|
throw error;
|
|
@@ -7544,9 +7544,9 @@ var require_async5 = __commonJS({
|
|
|
7544
7544
|
this._walkAsync = fsWalk.walk;
|
|
7545
7545
|
this._readerStream = new stream_1.default(this._settings);
|
|
7546
7546
|
}
|
|
7547
|
-
dynamic(root,
|
|
7547
|
+
dynamic(root, options8) {
|
|
7548
7548
|
return new Promise((resolve2, reject) => {
|
|
7549
|
-
this._walkAsync(root,
|
|
7549
|
+
this._walkAsync(root, options8, (error, entries) => {
|
|
7550
7550
|
if (error === null) {
|
|
7551
7551
|
resolve2(entries);
|
|
7552
7552
|
} else {
|
|
@@ -7555,9 +7555,9 @@ var require_async5 = __commonJS({
|
|
|
7555
7555
|
});
|
|
7556
7556
|
});
|
|
7557
7557
|
}
|
|
7558
|
-
async static(patterns,
|
|
7558
|
+
async static(patterns, options8) {
|
|
7559
7559
|
const entries = [];
|
|
7560
|
-
const stream = this._readerStream.static(patterns,
|
|
7560
|
+
const stream = this._readerStream.static(patterns, options8);
|
|
7561
7561
|
return new Promise((resolve2, reject) => {
|
|
7562
7562
|
stream.once("error", reject);
|
|
7563
7563
|
stream.on("data", (entry) => entries.push(entry));
|
|
@@ -7911,15 +7911,15 @@ var require_async6 = __commonJS({
|
|
|
7911
7911
|
}
|
|
7912
7912
|
async read(task) {
|
|
7913
7913
|
const root = this._getRootDirectory(task);
|
|
7914
|
-
const
|
|
7915
|
-
const entries = await this.api(root, task,
|
|
7916
|
-
return entries.map((entry) =>
|
|
7914
|
+
const options8 = this._getReaderOptions(task);
|
|
7915
|
+
const entries = await this.api(root, task, options8);
|
|
7916
|
+
return entries.map((entry) => options8.transform(entry));
|
|
7917
7917
|
}
|
|
7918
|
-
api(root, task,
|
|
7918
|
+
api(root, task, options8) {
|
|
7919
7919
|
if (task.dynamic) {
|
|
7920
|
-
return this._reader.dynamic(root,
|
|
7920
|
+
return this._reader.dynamic(root, options8);
|
|
7921
7921
|
}
|
|
7922
|
-
return this._reader.static(task.patterns,
|
|
7922
|
+
return this._reader.static(task.patterns, options8);
|
|
7923
7923
|
}
|
|
7924
7924
|
};
|
|
7925
7925
|
exports.default = ProviderAsync;
|
|
@@ -7941,19 +7941,19 @@ var require_stream4 = __commonJS({
|
|
|
7941
7941
|
}
|
|
7942
7942
|
read(task) {
|
|
7943
7943
|
const root = this._getRootDirectory(task);
|
|
7944
|
-
const
|
|
7945
|
-
const source = this.api(root, task,
|
|
7944
|
+
const options8 = this._getReaderOptions(task);
|
|
7945
|
+
const source = this.api(root, task, options8);
|
|
7946
7946
|
const destination = new stream_1.Readable({ objectMode: true, read: () => {
|
|
7947
7947
|
} });
|
|
7948
|
-
source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data",
|
|
7948
|
+
source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options8.transform(entry))).once("end", () => destination.emit("end"));
|
|
7949
7949
|
destination.once("close", () => source.destroy());
|
|
7950
7950
|
return destination;
|
|
7951
7951
|
}
|
|
7952
|
-
api(root, task,
|
|
7952
|
+
api(root, task, options8) {
|
|
7953
7953
|
if (task.dynamic) {
|
|
7954
|
-
return this._reader.dynamic(root,
|
|
7954
|
+
return this._reader.dynamic(root, options8);
|
|
7955
7955
|
}
|
|
7956
|
-
return this._reader.static(task.patterns,
|
|
7956
|
+
return this._reader.static(task.patterns, options8);
|
|
7957
7957
|
}
|
|
7958
7958
|
};
|
|
7959
7959
|
exports.default = ProviderStream;
|
|
@@ -7974,27 +7974,27 @@ var require_sync5 = __commonJS({
|
|
|
7974
7974
|
this._walkSync = fsWalk.walkSync;
|
|
7975
7975
|
this._statSync = fsStat.statSync;
|
|
7976
7976
|
}
|
|
7977
|
-
dynamic(root,
|
|
7978
|
-
return this._walkSync(root,
|
|
7977
|
+
dynamic(root, options8) {
|
|
7978
|
+
return this._walkSync(root, options8);
|
|
7979
7979
|
}
|
|
7980
|
-
static(patterns,
|
|
7980
|
+
static(patterns, options8) {
|
|
7981
7981
|
const entries = [];
|
|
7982
7982
|
for (const pattern of patterns) {
|
|
7983
7983
|
const filepath = this._getFullEntryPath(pattern);
|
|
7984
|
-
const entry = this._getEntry(filepath, pattern,
|
|
7985
|
-
if (entry === null || !
|
|
7984
|
+
const entry = this._getEntry(filepath, pattern, options8);
|
|
7985
|
+
if (entry === null || !options8.entryFilter(entry)) {
|
|
7986
7986
|
continue;
|
|
7987
7987
|
}
|
|
7988
7988
|
entries.push(entry);
|
|
7989
7989
|
}
|
|
7990
7990
|
return entries;
|
|
7991
7991
|
}
|
|
7992
|
-
_getEntry(filepath, pattern,
|
|
7992
|
+
_getEntry(filepath, pattern, options8) {
|
|
7993
7993
|
try {
|
|
7994
7994
|
const stats = this._getStat(filepath);
|
|
7995
7995
|
return this._makeEntry(stats, pattern);
|
|
7996
7996
|
} catch (error) {
|
|
7997
|
-
if (
|
|
7997
|
+
if (options8.errorFilter(error)) {
|
|
7998
7998
|
return null;
|
|
7999
7999
|
}
|
|
8000
8000
|
throw error;
|
|
@@ -8022,15 +8022,15 @@ var require_sync6 = __commonJS({
|
|
|
8022
8022
|
}
|
|
8023
8023
|
read(task) {
|
|
8024
8024
|
const root = this._getRootDirectory(task);
|
|
8025
|
-
const
|
|
8026
|
-
const entries = this.api(root, task,
|
|
8027
|
-
return entries.map(
|
|
8025
|
+
const options8 = this._getReaderOptions(task);
|
|
8026
|
+
const entries = this.api(root, task, options8);
|
|
8027
|
+
return entries.map(options8.transform);
|
|
8028
8028
|
}
|
|
8029
|
-
api(root, task,
|
|
8029
|
+
api(root, task, options8) {
|
|
8030
8030
|
if (task.dynamic) {
|
|
8031
|
-
return this._reader.dynamic(root,
|
|
8031
|
+
return this._reader.dynamic(root, options8);
|
|
8032
8032
|
}
|
|
8033
|
-
return this._reader.static(task.patterns,
|
|
8033
|
+
return this._reader.static(task.patterns, options8);
|
|
8034
8034
|
}
|
|
8035
8035
|
};
|
|
8036
8036
|
exports.default = ProviderSync;
|
|
@@ -8107,35 +8107,35 @@ var require_out4 = __commonJS({
|
|
|
8107
8107
|
var sync_1 = require_sync6();
|
|
8108
8108
|
var settings_1 = require_settings4();
|
|
8109
8109
|
var utils = require_utils4();
|
|
8110
|
-
async function FastGlob(source,
|
|
8110
|
+
async function FastGlob(source, options8) {
|
|
8111
8111
|
assertPatternsInput(source);
|
|
8112
|
-
const works = getWorks(source, async_1.default,
|
|
8112
|
+
const works = getWorks(source, async_1.default, options8);
|
|
8113
8113
|
const result = await Promise.all(works);
|
|
8114
8114
|
return utils.array.flatten(result);
|
|
8115
8115
|
}
|
|
8116
8116
|
(function(FastGlob2) {
|
|
8117
|
-
function sync(source,
|
|
8117
|
+
function sync(source, options8) {
|
|
8118
8118
|
assertPatternsInput(source);
|
|
8119
|
-
const works = getWorks(source, sync_1.default,
|
|
8119
|
+
const works = getWorks(source, sync_1.default, options8);
|
|
8120
8120
|
return utils.array.flatten(works);
|
|
8121
8121
|
}
|
|
8122
8122
|
FastGlob2.sync = sync;
|
|
8123
|
-
function stream(source,
|
|
8123
|
+
function stream(source, options8) {
|
|
8124
8124
|
assertPatternsInput(source);
|
|
8125
|
-
const works = getWorks(source, stream_1.default,
|
|
8125
|
+
const works = getWorks(source, stream_1.default, options8);
|
|
8126
8126
|
return utils.stream.merge(works);
|
|
8127
8127
|
}
|
|
8128
8128
|
FastGlob2.stream = stream;
|
|
8129
|
-
function generateTasks(source,
|
|
8129
|
+
function generateTasks(source, options8) {
|
|
8130
8130
|
assertPatternsInput(source);
|
|
8131
8131
|
const patterns = patternManager.transform([].concat(source));
|
|
8132
|
-
const settings = new settings_1.default(
|
|
8132
|
+
const settings = new settings_1.default(options8);
|
|
8133
8133
|
return taskManager.generate(patterns, settings);
|
|
8134
8134
|
}
|
|
8135
8135
|
FastGlob2.generateTasks = generateTasks;
|
|
8136
|
-
function isDynamicPattern(source,
|
|
8136
|
+
function isDynamicPattern(source, options8) {
|
|
8137
8137
|
assertPatternsInput(source);
|
|
8138
|
-
const settings = new settings_1.default(
|
|
8138
|
+
const settings = new settings_1.default(options8);
|
|
8139
8139
|
return utils.pattern.isDynamicPattern(source, settings);
|
|
8140
8140
|
}
|
|
8141
8141
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
@@ -8145,9 +8145,9 @@ var require_out4 = __commonJS({
|
|
|
8145
8145
|
}
|
|
8146
8146
|
FastGlob2.escapePath = escapePath;
|
|
8147
8147
|
})(FastGlob || (FastGlob = {}));
|
|
8148
|
-
function getWorks(source, _Provider,
|
|
8148
|
+
function getWorks(source, _Provider, options8) {
|
|
8149
8149
|
const patterns = patternManager.transform([].concat(source));
|
|
8150
|
-
const settings = new settings_1.default(
|
|
8150
|
+
const settings = new settings_1.default(options8);
|
|
8151
8151
|
const tasks = taskManager.generate(patterns, settings);
|
|
8152
8152
|
const provider = new _Provider(settings);
|
|
8153
8153
|
return tasks.map(provider.read, provider);
|
|
@@ -8177,13 +8177,13 @@ var require_base = __commonJS({
|
|
|
8177
8177
|
/*istanbul ignore start*/
|
|
8178
8178
|
/*istanbul ignore end*/
|
|
8179
8179
|
diff: function diff(oldString, newString) {
|
|
8180
|
-
var
|
|
8181
|
-
var callback =
|
|
8182
|
-
if (typeof
|
|
8183
|
-
callback =
|
|
8184
|
-
|
|
8180
|
+
var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
8181
|
+
var callback = options8.callback;
|
|
8182
|
+
if (typeof options8 === "function") {
|
|
8183
|
+
callback = options8;
|
|
8184
|
+
options8 = {};
|
|
8185
8185
|
}
|
|
8186
|
-
this.options =
|
|
8186
|
+
this.options = options8;
|
|
8187
8187
|
var self = this;
|
|
8188
8188
|
function done(value) {
|
|
8189
8189
|
if (callback) {
|
|
@@ -8202,8 +8202,8 @@ var require_base = __commonJS({
|
|
|
8202
8202
|
var newLen = newString.length, oldLen = oldString.length;
|
|
8203
8203
|
var editLength = 1;
|
|
8204
8204
|
var maxEditLength = newLen + oldLen;
|
|
8205
|
-
if (
|
|
8206
|
-
maxEditLength = Math.min(maxEditLength,
|
|
8205
|
+
if (options8.maxEditLength) {
|
|
8206
|
+
maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
|
|
8207
8207
|
}
|
|
8208
8208
|
var bestPath = [{
|
|
8209
8209
|
newPos: -1,
|
|
@@ -8432,22 +8432,22 @@ var require_readlines = __commonJS({
|
|
|
8432
8432
|
"use strict";
|
|
8433
8433
|
var fs6 = __require("fs");
|
|
8434
8434
|
var LineByLine = class {
|
|
8435
|
-
constructor(file,
|
|
8436
|
-
|
|
8437
|
-
if (!
|
|
8438
|
-
|
|
8439
|
-
if (!
|
|
8440
|
-
|
|
8435
|
+
constructor(file, options8) {
|
|
8436
|
+
options8 = options8 || {};
|
|
8437
|
+
if (!options8.readChunk)
|
|
8438
|
+
options8.readChunk = 1024;
|
|
8439
|
+
if (!options8.newLineCharacter) {
|
|
8440
|
+
options8.newLineCharacter = 10;
|
|
8441
8441
|
} else {
|
|
8442
|
-
|
|
8442
|
+
options8.newLineCharacter = options8.newLineCharacter.charCodeAt(0);
|
|
8443
8443
|
}
|
|
8444
8444
|
if (typeof file === "number") {
|
|
8445
8445
|
this.fd = file;
|
|
8446
8446
|
} else {
|
|
8447
8447
|
this.fd = fs6.openSync(file, "r");
|
|
8448
8448
|
}
|
|
8449
|
-
this.options =
|
|
8450
|
-
this.newLineCharacter =
|
|
8449
|
+
this.options = options8;
|
|
8450
|
+
this.newLineCharacter = options8.newLineCharacter;
|
|
8451
8451
|
this.reset();
|
|
8452
8452
|
}
|
|
8453
8453
|
_searchInBuffer(buffer, hexNeedle) {
|
|
@@ -9008,16 +9008,16 @@ var require_chalk2 = __commonJS({
|
|
|
9008
9008
|
var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
|
|
9009
9009
|
var skipModels = /* @__PURE__ */ new Set(["gray"]);
|
|
9010
9010
|
var styles = /* @__PURE__ */ Object.create(null);
|
|
9011
|
-
function applyOptions(obj,
|
|
9012
|
-
|
|
9011
|
+
function applyOptions(obj, options8) {
|
|
9012
|
+
options8 = options8 || {};
|
|
9013
9013
|
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
|
9014
|
-
obj.level =
|
|
9015
|
-
obj.enabled = "enabled" in
|
|
9014
|
+
obj.level = options8.level === void 0 ? scLevel : options8.level;
|
|
9015
|
+
obj.enabled = "enabled" in options8 ? options8.enabled : obj.level > 0;
|
|
9016
9016
|
}
|
|
9017
|
-
function Chalk(
|
|
9017
|
+
function Chalk(options8) {
|
|
9018
9018
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
9019
9019
|
const chalk = {};
|
|
9020
|
-
applyOptions(chalk,
|
|
9020
|
+
applyOptions(chalk, options8);
|
|
9021
9021
|
chalk.template = function() {
|
|
9022
9022
|
const args = [].slice.call(arguments);
|
|
9023
9023
|
return chalkTag.apply(null, [chalk.template].concat(args));
|
|
@@ -9027,7 +9027,7 @@ var require_chalk2 = __commonJS({
|
|
|
9027
9027
|
chalk.template.constructor = Chalk;
|
|
9028
9028
|
return chalk.template;
|
|
9029
9029
|
}
|
|
9030
|
-
applyOptions(this,
|
|
9030
|
+
applyOptions(this, options8);
|
|
9031
9031
|
}
|
|
9032
9032
|
if (isSimpleWindowsTerm) {
|
|
9033
9033
|
ansiStyles.blue.open = "\x1B[94m";
|
|
@@ -9241,18 +9241,18 @@ var require_lib3 = __commonJS({
|
|
|
9241
9241
|
}
|
|
9242
9242
|
return highlighted;
|
|
9243
9243
|
}
|
|
9244
|
-
function shouldHighlight(
|
|
9245
|
-
return !!_chalk.supportsColor ||
|
|
9244
|
+
function shouldHighlight(options8) {
|
|
9245
|
+
return !!_chalk.supportsColor || options8.forceColor;
|
|
9246
9246
|
}
|
|
9247
|
-
function getChalk(
|
|
9248
|
-
return
|
|
9247
|
+
function getChalk(options8) {
|
|
9248
|
+
return options8.forceColor ? new _chalk.constructor({
|
|
9249
9249
|
enabled: true,
|
|
9250
9250
|
level: 1
|
|
9251
9251
|
}) : _chalk;
|
|
9252
9252
|
}
|
|
9253
|
-
function highlight(code,
|
|
9254
|
-
if (code !== "" && shouldHighlight(
|
|
9255
|
-
const chalk = getChalk(
|
|
9253
|
+
function highlight(code, options8 = {}) {
|
|
9254
|
+
if (code !== "" && shouldHighlight(options8)) {
|
|
9255
|
+
const chalk = getChalk(options8);
|
|
9256
9256
|
const defs = getDefs(chalk);
|
|
9257
9257
|
return highlightTokens(defs, code);
|
|
9258
9258
|
} else {
|
|
@@ -9617,7 +9617,7 @@ var require_re = __commonJS({
|
|
|
9617
9617
|
var require_parse_options = __commonJS({
|
|
9618
9618
|
"node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
9619
9619
|
var opts = ["includePrerelease", "loose", "rtl"];
|
|
9620
|
-
var parseOptions = (
|
|
9620
|
+
var parseOptions = (options8) => !options8 ? {} : typeof options8 !== "object" ? { loose: true } : opts.filter((k) => options8[k]).reduce((o, k) => {
|
|
9621
9621
|
o[k] = true;
|
|
9622
9622
|
return o;
|
|
9623
9623
|
}, {});
|
|
@@ -9655,10 +9655,10 @@ var require_semver = __commonJS({
|
|
|
9655
9655
|
var parseOptions = require_parse_options();
|
|
9656
9656
|
var { compareIdentifiers } = require_identifiers();
|
|
9657
9657
|
var SemVer = class {
|
|
9658
|
-
constructor(version,
|
|
9659
|
-
|
|
9658
|
+
constructor(version, options8) {
|
|
9659
|
+
options8 = parseOptions(options8);
|
|
9660
9660
|
if (version instanceof SemVer) {
|
|
9661
|
-
if (version.loose === !!
|
|
9661
|
+
if (version.loose === !!options8.loose && version.includePrerelease === !!options8.includePrerelease) {
|
|
9662
9662
|
return version;
|
|
9663
9663
|
} else {
|
|
9664
9664
|
version = version.version;
|
|
@@ -9671,11 +9671,11 @@ var require_semver = __commonJS({
|
|
|
9671
9671
|
`version is longer than ${MAX_LENGTH} characters`
|
|
9672
9672
|
);
|
|
9673
9673
|
}
|
|
9674
|
-
debug("SemVer", version,
|
|
9675
|
-
this.options =
|
|
9676
|
-
this.loose = !!
|
|
9677
|
-
this.includePrerelease = !!
|
|
9678
|
-
const m = version.trim().match(
|
|
9674
|
+
debug("SemVer", version, options8);
|
|
9675
|
+
this.options = options8;
|
|
9676
|
+
this.loose = !!options8.loose;
|
|
9677
|
+
this.includePrerelease = !!options8.includePrerelease;
|
|
9678
|
+
const m = version.trim().match(options8.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
9679
9679
|
if (!m) {
|
|
9680
9680
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
9681
9681
|
}
|
|
@@ -10357,29 +10357,29 @@ var require_lru_cache = __commonJS({
|
|
|
10357
10357
|
function naiveLength() {
|
|
10358
10358
|
return 1;
|
|
10359
10359
|
}
|
|
10360
|
-
function LRUCache(
|
|
10360
|
+
function LRUCache(options8) {
|
|
10361
10361
|
if (!(this instanceof LRUCache)) {
|
|
10362
|
-
return new LRUCache(
|
|
10362
|
+
return new LRUCache(options8);
|
|
10363
10363
|
}
|
|
10364
|
-
if (typeof
|
|
10365
|
-
|
|
10364
|
+
if (typeof options8 === "number") {
|
|
10365
|
+
options8 = { max: options8 };
|
|
10366
10366
|
}
|
|
10367
|
-
if (!
|
|
10368
|
-
|
|
10367
|
+
if (!options8) {
|
|
10368
|
+
options8 = {};
|
|
10369
10369
|
}
|
|
10370
|
-
var max = this[MAX] =
|
|
10370
|
+
var max = this[MAX] = options8.max;
|
|
10371
10371
|
if (!max || !(typeof max === "number") || max <= 0) {
|
|
10372
10372
|
this[MAX] = Infinity;
|
|
10373
10373
|
}
|
|
10374
|
-
var lc =
|
|
10374
|
+
var lc = options8.length || naiveLength;
|
|
10375
10375
|
if (typeof lc !== "function") {
|
|
10376
10376
|
lc = naiveLength;
|
|
10377
10377
|
}
|
|
10378
10378
|
this[LENGTH_CALCULATOR] = lc;
|
|
10379
|
-
this[ALLOW_STALE] =
|
|
10380
|
-
this[MAX_AGE] =
|
|
10381
|
-
this[DISPOSE] =
|
|
10382
|
-
this[NO_DISPOSE_ON_SET] =
|
|
10379
|
+
this[ALLOW_STALE] = options8.stale || false;
|
|
10380
|
+
this[MAX_AGE] = options8.maxAge || 0;
|
|
10381
|
+
this[DISPOSE] = options8.dispose;
|
|
10382
|
+
this[NO_DISPOSE_ON_SET] = options8.noDisposeOnSet || false;
|
|
10383
10383
|
this.reset();
|
|
10384
10384
|
}
|
|
10385
10385
|
Object.defineProperty(LRUCache.prototype, "max", {
|
|
@@ -10799,10 +10799,10 @@ var require_fnmatch = __commonJS({
|
|
|
10799
10799
|
Object.defineProperty(String.prototype, desc);
|
|
10800
10800
|
}
|
|
10801
10801
|
minimatch.filter = filter;
|
|
10802
|
-
function filter(pattern,
|
|
10803
|
-
|
|
10802
|
+
function filter(pattern, options8) {
|
|
10803
|
+
options8 = options8 || {};
|
|
10804
10804
|
return function(p, i, list) {
|
|
10805
|
-
return minimatch(p, pattern,
|
|
10805
|
+
return minimatch(p, pattern, options8);
|
|
10806
10806
|
};
|
|
10807
10807
|
}
|
|
10808
10808
|
function ext(a, b) {
|
|
@@ -10821,11 +10821,11 @@ var require_fnmatch = __commonJS({
|
|
|
10821
10821
|
if (!def || !Object.keys(def).length)
|
|
10822
10822
|
return minimatch;
|
|
10823
10823
|
var orig = minimatch;
|
|
10824
|
-
var m = function minimatch2(p, pattern,
|
|
10825
|
-
return orig.minimatch(p, pattern, ext(def,
|
|
10824
|
+
var m = function minimatch2(p, pattern, options8) {
|
|
10825
|
+
return orig.minimatch(p, pattern, ext(def, options8));
|
|
10826
10826
|
};
|
|
10827
|
-
m.Minimatch = function Minimatch2(pattern,
|
|
10828
|
-
return new orig.Minimatch(pattern, ext(def,
|
|
10827
|
+
m.Minimatch = function Minimatch2(pattern, options8) {
|
|
10828
|
+
return new orig.Minimatch(pattern, ext(def, options8));
|
|
10829
10829
|
};
|
|
10830
10830
|
return m;
|
|
10831
10831
|
};
|
|
@@ -10834,37 +10834,37 @@ var require_fnmatch = __commonJS({
|
|
|
10834
10834
|
return Minimatch;
|
|
10835
10835
|
return minimatch.defaults(def).Minimatch;
|
|
10836
10836
|
};
|
|
10837
|
-
function minimatch(p, pattern,
|
|
10837
|
+
function minimatch(p, pattern, options8) {
|
|
10838
10838
|
if (typeof pattern !== "string") {
|
|
10839
10839
|
throw new TypeError("glob pattern string required");
|
|
10840
10840
|
}
|
|
10841
|
-
if (!
|
|
10842
|
-
|
|
10843
|
-
if (!
|
|
10841
|
+
if (!options8)
|
|
10842
|
+
options8 = {};
|
|
10843
|
+
if (!options8.nocomment && pattern.charAt(0) === "#") {
|
|
10844
10844
|
return false;
|
|
10845
10845
|
}
|
|
10846
10846
|
if (pattern.trim() === "")
|
|
10847
10847
|
return p === "";
|
|
10848
|
-
return new Minimatch(pattern,
|
|
10848
|
+
return new Minimatch(pattern, options8).match(p);
|
|
10849
10849
|
}
|
|
10850
|
-
function Minimatch(pattern,
|
|
10850
|
+
function Minimatch(pattern, options8) {
|
|
10851
10851
|
if (!(this instanceof Minimatch)) {
|
|
10852
|
-
return new Minimatch(pattern,
|
|
10852
|
+
return new Minimatch(pattern, options8, cache);
|
|
10853
10853
|
}
|
|
10854
10854
|
if (typeof pattern !== "string") {
|
|
10855
10855
|
throw new TypeError("glob pattern string required");
|
|
10856
10856
|
}
|
|
10857
|
-
if (!
|
|
10858
|
-
|
|
10857
|
+
if (!options8)
|
|
10858
|
+
options8 = {};
|
|
10859
10859
|
if (platform === "win32") {
|
|
10860
10860
|
pattern = pattern.split("\\").join("/");
|
|
10861
10861
|
}
|
|
10862
|
-
var cacheKey = pattern + "\n" + sigmund(
|
|
10862
|
+
var cacheKey = pattern + "\n" + sigmund(options8);
|
|
10863
10863
|
var cached = minimatch.cache.get(cacheKey);
|
|
10864
10864
|
if (cached)
|
|
10865
10865
|
return cached;
|
|
10866
10866
|
minimatch.cache.set(cacheKey, this);
|
|
10867
|
-
this.options =
|
|
10867
|
+
this.options = options8;
|
|
10868
10868
|
this.set = [];
|
|
10869
10869
|
this.pattern = pattern;
|
|
10870
10870
|
this.regexp = null;
|
|
@@ -10878,8 +10878,8 @@ var require_fnmatch = __commonJS({
|
|
|
10878
10878
|
if (this._made)
|
|
10879
10879
|
return;
|
|
10880
10880
|
var pattern = this.pattern;
|
|
10881
|
-
var
|
|
10882
|
-
if (!
|
|
10881
|
+
var options8 = this.options;
|
|
10882
|
+
if (!options8.nocomment && pattern.charAt(0) === "#") {
|
|
10883
10883
|
this.comment = true;
|
|
10884
10884
|
return;
|
|
10885
10885
|
}
|
|
@@ -10889,29 +10889,29 @@ var require_fnmatch = __commonJS({
|
|
|
10889
10889
|
}
|
|
10890
10890
|
this.parseNegate();
|
|
10891
10891
|
var set = this.globSet = this.braceExpand();
|
|
10892
|
-
if (
|
|
10892
|
+
if (options8.debug)
|
|
10893
10893
|
console.error(this.pattern, set);
|
|
10894
10894
|
set = this.globParts = set.map(function(s) {
|
|
10895
10895
|
return s.split(slashSplit);
|
|
10896
10896
|
});
|
|
10897
|
-
if (
|
|
10897
|
+
if (options8.debug)
|
|
10898
10898
|
console.error(this.pattern, set);
|
|
10899
10899
|
set = set.map(function(s, si, set2) {
|
|
10900
10900
|
return s.map(this.parse, this);
|
|
10901
10901
|
}, this);
|
|
10902
|
-
if (
|
|
10902
|
+
if (options8.debug)
|
|
10903
10903
|
console.error(this.pattern, set);
|
|
10904
10904
|
set = set.filter(function(s) {
|
|
10905
10905
|
return -1 === s.indexOf(false);
|
|
10906
10906
|
});
|
|
10907
|
-
if (
|
|
10907
|
+
if (options8.debug)
|
|
10908
10908
|
console.error(this.pattern, set);
|
|
10909
10909
|
this.set = set;
|
|
10910
10910
|
}
|
|
10911
10911
|
Minimatch.prototype.parseNegate = parseNegate;
|
|
10912
10912
|
function parseNegate() {
|
|
10913
|
-
var pattern = this.pattern, negate = false,
|
|
10914
|
-
if (
|
|
10913
|
+
var pattern = this.pattern, negate = false, options8 = this.options, negateOffset = 0;
|
|
10914
|
+
if (options8.nonegate)
|
|
10915
10915
|
return;
|
|
10916
10916
|
for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
|
|
10917
10917
|
negate = !negate;
|
|
@@ -10921,17 +10921,17 @@ var require_fnmatch = __commonJS({
|
|
|
10921
10921
|
this.pattern = pattern.substr(negateOffset);
|
|
10922
10922
|
this.negate = negate;
|
|
10923
10923
|
}
|
|
10924
|
-
minimatch.braceExpand = function(pattern,
|
|
10925
|
-
return new Minimatch(pattern,
|
|
10924
|
+
minimatch.braceExpand = function(pattern, options8) {
|
|
10925
|
+
return new Minimatch(pattern, options8).braceExpand();
|
|
10926
10926
|
};
|
|
10927
10927
|
Minimatch.prototype.braceExpand = braceExpand;
|
|
10928
|
-
function braceExpand(pattern,
|
|
10929
|
-
|
|
10928
|
+
function braceExpand(pattern, options8) {
|
|
10929
|
+
options8 = options8 || this.options;
|
|
10930
10930
|
pattern = typeof pattern === "undefined" ? this.pattern : pattern;
|
|
10931
10931
|
if (typeof pattern === "undefined") {
|
|
10932
10932
|
throw new Error("undefined pattern");
|
|
10933
10933
|
}
|
|
10934
|
-
if (
|
|
10934
|
+
if (options8.nobrace || !pattern.match(/\{.*\}/)) {
|
|
10935
10935
|
return [pattern];
|
|
10936
10936
|
}
|
|
10937
10937
|
var escaping = false;
|
|
@@ -10949,14 +10949,14 @@ var require_fnmatch = __commonJS({
|
|
|
10949
10949
|
if (prefix === null) {
|
|
10950
10950
|
return [pattern];
|
|
10951
10951
|
}
|
|
10952
|
-
var tail = braceExpand(pattern.substr(i),
|
|
10952
|
+
var tail = braceExpand(pattern.substr(i), options8);
|
|
10953
10953
|
return tail.map(function(t) {
|
|
10954
10954
|
return prefix + t;
|
|
10955
10955
|
});
|
|
10956
10956
|
}
|
|
10957
10957
|
var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);
|
|
10958
10958
|
if (numset) {
|
|
10959
|
-
var suf = braceExpand(pattern.substr(numset[0].length),
|
|
10959
|
+
var suf = braceExpand(pattern.substr(numset[0].length), options8), start = +numset[1], end = +numset[2], inc = start > end ? -1 : 1, set = [];
|
|
10960
10960
|
for (var i = start; i != end + inc; i += inc) {
|
|
10961
10961
|
for (var ii = 0, ll = suf.length; ii < ll; ii++) {
|
|
10962
10962
|
set.push(i + suf[ii]);
|
|
@@ -11008,12 +11008,12 @@ var require_fnmatch = __commonJS({
|
|
|
11008
11008
|
}
|
|
11009
11009
|
}
|
|
11010
11010
|
if (depth !== 0) {
|
|
11011
|
-
return braceExpand("\\" + pattern,
|
|
11011
|
+
return braceExpand("\\" + pattern, options8);
|
|
11012
11012
|
}
|
|
11013
|
-
var suf = braceExpand(pattern.substr(i),
|
|
11013
|
+
var suf = braceExpand(pattern.substr(i), options8);
|
|
11014
11014
|
var addBraces = set.length === 1;
|
|
11015
11015
|
set = set.map(function(p) {
|
|
11016
|
-
return braceExpand(p,
|
|
11016
|
+
return braceExpand(p, options8);
|
|
11017
11017
|
});
|
|
11018
11018
|
set = set.reduce(function(l2, r) {
|
|
11019
11019
|
return l2.concat(r);
|
|
@@ -11034,12 +11034,12 @@ var require_fnmatch = __commonJS({
|
|
|
11034
11034
|
Minimatch.prototype.parse = parse3;
|
|
11035
11035
|
var SUBPARSE = {};
|
|
11036
11036
|
function parse3(pattern, isSub) {
|
|
11037
|
-
var
|
|
11038
|
-
if (!
|
|
11037
|
+
var options8 = this.options;
|
|
11038
|
+
if (!options8.noglobstar && pattern === "**")
|
|
11039
11039
|
return GLOBSTAR;
|
|
11040
11040
|
if (pattern === "")
|
|
11041
11041
|
return "";
|
|
11042
|
-
var re = "", hasMagic = !!
|
|
11042
|
+
var re = "", hasMagic = !!options8.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options8.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
11043
11043
|
function clearStateChar() {
|
|
11044
11044
|
if (stateChar) {
|
|
11045
11045
|
switch (stateChar) {
|
|
@@ -11059,7 +11059,7 @@ var require_fnmatch = __commonJS({
|
|
|
11059
11059
|
}
|
|
11060
11060
|
}
|
|
11061
11061
|
for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
|
|
11062
|
-
if (
|
|
11062
|
+
if (options8.debug) {
|
|
11063
11063
|
console.error("%s %s %s %j", pattern, i, re, c);
|
|
11064
11064
|
}
|
|
11065
11065
|
if (escaping && reSpecials[c]) {
|
|
@@ -11080,7 +11080,7 @@ var require_fnmatch = __commonJS({
|
|
|
11080
11080
|
case "+":
|
|
11081
11081
|
case "@":
|
|
11082
11082
|
case "!":
|
|
11083
|
-
if (
|
|
11083
|
+
if (options8.debug) {
|
|
11084
11084
|
console.error("%s %s %s %j <-- stateChar", pattern, i, re, c);
|
|
11085
11085
|
}
|
|
11086
11086
|
if (inClass) {
|
|
@@ -11091,7 +11091,7 @@ var require_fnmatch = __commonJS({
|
|
|
11091
11091
|
}
|
|
11092
11092
|
clearStateChar();
|
|
11093
11093
|
stateChar = c;
|
|
11094
|
-
if (
|
|
11094
|
+
if (options8.noext)
|
|
11095
11095
|
clearStateChar();
|
|
11096
11096
|
continue;
|
|
11097
11097
|
case "(":
|
|
@@ -11210,13 +11210,13 @@ var require_fnmatch = __commonJS({
|
|
|
11210
11210
|
if (!hasMagic) {
|
|
11211
11211
|
return globUnescape(pattern);
|
|
11212
11212
|
}
|
|
11213
|
-
var flags =
|
|
11213
|
+
var flags = options8.nocase ? "i" : "", regExp = new RegExp("^" + re + "$", flags);
|
|
11214
11214
|
regExp._glob = pattern;
|
|
11215
11215
|
regExp._src = re;
|
|
11216
11216
|
return regExp;
|
|
11217
11217
|
}
|
|
11218
|
-
minimatch.makeRe = function(pattern,
|
|
11219
|
-
return new Minimatch(pattern,
|
|
11218
|
+
minimatch.makeRe = function(pattern, options8) {
|
|
11219
|
+
return new Minimatch(pattern, options8 || {}).makeRe();
|
|
11220
11220
|
};
|
|
11221
11221
|
Minimatch.prototype.makeRe = makeRe;
|
|
11222
11222
|
function makeRe() {
|
|
@@ -11225,8 +11225,8 @@ var require_fnmatch = __commonJS({
|
|
|
11225
11225
|
var set = this.set;
|
|
11226
11226
|
if (!set.length)
|
|
11227
11227
|
return this.regexp = false;
|
|
11228
|
-
var
|
|
11229
|
-
var twoStar =
|
|
11228
|
+
var options8 = this.options;
|
|
11229
|
+
var twoStar = options8.noglobstar ? star : options8.dot ? twoStarDot : twoStarNoDot, flags = options8.nocase ? "i" : "";
|
|
11230
11230
|
var re = set.map(function(pattern) {
|
|
11231
11231
|
return pattern.map(function(p) {
|
|
11232
11232
|
return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
|
|
@@ -11241,12 +11241,12 @@ var require_fnmatch = __commonJS({
|
|
|
11241
11241
|
return this.regexp = false;
|
|
11242
11242
|
}
|
|
11243
11243
|
}
|
|
11244
|
-
minimatch.match = function(list, pattern,
|
|
11245
|
-
var mm = new Minimatch(pattern,
|
|
11244
|
+
minimatch.match = function(list, pattern, options8) {
|
|
11245
|
+
var mm = new Minimatch(pattern, options8);
|
|
11246
11246
|
list = list.filter(function(f) {
|
|
11247
11247
|
return mm.match(f);
|
|
11248
11248
|
});
|
|
11249
|
-
if (
|
|
11249
|
+
if (options8.nonull && !list.length) {
|
|
11250
11250
|
list.push(pattern);
|
|
11251
11251
|
}
|
|
11252
11252
|
return list;
|
|
@@ -11259,12 +11259,12 @@ var require_fnmatch = __commonJS({
|
|
|
11259
11259
|
return f === "";
|
|
11260
11260
|
if (f === "/" && partial)
|
|
11261
11261
|
return true;
|
|
11262
|
-
var
|
|
11262
|
+
var options8 = this.options;
|
|
11263
11263
|
if (platform === "win32") {
|
|
11264
11264
|
f = f.split("\\").join("/");
|
|
11265
11265
|
}
|
|
11266
11266
|
f = f.split(slashSplit);
|
|
11267
|
-
if (
|
|
11267
|
+
if (options8.debug) {
|
|
11268
11268
|
console.error(this.pattern, "split", f);
|
|
11269
11269
|
}
|
|
11270
11270
|
var set = this.set;
|
|
@@ -11272,18 +11272,18 @@ var require_fnmatch = __commonJS({
|
|
|
11272
11272
|
var pattern = set[i];
|
|
11273
11273
|
var hit = this.matchOne(f, pattern, partial);
|
|
11274
11274
|
if (hit) {
|
|
11275
|
-
if (
|
|
11275
|
+
if (options8.flipNegate)
|
|
11276
11276
|
return true;
|
|
11277
11277
|
return !this.negate;
|
|
11278
11278
|
}
|
|
11279
11279
|
}
|
|
11280
|
-
if (
|
|
11280
|
+
if (options8.flipNegate)
|
|
11281
11281
|
return false;
|
|
11282
11282
|
return this.negate;
|
|
11283
11283
|
}
|
|
11284
11284
|
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
|
11285
|
-
var
|
|
11286
|
-
if (
|
|
11285
|
+
var options8 = this.options;
|
|
11286
|
+
if (options8.debug) {
|
|
11287
11287
|
console.error(
|
|
11288
11288
|
"matchOne",
|
|
11289
11289
|
{
|
|
@@ -11293,31 +11293,31 @@ var require_fnmatch = __commonJS({
|
|
|
11293
11293
|
}
|
|
11294
11294
|
);
|
|
11295
11295
|
}
|
|
11296
|
-
if (
|
|
11296
|
+
if (options8.matchBase && pattern.length === 1) {
|
|
11297
11297
|
file = path11.basename(file.join("/")).split("/");
|
|
11298
11298
|
}
|
|
11299
|
-
if (
|
|
11299
|
+
if (options8.debug) {
|
|
11300
11300
|
console.error("matchOne", file.length, pattern.length);
|
|
11301
11301
|
}
|
|
11302
11302
|
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
11303
|
-
if (
|
|
11303
|
+
if (options8.debug) {
|
|
11304
11304
|
console.error("matchOne loop");
|
|
11305
11305
|
}
|
|
11306
11306
|
var p = pattern[pi], f = file[fi];
|
|
11307
|
-
if (
|
|
11307
|
+
if (options8.debug) {
|
|
11308
11308
|
console.error(pattern, p, f);
|
|
11309
11309
|
}
|
|
11310
11310
|
if (p === false)
|
|
11311
11311
|
return false;
|
|
11312
11312
|
if (p === GLOBSTAR) {
|
|
11313
|
-
if (
|
|
11313
|
+
if (options8.debug)
|
|
11314
11314
|
console.error("GLOBSTAR", [pattern, p, f]);
|
|
11315
11315
|
var fr = fi, pr = pi + 1;
|
|
11316
11316
|
if (pr === pl) {
|
|
11317
|
-
if (
|
|
11317
|
+
if (options8.debug)
|
|
11318
11318
|
console.error("** at the end");
|
|
11319
11319
|
for (; fi < fl; fi++) {
|
|
11320
|
-
if (file[fi] === "." || file[fi] === ".." || !
|
|
11320
|
+
if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".")
|
|
11321
11321
|
return false;
|
|
11322
11322
|
}
|
|
11323
11323
|
return true;
|
|
@@ -11325,7 +11325,7 @@ var require_fnmatch = __commonJS({
|
|
|
11325
11325
|
WHILE:
|
|
11326
11326
|
while (fr < fl) {
|
|
11327
11327
|
var swallowee = file[fr];
|
|
11328
|
-
if (
|
|
11328
|
+
if (options8.debug) {
|
|
11329
11329
|
console.error(
|
|
11330
11330
|
"\nglobstar while",
|
|
11331
11331
|
file,
|
|
@@ -11336,16 +11336,16 @@ var require_fnmatch = __commonJS({
|
|
|
11336
11336
|
);
|
|
11337
11337
|
}
|
|
11338
11338
|
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
11339
|
-
if (
|
|
11339
|
+
if (options8.debug)
|
|
11340
11340
|
console.error("globstar found match!", fr, fl, swallowee);
|
|
11341
11341
|
return true;
|
|
11342
11342
|
} else {
|
|
11343
|
-
if (swallowee === "." || swallowee === ".." || !
|
|
11344
|
-
if (
|
|
11343
|
+
if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") {
|
|
11344
|
+
if (options8.debug)
|
|
11345
11345
|
console.error("dot detected!", file, fr, pattern, pr);
|
|
11346
11346
|
break WHILE;
|
|
11347
11347
|
}
|
|
11348
|
-
if (
|
|
11348
|
+
if (options8.debug)
|
|
11349
11349
|
console.error("globstar swallow a segment, and continue");
|
|
11350
11350
|
fr++;
|
|
11351
11351
|
}
|
|
@@ -11358,17 +11358,17 @@ var require_fnmatch = __commonJS({
|
|
|
11358
11358
|
}
|
|
11359
11359
|
var hit;
|
|
11360
11360
|
if (typeof p === "string") {
|
|
11361
|
-
if (
|
|
11361
|
+
if (options8.nocase) {
|
|
11362
11362
|
hit = f.toLowerCase() === p.toLowerCase();
|
|
11363
11363
|
} else {
|
|
11364
11364
|
hit = f === p;
|
|
11365
11365
|
}
|
|
11366
|
-
if (
|
|
11366
|
+
if (options8.debug) {
|
|
11367
11367
|
console.error("string match", p, f, hit);
|
|
11368
11368
|
}
|
|
11369
11369
|
} else {
|
|
11370
11370
|
hit = f.match(p);
|
|
11371
|
-
if (
|
|
11371
|
+
if (options8.debug) {
|
|
11372
11372
|
console.error("pattern match", p, f, hit);
|
|
11373
11373
|
}
|
|
11374
11374
|
}
|
|
@@ -11770,12 +11770,12 @@ var require_src = __commonJS({
|
|
|
11770
11770
|
glob = glob.replace(/\*\*/g, "{*,**/**/**}");
|
|
11771
11771
|
return fnmatch_1.default(filepath, glob, matchOptions);
|
|
11772
11772
|
}
|
|
11773
|
-
function getConfigFileNames(filepath,
|
|
11773
|
+
function getConfigFileNames(filepath, options8) {
|
|
11774
11774
|
var paths = [];
|
|
11775
11775
|
do {
|
|
11776
11776
|
filepath = path11.dirname(filepath);
|
|
11777
|
-
paths.push(path11.join(filepath,
|
|
11778
|
-
} while (filepath !==
|
|
11777
|
+
paths.push(path11.join(filepath, options8.config));
|
|
11778
|
+
} while (filepath !== options8.root);
|
|
11779
11779
|
return paths;
|
|
11780
11780
|
}
|
|
11781
11781
|
function processMatches(matches, version) {
|
|
@@ -11790,14 +11790,14 @@ var require_src = __commonJS({
|
|
|
11790
11790
|
}
|
|
11791
11791
|
return matches;
|
|
11792
11792
|
}
|
|
11793
|
-
function processOptions(
|
|
11794
|
-
if (
|
|
11795
|
-
|
|
11793
|
+
function processOptions(options8, filepath) {
|
|
11794
|
+
if (options8 === void 0) {
|
|
11795
|
+
options8 = {};
|
|
11796
11796
|
}
|
|
11797
11797
|
return {
|
|
11798
|
-
config:
|
|
11799
|
-
version:
|
|
11800
|
-
root: path11.resolve(
|
|
11798
|
+
config: options8.config || ".editorconfig",
|
|
11799
|
+
version: options8.version || package_json_1.default.version,
|
|
11800
|
+
root: path11.resolve(options8.root || path11.parse(filepath).root)
|
|
11801
11801
|
};
|
|
11802
11802
|
}
|
|
11803
11803
|
function buildFullGlob(pathPrefix, glob) {
|
|
@@ -11813,16 +11813,16 @@ var require_src = __commonJS({
|
|
|
11813
11813
|
}
|
|
11814
11814
|
return path11.join(pathPrefix, glob);
|
|
11815
11815
|
}
|
|
11816
|
-
function extendProps(props,
|
|
11816
|
+
function extendProps(props, options8) {
|
|
11817
11817
|
if (props === void 0) {
|
|
11818
11818
|
props = {};
|
|
11819
11819
|
}
|
|
11820
|
-
if (
|
|
11821
|
-
|
|
11820
|
+
if (options8 === void 0) {
|
|
11821
|
+
options8 = {};
|
|
11822
11822
|
}
|
|
11823
|
-
for (var key in
|
|
11824
|
-
if (
|
|
11825
|
-
var value =
|
|
11823
|
+
for (var key in options8) {
|
|
11824
|
+
if (options8.hasOwnProperty(key)) {
|
|
11825
|
+
var value = options8[key];
|
|
11826
11826
|
var key2 = key.toLowerCase();
|
|
11827
11827
|
var value2 = value;
|
|
11828
11828
|
if (knownProps[key2]) {
|
|
@@ -11840,12 +11840,12 @@ var require_src = __commonJS({
|
|
|
11840
11840
|
}
|
|
11841
11841
|
return props;
|
|
11842
11842
|
}
|
|
11843
|
-
function parseFromConfigs(configs, filepath,
|
|
11843
|
+
function parseFromConfigs(configs, filepath, options8) {
|
|
11844
11844
|
return processMatches(configs.reverse().reduce(function(matches, file) {
|
|
11845
11845
|
var pathPrefix = path11.dirname(file.name);
|
|
11846
11846
|
file.contents.forEach(function(section) {
|
|
11847
11847
|
var glob = section[0];
|
|
11848
|
-
var
|
|
11848
|
+
var options22 = section[1];
|
|
11849
11849
|
if (!glob) {
|
|
11850
11850
|
return;
|
|
11851
11851
|
}
|
|
@@ -11853,10 +11853,10 @@ var require_src = __commonJS({
|
|
|
11853
11853
|
if (!fnmatch(filepath, fullGlob)) {
|
|
11854
11854
|
return;
|
|
11855
11855
|
}
|
|
11856
|
-
matches = extendProps(matches,
|
|
11856
|
+
matches = extendProps(matches, options22);
|
|
11857
11857
|
});
|
|
11858
11858
|
return matches;
|
|
11859
|
-
}, {}),
|
|
11859
|
+
}, {}), options8.version);
|
|
11860
11860
|
}
|
|
11861
11861
|
function getConfigsForFiles(files) {
|
|
11862
11862
|
var configs = [];
|
|
@@ -11907,24 +11907,24 @@ var require_src = __commonJS({
|
|
|
11907
11907
|
});
|
|
11908
11908
|
return files;
|
|
11909
11909
|
}
|
|
11910
|
-
function opts(filepath,
|
|
11911
|
-
if (
|
|
11912
|
-
|
|
11910
|
+
function opts(filepath, options8) {
|
|
11911
|
+
if (options8 === void 0) {
|
|
11912
|
+
options8 = {};
|
|
11913
11913
|
}
|
|
11914
11914
|
var resolvedFilePath = path11.resolve(filepath);
|
|
11915
11915
|
return [
|
|
11916
11916
|
resolvedFilePath,
|
|
11917
|
-
processOptions(
|
|
11917
|
+
processOptions(options8, resolvedFilePath)
|
|
11918
11918
|
];
|
|
11919
11919
|
}
|
|
11920
|
-
function parseFromFiles(filepath, files,
|
|
11921
|
-
if (
|
|
11922
|
-
|
|
11920
|
+
function parseFromFiles(filepath, files, options8) {
|
|
11921
|
+
if (options8 === void 0) {
|
|
11922
|
+
options8 = {};
|
|
11923
11923
|
}
|
|
11924
11924
|
return __awaiter2(this, void 0, void 0, function() {
|
|
11925
11925
|
var _a, resolvedFilePath, processedOptions;
|
|
11926
11926
|
return __generator2(this, function(_b) {
|
|
11927
|
-
_a = opts(filepath,
|
|
11927
|
+
_a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1];
|
|
11928
11928
|
return [2, files.then(getConfigsForFiles).then(function(configs) {
|
|
11929
11929
|
return parseFromConfigs(configs, resolvedFilePath, processedOptions);
|
|
11930
11930
|
})];
|
|
@@ -11932,11 +11932,11 @@ var require_src = __commonJS({
|
|
|
11932
11932
|
});
|
|
11933
11933
|
}
|
|
11934
11934
|
exports.parseFromFiles = parseFromFiles;
|
|
11935
|
-
function parseFromFilesSync(filepath, files,
|
|
11936
|
-
if (
|
|
11937
|
-
|
|
11935
|
+
function parseFromFilesSync(filepath, files, options8) {
|
|
11936
|
+
if (options8 === void 0) {
|
|
11937
|
+
options8 = {};
|
|
11938
11938
|
}
|
|
11939
|
-
var _a = opts(filepath,
|
|
11939
|
+
var _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1];
|
|
11940
11940
|
return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
|
|
11941
11941
|
}
|
|
11942
11942
|
exports.parseFromFilesSync = parseFromFilesSync;
|
|
@@ -14908,7 +14908,7 @@ var require_ignore = __commonJS({
|
|
|
14908
14908
|
return this._test(path11, this._testCache, true);
|
|
14909
14909
|
}
|
|
14910
14910
|
};
|
|
14911
|
-
var factory = (
|
|
14911
|
+
var factory = (options8) => new Ignore(options8);
|
|
14912
14912
|
var isPathValid = (path11) => checkPath(path11 && checkPath.convert(path11), path11, RETURN_FALSE);
|
|
14913
14913
|
factory.isPathValid = isPathValid;
|
|
14914
14914
|
factory.default = factory;
|
|
@@ -15568,19 +15568,19 @@ function rootIndent() {
|
|
|
15568
15568
|
queue: []
|
|
15569
15569
|
};
|
|
15570
15570
|
}
|
|
15571
|
-
function makeIndent(ind,
|
|
15571
|
+
function makeIndent(ind, options8) {
|
|
15572
15572
|
return generateInd(ind, {
|
|
15573
15573
|
type: "indent"
|
|
15574
|
-
},
|
|
15574
|
+
}, options8);
|
|
15575
15575
|
}
|
|
15576
|
-
function makeAlign(indent2, widthOrDoc,
|
|
15576
|
+
function makeAlign(indent2, widthOrDoc, options8) {
|
|
15577
15577
|
if (widthOrDoc === Number.NEGATIVE_INFINITY) {
|
|
15578
15578
|
return indent2.root || rootIndent();
|
|
15579
15579
|
}
|
|
15580
15580
|
if (widthOrDoc < 0) {
|
|
15581
15581
|
return generateInd(indent2, {
|
|
15582
15582
|
type: "dedent"
|
|
15583
|
-
},
|
|
15583
|
+
}, options8);
|
|
15584
15584
|
}
|
|
15585
15585
|
if (!widthOrDoc) {
|
|
15586
15586
|
return indent2;
|
|
@@ -15595,9 +15595,9 @@ function makeAlign(indent2, widthOrDoc, options) {
|
|
|
15595
15595
|
return generateInd(indent2, {
|
|
15596
15596
|
type: alignType,
|
|
15597
15597
|
n: widthOrDoc
|
|
15598
|
-
},
|
|
15598
|
+
}, options8);
|
|
15599
15599
|
}
|
|
15600
|
-
function generateInd(ind, newPart,
|
|
15600
|
+
function generateInd(ind, newPart, options8) {
|
|
15601
15601
|
const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart];
|
|
15602
15602
|
let value = "";
|
|
15603
15603
|
let length = 0;
|
|
@@ -15607,10 +15607,10 @@ function generateInd(ind, newPart, options) {
|
|
|
15607
15607
|
switch (part.type) {
|
|
15608
15608
|
case "indent":
|
|
15609
15609
|
flush();
|
|
15610
|
-
if (
|
|
15610
|
+
if (options8.useTabs) {
|
|
15611
15611
|
addTabs(1);
|
|
15612
15612
|
} else {
|
|
15613
|
-
addSpaces(
|
|
15613
|
+
addSpaces(options8.tabWidth);
|
|
15614
15614
|
}
|
|
15615
15615
|
break;
|
|
15616
15616
|
case "stringAlign":
|
|
@@ -15635,14 +15635,14 @@ function generateInd(ind, newPart, options) {
|
|
|
15635
15635
|
};
|
|
15636
15636
|
function addTabs(count) {
|
|
15637
15637
|
value += " ".repeat(count);
|
|
15638
|
-
length +=
|
|
15638
|
+
length += options8.tabWidth * count;
|
|
15639
15639
|
}
|
|
15640
15640
|
function addSpaces(count) {
|
|
15641
15641
|
value += " ".repeat(count);
|
|
15642
15642
|
length += count;
|
|
15643
15643
|
}
|
|
15644
15644
|
function flush() {
|
|
15645
|
-
if (
|
|
15645
|
+
if (options8.useTabs) {
|
|
15646
15646
|
flushTabs();
|
|
15647
15647
|
} else {
|
|
15648
15648
|
flushSpaces();
|
|
@@ -15793,10 +15793,10 @@ function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat
|
|
|
15793
15793
|
}
|
|
15794
15794
|
return false;
|
|
15795
15795
|
}
|
|
15796
|
-
function printDocToString(doc2,
|
|
15796
|
+
function printDocToString(doc2, options8) {
|
|
15797
15797
|
const groupModeMap = {};
|
|
15798
|
-
const width =
|
|
15799
|
-
const newLine = convertEndOfLineToChars(
|
|
15798
|
+
const width = options8.printWidth;
|
|
15799
|
+
const newLine = convertEndOfLineToChars(options8.endOfLine);
|
|
15800
15800
|
let pos = 0;
|
|
15801
15801
|
const cmds = [{
|
|
15802
15802
|
ind: rootIndent(),
|
|
@@ -15847,14 +15847,14 @@ function printDocToString(doc2, options) {
|
|
|
15847
15847
|
break;
|
|
15848
15848
|
case DOC_TYPE_INDENT:
|
|
15849
15849
|
cmds.push({
|
|
15850
|
-
ind: makeIndent(ind,
|
|
15850
|
+
ind: makeIndent(ind, options8),
|
|
15851
15851
|
mode,
|
|
15852
15852
|
doc: doc3.contents
|
|
15853
15853
|
});
|
|
15854
15854
|
break;
|
|
15855
15855
|
case DOC_TYPE_ALIGN:
|
|
15856
15856
|
cmds.push({
|
|
15857
|
-
ind: makeAlign(ind, doc3.n,
|
|
15857
|
+
ind: makeAlign(ind, doc3.n, options8),
|
|
15858
15858
|
mode,
|
|
15859
15859
|
doc: doc3.contents
|
|
15860
15860
|
});
|
|
@@ -16215,8 +16215,8 @@ function printDocToDebug(doc2) {
|
|
|
16215
16215
|
if (doc3.groupId) {
|
|
16216
16216
|
optionsParts.push(`groupId: ${printGroupId(doc3.groupId)}`);
|
|
16217
16217
|
}
|
|
16218
|
-
const
|
|
16219
|
-
return `indentIfBreak(${printDoc(doc3.contents)}${
|
|
16218
|
+
const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
|
|
16219
|
+
return `indentIfBreak(${printDoc(doc3.contents)}${options8})`;
|
|
16220
16220
|
}
|
|
16221
16221
|
if (doc3.type === DOC_TYPE_GROUP) {
|
|
16222
16222
|
const optionsParts = [];
|
|
@@ -16226,11 +16226,11 @@ function printDocToDebug(doc2) {
|
|
|
16226
16226
|
if (doc3.id) {
|
|
16227
16227
|
optionsParts.push(`id: ${printGroupId(doc3.id)}`);
|
|
16228
16228
|
}
|
|
16229
|
-
const
|
|
16229
|
+
const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
|
|
16230
16230
|
if (doc3.expandedStates) {
|
|
16231
|
-
return `conditionalGroup([${doc3.expandedStates.map((part) => printDoc(part)).join(",")}]${
|
|
16231
|
+
return `conditionalGroup([${doc3.expandedStates.map((part) => printDoc(part)).join(",")}]${options8})`;
|
|
16232
16232
|
}
|
|
16233
|
-
return `group(${printDoc(doc3.contents)}${
|
|
16233
|
+
return `group(${printDoc(doc3.contents)}${options8})`;
|
|
16234
16234
|
}
|
|
16235
16235
|
if (doc3.type === DOC_TYPE_FILL) {
|
|
16236
16236
|
return `fill([${doc3.parts.map((part) => printDoc(part)).join(", ")}])`;
|
|
@@ -16556,11 +16556,11 @@ function getSupportInfo({
|
|
|
16556
16556
|
plugins = [],
|
|
16557
16557
|
showDeprecated = false
|
|
16558
16558
|
} = {}) {
|
|
16559
|
-
const
|
|
16560
|
-
const
|
|
16559
|
+
const languages2 = plugins.flatMap((plugin) => plugin.languages ?? []);
|
|
16560
|
+
const options8 = [];
|
|
16561
16561
|
for (const option of normalizeOptionSettings(Object.assign({}, ...plugins.map(({
|
|
16562
|
-
options:
|
|
16563
|
-
}) =>
|
|
16562
|
+
options: options9
|
|
16563
|
+
}) => options9), core_options_evaluate_default))) {
|
|
16564
16564
|
if (!showDeprecated && option.deprecated) {
|
|
16565
16565
|
continue;
|
|
16566
16566
|
}
|
|
@@ -16569,23 +16569,23 @@ function getSupportInfo({
|
|
|
16569
16569
|
option.choices = option.choices.filter((choice) => !choice.deprecated);
|
|
16570
16570
|
}
|
|
16571
16571
|
if (option.name === "parser") {
|
|
16572
|
-
option.choices = [...option.choices, ...collectParsersFromLanguages(option.choices,
|
|
16572
|
+
option.choices = [...option.choices, ...collectParsersFromLanguages(option.choices, languages2, plugins)];
|
|
16573
16573
|
}
|
|
16574
16574
|
}
|
|
16575
16575
|
option.pluginDefaults = Object.fromEntries(plugins.filter((plugin) => {
|
|
16576
16576
|
var _a;
|
|
16577
16577
|
return ((_a = plugin.defaultOptions) == null ? void 0 : _a[option.name]) !== void 0;
|
|
16578
16578
|
}).map((plugin) => [plugin.name, plugin.defaultOptions[option.name]]));
|
|
16579
|
-
|
|
16579
|
+
options8.push(option);
|
|
16580
16580
|
}
|
|
16581
16581
|
return {
|
|
16582
|
-
languages,
|
|
16583
|
-
options
|
|
16582
|
+
languages: languages2,
|
|
16583
|
+
options: options8
|
|
16584
16584
|
};
|
|
16585
16585
|
}
|
|
16586
|
-
function* collectParsersFromLanguages(parserChoices,
|
|
16586
|
+
function* collectParsersFromLanguages(parserChoices, languages2, plugins) {
|
|
16587
16587
|
const existingParsers = new Set(parserChoices.map((choice) => choice.value));
|
|
16588
|
-
for (const language of
|
|
16588
|
+
for (const language of languages2) {
|
|
16589
16589
|
if (language.parsers) {
|
|
16590
16590
|
for (const parserName of language.parsers) {
|
|
16591
16591
|
if (!existingParsers.has(parserName)) {
|
|
@@ -16605,7 +16605,7 @@ function* collectParsersFromLanguages(parserChoices, languages, plugins) {
|
|
|
16605
16605
|
}
|
|
16606
16606
|
}
|
|
16607
16607
|
function normalizeOptionSettings(settings) {
|
|
16608
|
-
const
|
|
16608
|
+
const options8 = [];
|
|
16609
16609
|
for (const [name, originalOption] of Object.entries(settings)) {
|
|
16610
16610
|
const option = {
|
|
16611
16611
|
name,
|
|
@@ -16619,9 +16619,9 @@ function normalizeOptionSettings(settings) {
|
|
|
16619
16619
|
-1
|
|
16620
16620
|
).value;
|
|
16621
16621
|
}
|
|
16622
|
-
|
|
16622
|
+
options8.push(option);
|
|
16623
16623
|
}
|
|
16624
|
-
return
|
|
16624
|
+
return options8;
|
|
16625
16625
|
}
|
|
16626
16626
|
|
|
16627
16627
|
// src/utils/get-interpreter.js
|
|
@@ -16662,25 +16662,25 @@ var get_interpreter_default = getInterpreter;
|
|
|
16662
16662
|
|
|
16663
16663
|
// src/utils/infer-parser.js
|
|
16664
16664
|
var getFileBasename = (file) => file.split(/[/\\]/).pop();
|
|
16665
|
-
function getLanguageByFilename(
|
|
16665
|
+
function getLanguageByFilename(languages2, filename) {
|
|
16666
16666
|
if (!filename) {
|
|
16667
16667
|
return;
|
|
16668
16668
|
}
|
|
16669
16669
|
const basename = getFileBasename(filename).toLowerCase();
|
|
16670
|
-
return
|
|
16670
|
+
return languages2.find(
|
|
16671
16671
|
(language) => {
|
|
16672
16672
|
var _a, _b;
|
|
16673
16673
|
return ((_a = language.extensions) == null ? void 0 : _a.some((extension) => basename.endsWith(extension))) || ((_b = language.filenames) == null ? void 0 : _b.some((name) => name.toLowerCase() === basename));
|
|
16674
16674
|
}
|
|
16675
16675
|
);
|
|
16676
16676
|
}
|
|
16677
|
-
function getLanguageByName(
|
|
16677
|
+
function getLanguageByName(languages2, languageName) {
|
|
16678
16678
|
if (!languageName) {
|
|
16679
16679
|
return;
|
|
16680
16680
|
}
|
|
16681
|
-
return
|
|
16681
|
+
return languages2.find(({ name }) => name.toLowerCase() === languageName) ?? languages2.find(({ aliases }) => aliases == null ? void 0 : aliases.includes(languageName)) ?? languages2.find(({ extensions }) => extensions == null ? void 0 : extensions.includes(`.${languageName}`));
|
|
16682
16682
|
}
|
|
16683
|
-
function getLanguageByInterpreter(
|
|
16683
|
+
function getLanguageByInterpreter(languages2, file) {
|
|
16684
16684
|
if (!file || getFileBasename(file).includes(".")) {
|
|
16685
16685
|
return;
|
|
16686
16686
|
}
|
|
@@ -16688,21 +16688,21 @@ function getLanguageByInterpreter(languages, file) {
|
|
|
16688
16688
|
if (!interpreter) {
|
|
16689
16689
|
return;
|
|
16690
16690
|
}
|
|
16691
|
-
return
|
|
16691
|
+
return languages2.find(
|
|
16692
16692
|
(language) => {
|
|
16693
16693
|
var _a;
|
|
16694
16694
|
return (_a = language.interpreters) == null ? void 0 : _a.includes(interpreter);
|
|
16695
16695
|
}
|
|
16696
16696
|
);
|
|
16697
16697
|
}
|
|
16698
|
-
function inferParser(
|
|
16699
|
-
const
|
|
16698
|
+
function inferParser(options8, fileInfo) {
|
|
16699
|
+
const languages2 = options8.plugins.flatMap(
|
|
16700
16700
|
(plugin) => (
|
|
16701
16701
|
// @ts-expect-error -- Safe
|
|
16702
16702
|
plugin.languages ?? []
|
|
16703
16703
|
)
|
|
16704
16704
|
);
|
|
16705
|
-
const language = getLanguageByName(
|
|
16705
|
+
const language = getLanguageByName(languages2, fileInfo.language) ?? getLanguageByFilename(languages2, fileInfo.physicalFile) ?? getLanguageByFilename(languages2, fileInfo.file) ?? getLanguageByInterpreter(languages2, fileInfo.physicalFile);
|
|
16706
16706
|
return language == null ? void 0 : language.parsers[0];
|
|
16707
16707
|
}
|
|
16708
16708
|
var infer_parser_default = inferParser;
|
|
@@ -16710,7 +16710,7 @@ var infer_parser_default = inferParser;
|
|
|
16710
16710
|
// src/main/normalize-options.js
|
|
16711
16711
|
var import_vnopts = __toESM(require_lib(), 1);
|
|
16712
16712
|
var hasDeprecationWarned;
|
|
16713
|
-
function normalizeOptions(
|
|
16713
|
+
function normalizeOptions(options8, optionInfos, {
|
|
16714
16714
|
logger = false,
|
|
16715
16715
|
isCLI = false,
|
|
16716
16716
|
passThrough = false,
|
|
@@ -16727,13 +16727,13 @@ function normalizeOptions(options, optionInfos, {
|
|
|
16727
16727
|
} else {
|
|
16728
16728
|
descriptor = import_vnopts.default.apiDescriptor;
|
|
16729
16729
|
}
|
|
16730
|
-
const unknown = !passThrough ? (key, value,
|
|
16730
|
+
const unknown = !passThrough ? (key, value, options9) => {
|
|
16731
16731
|
const {
|
|
16732
16732
|
_,
|
|
16733
16733
|
...schemas2
|
|
16734
|
-
} =
|
|
16734
|
+
} = options9.schemas;
|
|
16735
16735
|
return import_vnopts.default.levenUnknownHandler(key, value, {
|
|
16736
|
-
...
|
|
16736
|
+
...options9,
|
|
16737
16737
|
schemas: schemas2
|
|
16738
16738
|
});
|
|
16739
16739
|
} : Array.isArray(passThrough) ? (key, value) => !passThrough.includes(key) ? void 0 : {
|
|
@@ -16754,7 +16754,7 @@ function normalizeOptions(options, optionInfos, {
|
|
|
16754
16754
|
if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
|
|
16755
16755
|
normalizer._hasDeprecationWarned = hasDeprecationWarned;
|
|
16756
16756
|
}
|
|
16757
|
-
const normalized = normalizer.normalize(
|
|
16757
|
+
const normalized = normalizer.normalize(options8);
|
|
16758
16758
|
if (shouldSuppressDuplicateDeprecationWarnings) {
|
|
16759
16759
|
hasDeprecationWarned = normalizer._hasDeprecationWarned;
|
|
16760
16760
|
}
|
|
@@ -16945,6 +16945,10 @@ function initParser(plugin, parserName) {
|
|
|
16945
16945
|
const parserOrParserInitFunction = plugin.parsers[parserName];
|
|
16946
16946
|
return typeof parserOrParserInitFunction === "function" ? parserOrParserInitFunction() : parserOrParserInitFunction;
|
|
16947
16947
|
}
|
|
16948
|
+
function initPrinter(plugin, astFormat) {
|
|
16949
|
+
const printerOrPrinterInitFunction = plugin.printers[astFormat];
|
|
16950
|
+
return typeof printerOrPrinterInitFunction === "function" ? printerOrPrinterInitFunction() : printerOrPrinterInitFunction;
|
|
16951
|
+
}
|
|
16948
16952
|
|
|
16949
16953
|
// src/main/normalize-format-options.js
|
|
16950
16954
|
var formatOptionsHiddenDefaults = {
|
|
@@ -16954,9 +16958,9 @@ var formatOptionsHiddenDefaults = {
|
|
|
16954
16958
|
locStart: null,
|
|
16955
16959
|
locEnd: null
|
|
16956
16960
|
};
|
|
16957
|
-
async function normalizeFormatOptions(
|
|
16961
|
+
async function normalizeFormatOptions(options8, opts = {}) {
|
|
16958
16962
|
var _a;
|
|
16959
|
-
const rawOptions = { ...
|
|
16963
|
+
const rawOptions = { ...options8 };
|
|
16960
16964
|
if (!rawOptions.parser) {
|
|
16961
16965
|
if (!rawOptions.filepath) {
|
|
16962
16966
|
throw new UndefinedParserError(
|
|
@@ -16974,7 +16978,7 @@ async function normalizeFormatOptions(options, opts = {}) {
|
|
|
16974
16978
|
}
|
|
16975
16979
|
}
|
|
16976
16980
|
const supportOptions = getSupportInfo({
|
|
16977
|
-
plugins:
|
|
16981
|
+
plugins: options8.plugins,
|
|
16978
16982
|
showDeprecated: true
|
|
16979
16983
|
}).options;
|
|
16980
16984
|
const defaults = {
|
|
@@ -16992,7 +16996,7 @@ async function normalizeFormatOptions(options, opts = {}) {
|
|
|
16992
16996
|
rawOptions.locEnd = parser.locEnd;
|
|
16993
16997
|
rawOptions.locStart = parser.locStart;
|
|
16994
16998
|
const printerPlugin = ((_a = parserPlugin.printers) == null ? void 0 : _a[parser.astFormat]) ? parserPlugin : getPrinterPluginByAstFormat(rawOptions.plugins, parser.astFormat);
|
|
16995
|
-
const printer = printerPlugin
|
|
16999
|
+
const printer = await initPrinter(printerPlugin, parser.astFormat);
|
|
16996
17000
|
rawOptions.printer = printer;
|
|
16997
17001
|
const pluginDefaults = printerPlugin.defaultOptions ? Object.fromEntries(
|
|
16998
17002
|
Object.entries(printerPlugin.defaultOptions).filter(
|
|
@@ -17031,13 +17035,13 @@ function createGetVisitorKeysFunction(printerGetVisitorKeys) {
|
|
|
17031
17035
|
var create_get_visitor_keys_function_default = createGetVisitorKeysFunction;
|
|
17032
17036
|
|
|
17033
17037
|
// src/main/massage-ast.js
|
|
17034
|
-
function massageAst(ast,
|
|
17038
|
+
function massageAst(ast, options8) {
|
|
17035
17039
|
const {
|
|
17036
17040
|
printer: {
|
|
17037
17041
|
massageAstNode: cleanFunction,
|
|
17038
17042
|
getVisitorKeys: printerGetVisitorKeys
|
|
17039
17043
|
}
|
|
17040
|
-
} =
|
|
17044
|
+
} = options8;
|
|
17041
17045
|
if (!cleanFunction) {
|
|
17042
17046
|
return ast;
|
|
17043
17047
|
}
|
|
@@ -17074,18 +17078,18 @@ var massage_ast_default = massageAst;
|
|
|
17074
17078
|
|
|
17075
17079
|
// src/main/parse.js
|
|
17076
17080
|
var import_code_frame = __toESM(require_lib4(), 1);
|
|
17077
|
-
async function parse(originalText,
|
|
17078
|
-
const parser = await resolveParser(
|
|
17079
|
-
const text = parser.preprocess ? parser.preprocess(originalText,
|
|
17080
|
-
|
|
17081
|
+
async function parse(originalText, options8) {
|
|
17082
|
+
const parser = await resolveParser(options8);
|
|
17083
|
+
const text = parser.preprocess ? parser.preprocess(originalText, options8) : originalText;
|
|
17084
|
+
options8.originalText = text;
|
|
17081
17085
|
let ast;
|
|
17082
17086
|
try {
|
|
17083
17087
|
ast = await parser.parse(
|
|
17084
17088
|
text,
|
|
17085
|
-
|
|
17089
|
+
options8,
|
|
17086
17090
|
// TODO: remove the third argument in v4
|
|
17087
17091
|
// The duplicated argument is passed as intended, see #10156
|
|
17088
|
-
|
|
17092
|
+
options8
|
|
17089
17093
|
);
|
|
17090
17094
|
} catch (error) {
|
|
17091
17095
|
handleParseError(error, originalText);
|
|
@@ -17410,8 +17414,8 @@ import assert from "assert";
|
|
|
17410
17414
|
|
|
17411
17415
|
// src/utils/skip.js
|
|
17412
17416
|
function skip(characters) {
|
|
17413
|
-
return (text, startIndex,
|
|
17414
|
-
const backwards = Boolean(
|
|
17417
|
+
return (text, startIndex, options8) => {
|
|
17418
|
+
const backwards = Boolean(options8 == null ? void 0 : options8.backwards);
|
|
17415
17419
|
if (startIndex === false) {
|
|
17416
17420
|
return false;
|
|
17417
17421
|
}
|
|
@@ -17440,8 +17444,8 @@ var skipToLineEnd = skip(",; ");
|
|
|
17440
17444
|
var skipEverythingButNewLine = skip(/[^\n\r]/);
|
|
17441
17445
|
|
|
17442
17446
|
// src/utils/skip-newline.js
|
|
17443
|
-
function skipNewline(text, startIndex,
|
|
17444
|
-
const backwards = Boolean(
|
|
17447
|
+
function skipNewline(text, startIndex, options8) {
|
|
17448
|
+
const backwards = Boolean(options8 == null ? void 0 : options8.backwards);
|
|
17445
17449
|
if (startIndex === false) {
|
|
17446
17450
|
return false;
|
|
17447
17451
|
}
|
|
@@ -17466,13 +17470,13 @@ function skipNewline(text, startIndex, options) {
|
|
|
17466
17470
|
var skip_newline_default = skipNewline;
|
|
17467
17471
|
|
|
17468
17472
|
// src/utils/has-newline.js
|
|
17469
|
-
function hasNewline(text, startIndex,
|
|
17473
|
+
function hasNewline(text, startIndex, options8 = {}) {
|
|
17470
17474
|
const idx = skipSpaces(
|
|
17471
17475
|
text,
|
|
17472
|
-
|
|
17473
|
-
|
|
17476
|
+
options8.backwards ? startIndex - 1 : startIndex,
|
|
17477
|
+
options8
|
|
17474
17478
|
);
|
|
17475
|
-
const idx2 = skip_newline_default(text, idx,
|
|
17479
|
+
const idx2 = skip_newline_default(text, idx, options8);
|
|
17476
17480
|
return idx !== idx2;
|
|
17477
17481
|
}
|
|
17478
17482
|
var has_newline_default = hasNewline;
|
|
@@ -17490,8 +17494,8 @@ function isObject(object) {
|
|
|
17490
17494
|
var is_object_default = isObject;
|
|
17491
17495
|
|
|
17492
17496
|
// src/utils/ast-utils.js
|
|
17493
|
-
function* getChildren(node,
|
|
17494
|
-
const { getVisitorKeys, filter = () => true } =
|
|
17497
|
+
function* getChildren(node, options8) {
|
|
17498
|
+
const { getVisitorKeys, filter = () => true } = options8;
|
|
17495
17499
|
const isMatchedNode = (node2) => is_object_default(node2) && filter(node2);
|
|
17496
17500
|
for (const key of getVisitorKeys(node)) {
|
|
17497
17501
|
const value = node[key];
|
|
@@ -17506,11 +17510,11 @@ function* getChildren(node, options) {
|
|
|
17506
17510
|
}
|
|
17507
17511
|
}
|
|
17508
17512
|
}
|
|
17509
|
-
function* getDescendants(node,
|
|
17513
|
+
function* getDescendants(node, options8) {
|
|
17510
17514
|
const queue = [node];
|
|
17511
17515
|
for (let index = 0; index < queue.length; index++) {
|
|
17512
17516
|
const node2 = queue[index];
|
|
17513
|
-
for (const child of getChildren(node2,
|
|
17517
|
+
for (const child of getChildren(node2, options8)) {
|
|
17514
17518
|
yield child;
|
|
17515
17519
|
queue.push(child);
|
|
17516
17520
|
}
|
|
@@ -17555,7 +17559,7 @@ function addTrailingComment(node, comment) {
|
|
|
17555
17559
|
|
|
17556
17560
|
// src/main/comments/attach.js
|
|
17557
17561
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
17558
|
-
function getSortedChildNodes(node,
|
|
17562
|
+
function getSortedChildNodes(node, options8) {
|
|
17559
17563
|
if (childNodesCache.has(node)) {
|
|
17560
17564
|
return childNodesCache.get(node);
|
|
17561
17565
|
}
|
|
@@ -17567,16 +17571,16 @@ function getSortedChildNodes(node, options) {
|
|
|
17567
17571
|
},
|
|
17568
17572
|
locStart,
|
|
17569
17573
|
locEnd
|
|
17570
|
-
} =
|
|
17574
|
+
} = options8;
|
|
17571
17575
|
if (!canAttachComment) {
|
|
17572
17576
|
return [];
|
|
17573
17577
|
}
|
|
17574
|
-
const childNodes = ((getCommentChildNodes == null ? void 0 : getCommentChildNodes(node,
|
|
17578
|
+
const childNodes = ((getCommentChildNodes == null ? void 0 : getCommentChildNodes(node, options8)) ?? [
|
|
17575
17579
|
...getChildren(node, {
|
|
17576
17580
|
getVisitorKeys: create_get_visitor_keys_function_default(printerGetVisitorKeys)
|
|
17577
17581
|
})
|
|
17578
17582
|
]).flatMap(
|
|
17579
|
-
(node2) => canAttachComment(node2) ? [node2] : getSortedChildNodes(node2,
|
|
17583
|
+
(node2) => canAttachComment(node2) ? [node2] : getSortedChildNodes(node2, options8)
|
|
17580
17584
|
);
|
|
17581
17585
|
childNodes.sort(
|
|
17582
17586
|
(nodeA, nodeB) => locStart(nodeA) - locStart(nodeB) || locEnd(nodeA) - locEnd(nodeB)
|
|
@@ -17584,11 +17588,11 @@ function getSortedChildNodes(node, options) {
|
|
|
17584
17588
|
childNodesCache.set(node, childNodes);
|
|
17585
17589
|
return childNodes;
|
|
17586
17590
|
}
|
|
17587
|
-
function decorateComment(node, comment,
|
|
17588
|
-
const { locStart, locEnd } =
|
|
17591
|
+
function decorateComment(node, comment, options8, enclosingNode) {
|
|
17592
|
+
const { locStart, locEnd } = options8;
|
|
17589
17593
|
const commentStart = locStart(comment);
|
|
17590
17594
|
const commentEnd = locEnd(comment);
|
|
17591
|
-
const childNodes = getSortedChildNodes(node,
|
|
17595
|
+
const childNodes = getSortedChildNodes(node, options8);
|
|
17592
17596
|
let precedingNode;
|
|
17593
17597
|
let followingNode;
|
|
17594
17598
|
let left = 0;
|
|
@@ -17599,7 +17603,7 @@ function decorateComment(node, comment, options, enclosingNode) {
|
|
|
17599
17603
|
const start = locStart(child);
|
|
17600
17604
|
const end = locEnd(child);
|
|
17601
17605
|
if (start <= commentStart && commentEnd <= end) {
|
|
17602
|
-
return decorateComment(child, comment,
|
|
17606
|
+
return decorateComment(child, comment, options8, child);
|
|
17603
17607
|
}
|
|
17604
17608
|
if (end <= commentStart) {
|
|
17605
17609
|
precedingNode = child;
|
|
@@ -17618,22 +17622,22 @@ function decorateComment(node, comment, options, enclosingNode) {
|
|
|
17618
17622
|
const commentIndex = findExpressionIndexForComment(
|
|
17619
17623
|
quasis,
|
|
17620
17624
|
comment,
|
|
17621
|
-
|
|
17625
|
+
options8
|
|
17622
17626
|
);
|
|
17623
|
-
if (precedingNode && findExpressionIndexForComment(quasis, precedingNode,
|
|
17627
|
+
if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options8) !== commentIndex) {
|
|
17624
17628
|
precedingNode = null;
|
|
17625
17629
|
}
|
|
17626
|
-
if (followingNode && findExpressionIndexForComment(quasis, followingNode,
|
|
17630
|
+
if (followingNode && findExpressionIndexForComment(quasis, followingNode, options8) !== commentIndex) {
|
|
17627
17631
|
followingNode = null;
|
|
17628
17632
|
}
|
|
17629
17633
|
}
|
|
17630
17634
|
return { enclosingNode, precedingNode, followingNode };
|
|
17631
17635
|
}
|
|
17632
17636
|
var returnFalse = () => false;
|
|
17633
|
-
function attachComments(ast,
|
|
17637
|
+
function attachComments(ast, options8) {
|
|
17634
17638
|
const { comments } = ast;
|
|
17635
17639
|
delete ast.comments;
|
|
17636
|
-
if (!is_non_empty_array_default(comments) || !
|
|
17640
|
+
if (!is_non_empty_array_default(comments) || !options8.printer.canAttachComment) {
|
|
17637
17641
|
return;
|
|
17638
17642
|
}
|
|
17639
17643
|
const tiesToBreak = [];
|
|
@@ -17648,17 +17652,17 @@ function attachComments(ast, options) {
|
|
|
17648
17652
|
handleComments = {}
|
|
17649
17653
|
},
|
|
17650
17654
|
originalText: text
|
|
17651
|
-
} =
|
|
17655
|
+
} = options8;
|
|
17652
17656
|
const {
|
|
17653
17657
|
ownLine: handleOwnLineComment = returnFalse,
|
|
17654
17658
|
endOfLine: handleEndOfLineComment = returnFalse,
|
|
17655
17659
|
remaining: handleRemainingComment = returnFalse
|
|
17656
17660
|
} = handleComments;
|
|
17657
17661
|
const decoratedComments = comments.map((comment, index) => ({
|
|
17658
|
-
...decorateComment(ast, comment,
|
|
17662
|
+
...decorateComment(ast, comment, options8),
|
|
17659
17663
|
comment,
|
|
17660
17664
|
text,
|
|
17661
|
-
options,
|
|
17665
|
+
options: options8,
|
|
17662
17666
|
ast,
|
|
17663
17667
|
isLastComment: comments.length - 1 === index
|
|
17664
17668
|
}));
|
|
@@ -17669,11 +17673,11 @@ function attachComments(ast, options) {
|
|
|
17669
17673
|
enclosingNode,
|
|
17670
17674
|
followingNode,
|
|
17671
17675
|
text: text2,
|
|
17672
|
-
options:
|
|
17676
|
+
options: options9,
|
|
17673
17677
|
ast: ast2,
|
|
17674
17678
|
isLastComment
|
|
17675
17679
|
} = context;
|
|
17676
|
-
if (
|
|
17680
|
+
if (options9.parser === "json" || options9.parser === "json5" || options9.parser === "__js_expression" || options9.parser === "__ts_expression" || options9.parser === "__vue_expression" || options9.parser === "__vue_ts_expression") {
|
|
17677
17681
|
if (locStart(comment) - locStart(ast2) <= 0) {
|
|
17678
17682
|
addLeadingComment(ast2, comment);
|
|
17679
17683
|
continue;
|
|
@@ -17690,9 +17694,9 @@ function attachComments(ast, options) {
|
|
|
17690
17694
|
comment.enclosingNode = enclosingNode;
|
|
17691
17695
|
comment.precedingNode = precedingNode;
|
|
17692
17696
|
comment.followingNode = followingNode;
|
|
17693
|
-
args = [comment, text2,
|
|
17697
|
+
args = [comment, text2, options9, ast2, isLastComment];
|
|
17694
17698
|
}
|
|
17695
|
-
if (isOwnLineComment(text2,
|
|
17699
|
+
if (isOwnLineComment(text2, options9, decoratedComments, index)) {
|
|
17696
17700
|
comment.placement = "ownLine";
|
|
17697
17701
|
if (handleOwnLineComment(...args)) {
|
|
17698
17702
|
} else if (followingNode) {
|
|
@@ -17704,7 +17708,7 @@ function attachComments(ast, options) {
|
|
|
17704
17708
|
} else {
|
|
17705
17709
|
addDanglingComment(ast2, comment);
|
|
17706
17710
|
}
|
|
17707
|
-
} else if (isEndOfLineComment(text2,
|
|
17711
|
+
} else if (isEndOfLineComment(text2, options9, decoratedComments, index)) {
|
|
17708
17712
|
comment.placement = "endOfLine";
|
|
17709
17713
|
if (handleEndOfLineComment(...args)) {
|
|
17710
17714
|
} else if (precedingNode) {
|
|
@@ -17724,7 +17728,7 @@ function attachComments(ast, options) {
|
|
|
17724
17728
|
if (tieCount > 0) {
|
|
17725
17729
|
const lastTie = tiesToBreak[tieCount - 1];
|
|
17726
17730
|
if (lastTie.followingNode !== followingNode) {
|
|
17727
|
-
breakTies(tiesToBreak,
|
|
17731
|
+
breakTies(tiesToBreak, options9);
|
|
17728
17732
|
}
|
|
17729
17733
|
}
|
|
17730
17734
|
tiesToBreak.push(context);
|
|
@@ -17739,7 +17743,7 @@ function attachComments(ast, options) {
|
|
|
17739
17743
|
}
|
|
17740
17744
|
}
|
|
17741
17745
|
}
|
|
17742
|
-
breakTies(tiesToBreak,
|
|
17746
|
+
breakTies(tiesToBreak, options8);
|
|
17743
17747
|
if (!avoidAstMutation) {
|
|
17744
17748
|
for (const comment of comments) {
|
|
17745
17749
|
delete comment.precedingNode;
|
|
@@ -17749,9 +17753,9 @@ function attachComments(ast, options) {
|
|
|
17749
17753
|
}
|
|
17750
17754
|
}
|
|
17751
17755
|
var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/.test(text);
|
|
17752
|
-
function isOwnLineComment(text,
|
|
17756
|
+
function isOwnLineComment(text, options8, decoratedComments, commentIndex) {
|
|
17753
17757
|
const { comment, precedingNode } = decoratedComments[commentIndex];
|
|
17754
|
-
const { locStart, locEnd } =
|
|
17758
|
+
const { locStart, locEnd } = options8;
|
|
17755
17759
|
let start = locStart(comment);
|
|
17756
17760
|
if (precedingNode) {
|
|
17757
17761
|
for (let index = commentIndex - 1; index >= 0; index--) {
|
|
@@ -17764,9 +17768,9 @@ function isOwnLineComment(text, options, decoratedComments, commentIndex) {
|
|
|
17764
17768
|
}
|
|
17765
17769
|
return has_newline_default(text, start, { backwards: true });
|
|
17766
17770
|
}
|
|
17767
|
-
function isEndOfLineComment(text,
|
|
17771
|
+
function isEndOfLineComment(text, options8, decoratedComments, commentIndex) {
|
|
17768
17772
|
const { comment, followingNode } = decoratedComments[commentIndex];
|
|
17769
|
-
const { locStart, locEnd } =
|
|
17773
|
+
const { locStart, locEnd } = options8;
|
|
17770
17774
|
let end = locEnd(comment);
|
|
17771
17775
|
if (followingNode) {
|
|
17772
17776
|
for (let index = commentIndex + 1; index < decoratedComments.length; index++) {
|
|
@@ -17779,14 +17783,14 @@ function isEndOfLineComment(text, options, decoratedComments, commentIndex) {
|
|
|
17779
17783
|
}
|
|
17780
17784
|
return has_newline_default(text, end);
|
|
17781
17785
|
}
|
|
17782
|
-
function breakTies(tiesToBreak,
|
|
17786
|
+
function breakTies(tiesToBreak, options8) {
|
|
17783
17787
|
var _a, _b;
|
|
17784
17788
|
const tieCount = tiesToBreak.length;
|
|
17785
17789
|
if (tieCount === 0) {
|
|
17786
17790
|
return;
|
|
17787
17791
|
}
|
|
17788
17792
|
const { precedingNode, followingNode } = tiesToBreak[0];
|
|
17789
|
-
let gapEndPos =
|
|
17793
|
+
let gapEndPos = options8.locStart(followingNode);
|
|
17790
17794
|
let indexOfFirstLeadingComment;
|
|
17791
17795
|
for (indexOfFirstLeadingComment = tieCount; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) {
|
|
17792
17796
|
const {
|
|
@@ -17796,9 +17800,9 @@ function breakTies(tiesToBreak, options) {
|
|
|
17796
17800
|
} = tiesToBreak[indexOfFirstLeadingComment - 1];
|
|
17797
17801
|
assert.strictEqual(currentCommentPrecedingNode, precedingNode);
|
|
17798
17802
|
assert.strictEqual(currentCommentFollowingNode, followingNode);
|
|
17799
|
-
const gap =
|
|
17800
|
-
if (((_b = (_a =
|
|
17801
|
-
gapEndPos =
|
|
17803
|
+
const gap = options8.originalText.slice(options8.locEnd(comment), gapEndPos);
|
|
17804
|
+
if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]*$/.test(gap)) {
|
|
17805
|
+
gapEndPos = options8.locStart(comment);
|
|
17802
17806
|
} else {
|
|
17803
17807
|
break;
|
|
17804
17808
|
}
|
|
@@ -17812,15 +17816,15 @@ function breakTies(tiesToBreak, options) {
|
|
|
17812
17816
|
}
|
|
17813
17817
|
for (const node of [precedingNode, followingNode]) {
|
|
17814
17818
|
if (node.comments && node.comments.length > 1) {
|
|
17815
|
-
node.comments.sort((a, b) =>
|
|
17819
|
+
node.comments.sort((a, b) => options8.locStart(a) - options8.locStart(b));
|
|
17816
17820
|
}
|
|
17817
17821
|
}
|
|
17818
17822
|
tiesToBreak.length = 0;
|
|
17819
17823
|
}
|
|
17820
|
-
function findExpressionIndexForComment(quasis, comment,
|
|
17821
|
-
const startPos =
|
|
17824
|
+
function findExpressionIndexForComment(quasis, comment, options8) {
|
|
17825
|
+
const startPos = options8.locStart(comment) - 1;
|
|
17822
17826
|
for (let i = 1; i < quasis.length; ++i) {
|
|
17823
|
-
if (startPos <
|
|
17827
|
+
if (startPos < options8.locStart(quasis[i])) {
|
|
17824
17828
|
return i - 1;
|
|
17825
17829
|
}
|
|
17826
17830
|
}
|
|
@@ -17839,16 +17843,16 @@ function isPreviousLineEmpty(text, startIndex) {
|
|
|
17839
17843
|
var is_previous_line_empty_default = isPreviousLineEmpty;
|
|
17840
17844
|
|
|
17841
17845
|
// src/main/comments/print.js
|
|
17842
|
-
function printComment(path11,
|
|
17846
|
+
function printComment(path11, options8) {
|
|
17843
17847
|
const comment = path11.node;
|
|
17844
17848
|
comment.printed = true;
|
|
17845
|
-
return
|
|
17849
|
+
return options8.printer.printComment(path11, options8);
|
|
17846
17850
|
}
|
|
17847
|
-
function printLeadingComment(path11,
|
|
17851
|
+
function printLeadingComment(path11, options8) {
|
|
17848
17852
|
var _a;
|
|
17849
17853
|
const comment = path11.node;
|
|
17850
|
-
const parts = [printComment(path11,
|
|
17851
|
-
const { printer, originalText, locStart, locEnd } =
|
|
17854
|
+
const parts = [printComment(path11, options8)];
|
|
17855
|
+
const { printer, originalText, locStart, locEnd } = options8;
|
|
17852
17856
|
const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
|
|
17853
17857
|
if (isBlock) {
|
|
17854
17858
|
const lineBreak = has_newline_default(originalText, locEnd(comment)) ? has_newline_default(originalText, locStart(comment), {
|
|
@@ -17867,11 +17871,11 @@ function printLeadingComment(path11, options) {
|
|
|
17867
17871
|
}
|
|
17868
17872
|
return parts;
|
|
17869
17873
|
}
|
|
17870
|
-
function printTrailingComment(path11,
|
|
17874
|
+
function printTrailingComment(path11, options8, previousComment) {
|
|
17871
17875
|
var _a;
|
|
17872
17876
|
const comment = path11.node;
|
|
17873
|
-
const printed = printComment(path11,
|
|
17874
|
-
const { printer, originalText, locStart } =
|
|
17877
|
+
const printed = printComment(path11, options8);
|
|
17878
|
+
const { printer, originalText, locStart } = options8;
|
|
17875
17879
|
const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
|
|
17876
17880
|
if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) {
|
|
17877
17881
|
const isLineBeforeEmpty = is_previous_line_empty_default(
|
|
@@ -17893,12 +17897,12 @@ function printTrailingComment(path11, options, previousComment) {
|
|
|
17893
17897
|
}
|
|
17894
17898
|
return { doc: [" ", printed], isBlock, hasLineSuffix: false };
|
|
17895
17899
|
}
|
|
17896
|
-
function printCommentsSeparately(path11,
|
|
17900
|
+
function printCommentsSeparately(path11, options8) {
|
|
17897
17901
|
const value = path11.node;
|
|
17898
17902
|
if (!value) {
|
|
17899
17903
|
return {};
|
|
17900
17904
|
}
|
|
17901
|
-
const ignored =
|
|
17905
|
+
const ignored = options8[Symbol.for("printedComments")];
|
|
17902
17906
|
const comments = (value.comments || []).filter(
|
|
17903
17907
|
(comment) => !ignored.has(comment)
|
|
17904
17908
|
);
|
|
@@ -17915,11 +17919,11 @@ function printCommentsSeparately(path11, options) {
|
|
|
17915
17919
|
}
|
|
17916
17920
|
const { leading, trailing } = comment;
|
|
17917
17921
|
if (leading) {
|
|
17918
|
-
leadingParts.push(printLeadingComment(path11,
|
|
17922
|
+
leadingParts.push(printLeadingComment(path11, options8));
|
|
17919
17923
|
} else if (trailing) {
|
|
17920
17924
|
printedTrailingComment = printTrailingComment(
|
|
17921
17925
|
path11,
|
|
17922
|
-
|
|
17926
|
+
options8,
|
|
17923
17927
|
printedTrailingComment
|
|
17924
17928
|
);
|
|
17925
17929
|
trailingParts.push(printedTrailingComment.doc);
|
|
@@ -17927,18 +17931,18 @@ function printCommentsSeparately(path11, options) {
|
|
|
17927
17931
|
}, "comments");
|
|
17928
17932
|
return { leading: leadingParts, trailing: trailingParts };
|
|
17929
17933
|
}
|
|
17930
|
-
function printComments(path11, doc2,
|
|
17931
|
-
const { leading, trailing } = printCommentsSeparately(path11,
|
|
17934
|
+
function printComments(path11, doc2, options8) {
|
|
17935
|
+
const { leading, trailing } = printCommentsSeparately(path11, options8);
|
|
17932
17936
|
if (!leading && !trailing) {
|
|
17933
17937
|
return doc2;
|
|
17934
17938
|
}
|
|
17935
17939
|
return inheritLabel(doc2, (doc3) => [leading, doc3, trailing]);
|
|
17936
17940
|
}
|
|
17937
|
-
function ensureAllCommentsPrinted(
|
|
17941
|
+
function ensureAllCommentsPrinted(options8) {
|
|
17938
17942
|
const {
|
|
17939
17943
|
[Symbol.for("comments")]: comments,
|
|
17940
17944
|
[Symbol.for("printedComments")]: printedComments
|
|
17941
|
-
} =
|
|
17945
|
+
} = options8;
|
|
17942
17946
|
for (const comment of comments) {
|
|
17943
17947
|
if (!comment.printed && !printedComments.has(comment)) {
|
|
17944
17948
|
throw new Error(
|
|
@@ -17950,7 +17954,7 @@ function ensureAllCommentsPrinted(options) {
|
|
|
17950
17954
|
}
|
|
17951
17955
|
|
|
17952
17956
|
// src/main/multiparser.js
|
|
17953
|
-
async function printEmbeddedLanguages(path11, genericPrint,
|
|
17957
|
+
async function printEmbeddedLanguages(path11, genericPrint, options8, printAstToDoc2, embeds) {
|
|
17954
17958
|
const {
|
|
17955
17959
|
embeddedLanguageFormatting,
|
|
17956
17960
|
printer: {
|
|
@@ -17958,7 +17962,7 @@ async function printEmbeddedLanguages(path11, genericPrint, options, printAstToD
|
|
|
17958
17962
|
hasPrettierIgnore = () => false,
|
|
17959
17963
|
getVisitorKeys: printerGetVisitorKeys
|
|
17960
17964
|
}
|
|
17961
|
-
} =
|
|
17965
|
+
} = options8;
|
|
17962
17966
|
if (!embed || embeddedLanguageFormatting !== "auto") {
|
|
17963
17967
|
return;
|
|
17964
17968
|
}
|
|
@@ -17976,7 +17980,7 @@ async function printEmbeddedLanguages(path11, genericPrint, options, printAstToD
|
|
|
17976
17980
|
for (const { print, node, pathStack } of embedCallResults) {
|
|
17977
17981
|
try {
|
|
17978
17982
|
path11.stack = pathStack;
|
|
17979
|
-
const doc2 = await print(textToDocForEmbed, genericPrint, path11,
|
|
17983
|
+
const doc2 = await print(textToDocForEmbed, genericPrint, path11, options8);
|
|
17980
17984
|
if (doc2) {
|
|
17981
17985
|
embeds.set(node, doc2);
|
|
17982
17986
|
}
|
|
@@ -17988,7 +17992,7 @@ async function printEmbeddedLanguages(path11, genericPrint, options, printAstToD
|
|
|
17988
17992
|
}
|
|
17989
17993
|
path11.stack = originalPathStack;
|
|
17990
17994
|
function textToDocForEmbed(text, partialNextOptions) {
|
|
17991
|
-
return textToDoc(text, partialNextOptions,
|
|
17995
|
+
return textToDoc(text, partialNextOptions, options8, printAstToDoc2);
|
|
17992
17996
|
}
|
|
17993
17997
|
function recurse() {
|
|
17994
17998
|
const { node } = path11;
|
|
@@ -18002,7 +18006,7 @@ async function printEmbeddedLanguages(path11, genericPrint, options, printAstToD
|
|
|
18002
18006
|
path11.call(recurse, key);
|
|
18003
18007
|
}
|
|
18004
18008
|
}
|
|
18005
|
-
const result = embed(path11,
|
|
18009
|
+
const result = embed(path11, options8);
|
|
18006
18010
|
if (!result) {
|
|
18007
18011
|
return;
|
|
18008
18012
|
}
|
|
@@ -18023,7 +18027,7 @@ async function printEmbeddedLanguages(path11, genericPrint, options, printAstToD
|
|
|
18023
18027
|
}
|
|
18024
18028
|
}
|
|
18025
18029
|
async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2) {
|
|
18026
|
-
const
|
|
18030
|
+
const options8 = await normalize_format_options_default(
|
|
18027
18031
|
{
|
|
18028
18032
|
...parentOptions,
|
|
18029
18033
|
...partialNextOptions,
|
|
@@ -18032,19 +18036,19 @@ async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2
|
|
|
18032
18036
|
},
|
|
18033
18037
|
{ passThrough: true }
|
|
18034
18038
|
);
|
|
18035
|
-
const { ast } = await parse_default(text,
|
|
18036
|
-
const doc2 = await printAstToDoc2(ast,
|
|
18039
|
+
const { ast } = await parse_default(text, options8);
|
|
18040
|
+
const doc2 = await printAstToDoc2(ast, options8);
|
|
18037
18041
|
return stripTrailingHardline(doc2);
|
|
18038
18042
|
}
|
|
18039
18043
|
|
|
18040
18044
|
// src/main/create-print-pre-check-function.js
|
|
18041
|
-
function createPrintPreCheckFunction(
|
|
18045
|
+
function createPrintPreCheckFunction(options8) {
|
|
18042
18046
|
if (true) {
|
|
18043
18047
|
return () => {
|
|
18044
18048
|
};
|
|
18045
18049
|
}
|
|
18046
18050
|
const getVisitorKeys = create_get_visitor_keys_function_default(
|
|
18047
|
-
|
|
18051
|
+
options8.printer.getVisitorKeys
|
|
18048
18052
|
);
|
|
18049
18053
|
return function(path11) {
|
|
18050
18054
|
if (path11.isRoot) {
|
|
@@ -18067,14 +18071,14 @@ function createPrintPreCheckFunction(options) {
|
|
|
18067
18071
|
var create_print_pre_check_function_default = createPrintPreCheckFunction;
|
|
18068
18072
|
|
|
18069
18073
|
// src/main/print-ignored.js
|
|
18070
|
-
function printIgnored(path11,
|
|
18074
|
+
function printIgnored(path11, options8) {
|
|
18071
18075
|
const {
|
|
18072
18076
|
originalText,
|
|
18073
18077
|
[Symbol.for("comments")]: comments,
|
|
18074
18078
|
locStart,
|
|
18075
18079
|
locEnd,
|
|
18076
18080
|
[Symbol.for("printedComments")]: printedComments
|
|
18077
|
-
} =
|
|
18081
|
+
} = options8;
|
|
18078
18082
|
const { node } = path11;
|
|
18079
18083
|
const start = locStart(node);
|
|
18080
18084
|
const end = locEnd(node);
|
|
@@ -18088,21 +18092,21 @@ function printIgnored(path11, options) {
|
|
|
18088
18092
|
var print_ignored_default = printIgnored;
|
|
18089
18093
|
|
|
18090
18094
|
// src/main/ast-to-doc.js
|
|
18091
|
-
async function printAstToDoc(ast,
|
|
18092
|
-
({ ast } = await prepareToPrint(ast,
|
|
18095
|
+
async function printAstToDoc(ast, options8) {
|
|
18096
|
+
({ ast } = await prepareToPrint(ast, options8));
|
|
18093
18097
|
const cache = /* @__PURE__ */ new Map();
|
|
18094
18098
|
const path11 = new ast_path_default(ast);
|
|
18095
|
-
const ensurePrintingNode = create_print_pre_check_function_default(
|
|
18099
|
+
const ensurePrintingNode = create_print_pre_check_function_default(options8);
|
|
18096
18100
|
const embeds = /* @__PURE__ */ new Map();
|
|
18097
|
-
await printEmbeddedLanguages(path11, mainPrint,
|
|
18101
|
+
await printEmbeddedLanguages(path11, mainPrint, options8, printAstToDoc, embeds);
|
|
18098
18102
|
const doc2 = await callPluginPrintFunction(
|
|
18099
18103
|
path11,
|
|
18100
|
-
|
|
18104
|
+
options8,
|
|
18101
18105
|
mainPrint,
|
|
18102
18106
|
void 0,
|
|
18103
18107
|
embeds
|
|
18104
18108
|
);
|
|
18105
|
-
ensureAllCommentsPrinted(
|
|
18109
|
+
ensureAllCommentsPrinted(options8);
|
|
18106
18110
|
return doc2;
|
|
18107
18111
|
function mainPrint(selector, args) {
|
|
18108
18112
|
if (selector === void 0 || selector === path11) {
|
|
@@ -18123,43 +18127,43 @@ async function printAstToDoc(ast, options) {
|
|
|
18123
18127
|
if (shouldCache && cache.has(value)) {
|
|
18124
18128
|
return cache.get(value);
|
|
18125
18129
|
}
|
|
18126
|
-
const doc3 = callPluginPrintFunction(path11,
|
|
18130
|
+
const doc3 = callPluginPrintFunction(path11, options8, mainPrint, args, embeds);
|
|
18127
18131
|
if (shouldCache) {
|
|
18128
18132
|
cache.set(value, doc3);
|
|
18129
18133
|
}
|
|
18130
18134
|
return doc3;
|
|
18131
18135
|
}
|
|
18132
18136
|
}
|
|
18133
|
-
function callPluginPrintFunction(path11,
|
|
18137
|
+
function callPluginPrintFunction(path11, options8, printPath, args, embeds) {
|
|
18134
18138
|
var _a;
|
|
18135
18139
|
const { node } = path11;
|
|
18136
|
-
const { printer } =
|
|
18140
|
+
const { printer } = options8;
|
|
18137
18141
|
let doc2;
|
|
18138
18142
|
if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path11)) {
|
|
18139
|
-
doc2 = print_ignored_default(path11,
|
|
18143
|
+
doc2 = print_ignored_default(path11, options8);
|
|
18140
18144
|
} else if (embeds.has(node)) {
|
|
18141
18145
|
doc2 = embeds.get(node);
|
|
18142
18146
|
} else {
|
|
18143
|
-
doc2 = printer.print(path11,
|
|
18147
|
+
doc2 = printer.print(path11, options8, printPath, args);
|
|
18144
18148
|
}
|
|
18145
|
-
if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path11,
|
|
18146
|
-
doc2 = printComments(path11, doc2,
|
|
18149
|
+
if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path11, options8))) {
|
|
18150
|
+
doc2 = printComments(path11, doc2, options8);
|
|
18147
18151
|
}
|
|
18148
|
-
if (node ===
|
|
18152
|
+
if (node === options8.cursorNode) {
|
|
18149
18153
|
doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3, cursor]);
|
|
18150
18154
|
}
|
|
18151
18155
|
return doc2;
|
|
18152
18156
|
}
|
|
18153
|
-
async function prepareToPrint(ast,
|
|
18157
|
+
async function prepareToPrint(ast, options8) {
|
|
18154
18158
|
const comments = ast.comments ?? [];
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
attachComments(ast,
|
|
18159
|
+
options8[Symbol.for("comments")] = comments;
|
|
18160
|
+
options8[Symbol.for("tokens")] = ast.tokens ?? [];
|
|
18161
|
+
options8[Symbol.for("printedComments")] = /* @__PURE__ */ new Set();
|
|
18162
|
+
attachComments(ast, options8);
|
|
18159
18163
|
const {
|
|
18160
18164
|
printer: { preprocess }
|
|
18161
|
-
} =
|
|
18162
|
-
ast = preprocess ? await preprocess(ast,
|
|
18165
|
+
} = options8;
|
|
18166
|
+
ast = preprocess ? await preprocess(ast, options8) : ast;
|
|
18163
18167
|
return { ast, comments };
|
|
18164
18168
|
}
|
|
18165
18169
|
|
|
@@ -18224,18 +18228,18 @@ function findSiblingAncestors(startNodeAndParents, endNodeAndParents, { locStart
|
|
|
18224
18228
|
endNode: resultEndNode
|
|
18225
18229
|
};
|
|
18226
18230
|
}
|
|
18227
|
-
function findNodeAtOffset(node, offset,
|
|
18228
|
-
const { locStart, locEnd } =
|
|
18231
|
+
function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], type) {
|
|
18232
|
+
const { locStart, locEnd } = options8;
|
|
18229
18233
|
const start = locStart(node);
|
|
18230
18234
|
const end = locEnd(node);
|
|
18231
18235
|
if (offset > end || offset < start || type === "rangeEnd" && offset === start || type === "rangeStart" && offset === end) {
|
|
18232
18236
|
return;
|
|
18233
18237
|
}
|
|
18234
|
-
for (const childNode of getSortedChildNodes(node,
|
|
18238
|
+
for (const childNode of getSortedChildNodes(node, options8)) {
|
|
18235
18239
|
const childResult = findNodeAtOffset(
|
|
18236
18240
|
childNode,
|
|
18237
18241
|
offset,
|
|
18238
|
-
|
|
18242
|
+
options8,
|
|
18239
18243
|
predicate,
|
|
18240
18244
|
[node, ...parentNodes],
|
|
18241
18245
|
type
|
|
@@ -18370,10 +18374,10 @@ function calculateRange(text, opts, ast) {
|
|
|
18370
18374
|
}
|
|
18371
18375
|
|
|
18372
18376
|
// src/main/get-cursor-node.js
|
|
18373
|
-
function getCursorNode(ast,
|
|
18374
|
-
const { cursorOffset, locStart, locEnd } =
|
|
18377
|
+
function getCursorNode(ast, options8) {
|
|
18378
|
+
const { cursorOffset, locStart, locEnd } = options8;
|
|
18375
18379
|
const getVisitorKeys = create_get_visitor_keys_function_default(
|
|
18376
|
-
|
|
18380
|
+
options8.printer.getVisitorKeys
|
|
18377
18381
|
);
|
|
18378
18382
|
const nodeContainsCursor = (node) => locStart(node) <= cursorOffset && locEnd(node) >= cursorOffset;
|
|
18379
18383
|
let cursorNode = ast;
|
|
@@ -18527,29 +18531,29 @@ function ensureIndexInText(text, index, defaultValue) {
|
|
|
18527
18531
|
}
|
|
18528
18532
|
return index;
|
|
18529
18533
|
}
|
|
18530
|
-
function normalizeIndexes(text,
|
|
18534
|
+
function normalizeIndexes(text, options8) {
|
|
18531
18535
|
let {
|
|
18532
18536
|
cursorOffset,
|
|
18533
18537
|
rangeStart,
|
|
18534
18538
|
rangeEnd
|
|
18535
|
-
} =
|
|
18539
|
+
} = options8;
|
|
18536
18540
|
cursorOffset = ensureIndexInText(text, cursorOffset, -1);
|
|
18537
18541
|
rangeStart = ensureIndexInText(text, rangeStart, 0);
|
|
18538
18542
|
rangeEnd = ensureIndexInText(text, rangeEnd, text.length);
|
|
18539
18543
|
return {
|
|
18540
|
-
...
|
|
18544
|
+
...options8,
|
|
18541
18545
|
cursorOffset,
|
|
18542
18546
|
rangeStart,
|
|
18543
18547
|
rangeEnd
|
|
18544
18548
|
};
|
|
18545
18549
|
}
|
|
18546
|
-
function normalizeInputAndOptions(text,
|
|
18550
|
+
function normalizeInputAndOptions(text, options8) {
|
|
18547
18551
|
let {
|
|
18548
18552
|
cursorOffset,
|
|
18549
18553
|
rangeStart,
|
|
18550
18554
|
rangeEnd,
|
|
18551
18555
|
endOfLine
|
|
18552
|
-
} = normalizeIndexes(text,
|
|
18556
|
+
} = normalizeIndexes(text, options8);
|
|
18553
18557
|
const hasBOM = text.charAt(0) === BOM;
|
|
18554
18558
|
if (hasBOM) {
|
|
18555
18559
|
text = text.slice(1);
|
|
@@ -18571,7 +18575,7 @@ function normalizeInputAndOptions(text, options) {
|
|
|
18571
18575
|
hasBOM,
|
|
18572
18576
|
text,
|
|
18573
18577
|
options: normalizeIndexes(text, {
|
|
18574
|
-
...
|
|
18578
|
+
...options8,
|
|
18575
18579
|
cursorOffset,
|
|
18576
18580
|
rangeStart,
|
|
18577
18581
|
rangeEnd,
|
|
@@ -18579,17 +18583,17 @@ function normalizeInputAndOptions(text, options) {
|
|
|
18579
18583
|
})
|
|
18580
18584
|
};
|
|
18581
18585
|
}
|
|
18582
|
-
async function hasPragma(text,
|
|
18583
|
-
const selectedParser = await resolveParser(
|
|
18586
|
+
async function hasPragma(text, options8) {
|
|
18587
|
+
const selectedParser = await resolveParser(options8);
|
|
18584
18588
|
return !selectedParser.hasPragma || selectedParser.hasPragma(text);
|
|
18585
18589
|
}
|
|
18586
18590
|
async function formatWithCursor(originalText, originalOptions) {
|
|
18587
18591
|
let {
|
|
18588
18592
|
hasBOM,
|
|
18589
18593
|
text,
|
|
18590
|
-
options
|
|
18594
|
+
options: options8
|
|
18591
18595
|
} = normalizeInputAndOptions(originalText, await normalize_format_options_default(originalOptions));
|
|
18592
|
-
if (
|
|
18596
|
+
if (options8.rangeStart >= options8.rangeEnd && text !== "" || options8.requirePragma && !await hasPragma(text, options8)) {
|
|
18593
18597
|
return {
|
|
18594
18598
|
formatted: originalText,
|
|
18595
18599
|
cursorOffset: originalOptions.cursorOffset,
|
|
@@ -18597,13 +18601,13 @@ async function formatWithCursor(originalText, originalOptions) {
|
|
|
18597
18601
|
};
|
|
18598
18602
|
}
|
|
18599
18603
|
let result;
|
|
18600
|
-
if (
|
|
18601
|
-
result = await formatRange(text,
|
|
18604
|
+
if (options8.rangeStart > 0 || options8.rangeEnd < text.length) {
|
|
18605
|
+
result = await formatRange(text, options8);
|
|
18602
18606
|
} else {
|
|
18603
|
-
if (!
|
|
18604
|
-
text =
|
|
18607
|
+
if (!options8.requirePragma && options8.insertPragma && options8.printer.insertPragma && !await hasPragma(text, options8)) {
|
|
18608
|
+
text = options8.printer.insertPragma(text);
|
|
18605
18609
|
}
|
|
18606
|
-
result = await coreFormat(text,
|
|
18610
|
+
result = await coreFormat(text, options8);
|
|
18607
18611
|
}
|
|
18608
18612
|
if (hasBOM) {
|
|
18609
18613
|
result.formatted = BOM + result.formatted;
|
|
@@ -18616,43 +18620,43 @@ async function formatWithCursor(originalText, originalOptions) {
|
|
|
18616
18620
|
async function parse2(originalText, originalOptions, devOptions) {
|
|
18617
18621
|
const {
|
|
18618
18622
|
text,
|
|
18619
|
-
options
|
|
18623
|
+
options: options8
|
|
18620
18624
|
} = normalizeInputAndOptions(originalText, await normalize_format_options_default(originalOptions));
|
|
18621
|
-
const parsed = await parse_default(text,
|
|
18625
|
+
const parsed = await parse_default(text, options8);
|
|
18622
18626
|
if (devOptions) {
|
|
18623
18627
|
if (devOptions.preprocessForPrint) {
|
|
18624
|
-
parsed.ast = await prepareToPrint(parsed.ast,
|
|
18628
|
+
parsed.ast = await prepareToPrint(parsed.ast, options8);
|
|
18625
18629
|
}
|
|
18626
18630
|
if (devOptions.massage) {
|
|
18627
|
-
parsed.ast = massage_ast_default(parsed.ast,
|
|
18631
|
+
parsed.ast = massage_ast_default(parsed.ast, options8);
|
|
18628
18632
|
}
|
|
18629
18633
|
}
|
|
18630
18634
|
return parsed;
|
|
18631
18635
|
}
|
|
18632
|
-
async function formatAst(ast,
|
|
18633
|
-
|
|
18634
|
-
const doc2 = await printAstToDoc(ast,
|
|
18635
|
-
return printDocToString(doc2,
|
|
18636
|
+
async function formatAst(ast, options8) {
|
|
18637
|
+
options8 = await normalize_format_options_default(options8);
|
|
18638
|
+
const doc2 = await printAstToDoc(ast, options8);
|
|
18639
|
+
return printDocToString(doc2, options8);
|
|
18636
18640
|
}
|
|
18637
|
-
async function formatDoc(doc2,
|
|
18641
|
+
async function formatDoc(doc2, options8) {
|
|
18638
18642
|
const text = printDocToDebug(doc2);
|
|
18639
18643
|
const {
|
|
18640
18644
|
formatted
|
|
18641
18645
|
} = await formatWithCursor(text, {
|
|
18642
|
-
...
|
|
18646
|
+
...options8,
|
|
18643
18647
|
parser: "__js_expression"
|
|
18644
18648
|
});
|
|
18645
18649
|
return formatted;
|
|
18646
18650
|
}
|
|
18647
|
-
async function printToDoc(originalText,
|
|
18648
|
-
|
|
18651
|
+
async function printToDoc(originalText, options8) {
|
|
18652
|
+
options8 = await normalize_format_options_default(options8);
|
|
18649
18653
|
const {
|
|
18650
18654
|
ast
|
|
18651
|
-
} = await parse_default(originalText,
|
|
18652
|
-
return printAstToDoc(ast,
|
|
18655
|
+
} = await parse_default(originalText, options8);
|
|
18656
|
+
return printAstToDoc(ast, options8);
|
|
18653
18657
|
}
|
|
18654
|
-
async function printDocToString2(doc2,
|
|
18655
|
-
return printDocToString(doc2, await normalize_format_options_default(
|
|
18658
|
+
async function printDocToString2(doc2, options8) {
|
|
18659
|
+
return printDocToString(doc2, await normalize_format_options_default(options8));
|
|
18656
18660
|
}
|
|
18657
18661
|
|
|
18658
18662
|
// src/config/resolve-config.js
|
|
@@ -20139,9 +20143,9 @@ async function transform(result) {
|
|
|
20139
20143
|
delete config.$schema;
|
|
20140
20144
|
return result;
|
|
20141
20145
|
}
|
|
20142
|
-
function getExplorer(
|
|
20146
|
+
function getExplorer(options8) {
|
|
20143
20147
|
return cosmiconfig("prettier", {
|
|
20144
|
-
cache:
|
|
20148
|
+
cache: options8.cache,
|
|
20145
20149
|
transform,
|
|
20146
20150
|
searchPlaces,
|
|
20147
20151
|
loaders
|
|
@@ -20151,31 +20155,31 @@ var get_prettier_config_explorer_default = getExplorer;
|
|
|
20151
20155
|
|
|
20152
20156
|
// src/config/resolve-config.js
|
|
20153
20157
|
var getPrettierConfigExplorer = mem(get_prettier_config_explorer_default, {
|
|
20154
|
-
cacheKey: ([
|
|
20158
|
+
cacheKey: ([options8]) => options8.cache
|
|
20155
20159
|
});
|
|
20156
20160
|
var memoizedLoadEditorConfig = mem(resolve_editorconfig_default);
|
|
20157
20161
|
function clearCache() {
|
|
20158
20162
|
memClear(getPrettierConfigExplorer);
|
|
20159
20163
|
memClear(memoizedLoadEditorConfig);
|
|
20160
20164
|
}
|
|
20161
|
-
function loadEditorConfig2(filePath,
|
|
20162
|
-
if (!filePath || !
|
|
20165
|
+
function loadEditorConfig2(filePath, options8) {
|
|
20166
|
+
if (!filePath || !options8.editorconfig) {
|
|
20163
20167
|
return;
|
|
20164
20168
|
}
|
|
20165
|
-
return (
|
|
20169
|
+
return (options8.useCache ? memoizedLoadEditorConfig : resolve_editorconfig_default)(filePath);
|
|
20166
20170
|
}
|
|
20167
|
-
function loadPrettierConfig(filePath,
|
|
20168
|
-
const { useCache, config: configPath } =
|
|
20171
|
+
function loadPrettierConfig(filePath, options8) {
|
|
20172
|
+
const { useCache, config: configPath } = options8;
|
|
20169
20173
|
const { load, search } = getPrettierConfigExplorer({
|
|
20170
20174
|
cache: Boolean(useCache)
|
|
20171
20175
|
});
|
|
20172
20176
|
return configPath ? load(configPath) : search(filePath);
|
|
20173
20177
|
}
|
|
20174
|
-
async function resolveConfig(filePath,
|
|
20175
|
-
|
|
20178
|
+
async function resolveConfig(filePath, options8) {
|
|
20179
|
+
options8 = { useCache: true, ...options8 };
|
|
20176
20180
|
const [result, editorConfigured] = await Promise.all([
|
|
20177
|
-
loadPrettierConfig(filePath,
|
|
20178
|
-
loadEditorConfig2(filePath,
|
|
20181
|
+
loadPrettierConfig(filePath, options8),
|
|
20182
|
+
loadEditorConfig2(filePath, options8)
|
|
20179
20183
|
]);
|
|
20180
20184
|
if (!result && !editorConfigured) {
|
|
20181
20185
|
return null;
|
|
@@ -20200,7 +20204,7 @@ async function resolveConfigFile(filePath) {
|
|
|
20200
20204
|
}
|
|
20201
20205
|
function mergeOverrides(configResult, filePath) {
|
|
20202
20206
|
const { config, filepath: configPath } = configResult || {};
|
|
20203
|
-
const { overrides, ...
|
|
20207
|
+
const { overrides, ...options8 } = config || {};
|
|
20204
20208
|
if (filePath && overrides) {
|
|
20205
20209
|
const relativeFilePath = path6.relative(path6.dirname(configPath), filePath);
|
|
20206
20210
|
for (const override of overrides) {
|
|
@@ -20209,11 +20213,11 @@ function mergeOverrides(configResult, filePath) {
|
|
|
20209
20213
|
override.files,
|
|
20210
20214
|
override.excludeFiles
|
|
20211
20215
|
)) {
|
|
20212
|
-
Object.assign(
|
|
20216
|
+
Object.assign(options8, override.options);
|
|
20213
20217
|
}
|
|
20214
20218
|
}
|
|
20215
20219
|
}
|
|
20216
|
-
return
|
|
20220
|
+
return options8;
|
|
20217
20221
|
}
|
|
20218
20222
|
function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
|
|
20219
20223
|
const patternList = Array.isArray(patterns) ? patterns : [patterns];
|
|
@@ -20286,42 +20290,42 @@ async function createIsIgnoredFunction(ignoreFilePaths, withNodeModules) {
|
|
|
20286
20290
|
const isIgnoredFunctions = (await Promise.all(ignoreFilePaths.map((ignoreFilePath) => createSingleIsIgnoredFunction(ignoreFilePath, withNodeModules)))).filter(Boolean);
|
|
20287
20291
|
return (filepath) => isIgnoredFunctions.some((isIgnored2) => isIgnored2(filepath));
|
|
20288
20292
|
}
|
|
20289
|
-
async function isIgnored(filepath,
|
|
20293
|
+
async function isIgnored(filepath, options8) {
|
|
20290
20294
|
const {
|
|
20291
20295
|
ignorePath,
|
|
20292
20296
|
withNodeModules
|
|
20293
|
-
} =
|
|
20297
|
+
} = options8;
|
|
20294
20298
|
const isIgnored2 = await createIsIgnoredFunction(ignorePath, withNodeModules);
|
|
20295
20299
|
return isIgnored2(filepath);
|
|
20296
20300
|
}
|
|
20297
20301
|
|
|
20298
20302
|
// src/common/get-file-info.js
|
|
20299
|
-
async function getFileInfo(filePath,
|
|
20303
|
+
async function getFileInfo(filePath, options8) {
|
|
20300
20304
|
if (typeof filePath !== "string") {
|
|
20301
20305
|
throw new TypeError(
|
|
20302
20306
|
`expect \`filePath\` to be a string, got \`${typeof filePath}\``
|
|
20303
20307
|
);
|
|
20304
20308
|
}
|
|
20305
|
-
let { ignorePath, withNodeModules } =
|
|
20309
|
+
let { ignorePath, withNodeModules } = options8;
|
|
20306
20310
|
if (!Array.isArray(ignorePath)) {
|
|
20307
20311
|
ignorePath = [ignorePath];
|
|
20308
20312
|
}
|
|
20309
20313
|
const ignored = await isIgnored(filePath, { ignorePath, withNodeModules });
|
|
20310
20314
|
let inferredParser;
|
|
20311
20315
|
if (!ignored) {
|
|
20312
|
-
inferredParser = await getParser(filePath,
|
|
20316
|
+
inferredParser = await getParser(filePath, options8);
|
|
20313
20317
|
}
|
|
20314
20318
|
return {
|
|
20315
20319
|
ignored,
|
|
20316
20320
|
inferredParser: inferredParser ?? null
|
|
20317
20321
|
};
|
|
20318
20322
|
}
|
|
20319
|
-
async function getParser(filePath,
|
|
20323
|
+
async function getParser(filePath, options8) {
|
|
20320
20324
|
let config;
|
|
20321
|
-
if (
|
|
20325
|
+
if (options8.resolveConfig !== false) {
|
|
20322
20326
|
config = await resolveConfig(filePath);
|
|
20323
20327
|
}
|
|
20324
|
-
return (config == null ? void 0 : config.parser) ?? infer_parser_default(
|
|
20328
|
+
return (config == null ? void 0 : config.parser) ?? infer_parser_default(options8, { physicalFile: filePath });
|
|
20325
20329
|
}
|
|
20326
20330
|
var get_file_info_default = getFileInfo;
|
|
20327
20331
|
|
|
@@ -20430,25 +20434,1018 @@ function clearCache3() {
|
|
|
20430
20434
|
memClear(findNodeModules);
|
|
20431
20435
|
}
|
|
20432
20436
|
|
|
20437
|
+
// src/plugins/builtin-plugins-proxy.js
|
|
20438
|
+
var builtin_plugins_proxy_exports = {};
|
|
20439
|
+
__export(builtin_plugins_proxy_exports, {
|
|
20440
|
+
languages: () => languages,
|
|
20441
|
+
options: () => options7,
|
|
20442
|
+
parsers: () => parsers,
|
|
20443
|
+
printers: () => printers
|
|
20444
|
+
});
|
|
20445
|
+
|
|
20446
|
+
// src/common/common-options.evaluate.js
|
|
20447
|
+
var common_options_evaluate_default = {
|
|
20448
|
+
"bracketSpacing": {
|
|
20449
|
+
"category": "Common",
|
|
20450
|
+
"type": "boolean",
|
|
20451
|
+
"default": true,
|
|
20452
|
+
"description": "Print spaces between brackets.",
|
|
20453
|
+
"oppositeDescription": "Do not print spaces between brackets."
|
|
20454
|
+
},
|
|
20455
|
+
"singleQuote": {
|
|
20456
|
+
"category": "Common",
|
|
20457
|
+
"type": "boolean",
|
|
20458
|
+
"default": false,
|
|
20459
|
+
"description": "Use single quotes instead of double quotes."
|
|
20460
|
+
},
|
|
20461
|
+
"proseWrap": {
|
|
20462
|
+
"category": "Common",
|
|
20463
|
+
"type": "choice",
|
|
20464
|
+
"default": "preserve",
|
|
20465
|
+
"description": "How to wrap prose.",
|
|
20466
|
+
"choices": [
|
|
20467
|
+
{
|
|
20468
|
+
"value": "always",
|
|
20469
|
+
"description": "Wrap prose if it exceeds the print width."
|
|
20470
|
+
},
|
|
20471
|
+
{
|
|
20472
|
+
"value": "never",
|
|
20473
|
+
"description": "Do not wrap prose."
|
|
20474
|
+
},
|
|
20475
|
+
{
|
|
20476
|
+
"value": "preserve",
|
|
20477
|
+
"description": "Wrap prose as-is."
|
|
20478
|
+
}
|
|
20479
|
+
]
|
|
20480
|
+
},
|
|
20481
|
+
"bracketSameLine": {
|
|
20482
|
+
"category": "Common",
|
|
20483
|
+
"type": "boolean",
|
|
20484
|
+
"default": false,
|
|
20485
|
+
"description": "Put > of opening tags on the last line instead of on a new line."
|
|
20486
|
+
},
|
|
20487
|
+
"singleAttributePerLine": {
|
|
20488
|
+
"category": "Common",
|
|
20489
|
+
"type": "boolean",
|
|
20490
|
+
"default": false,
|
|
20491
|
+
"description": "Enforce single attribute per line in HTML, Vue and JSX."
|
|
20492
|
+
}
|
|
20493
|
+
};
|
|
20494
|
+
|
|
20495
|
+
// src/language-css/options.js
|
|
20496
|
+
var options = {
|
|
20497
|
+
singleQuote: common_options_evaluate_default.singleQuote
|
|
20498
|
+
};
|
|
20499
|
+
var options_default = options;
|
|
20500
|
+
|
|
20501
|
+
// src/language-css/languages.evaluate.js
|
|
20502
|
+
var languages_evaluate_default = [
|
|
20503
|
+
{
|
|
20504
|
+
"linguistLanguageId": 50,
|
|
20505
|
+
"name": "CSS",
|
|
20506
|
+
"type": "markup",
|
|
20507
|
+
"tmScope": "source.css",
|
|
20508
|
+
"aceMode": "css",
|
|
20509
|
+
"codemirrorMode": "css",
|
|
20510
|
+
"codemirrorMimeType": "text/css",
|
|
20511
|
+
"color": "#563d7c",
|
|
20512
|
+
"extensions": [
|
|
20513
|
+
".css",
|
|
20514
|
+
".wxss"
|
|
20515
|
+
],
|
|
20516
|
+
"parsers": [
|
|
20517
|
+
"css"
|
|
20518
|
+
],
|
|
20519
|
+
"vscodeLanguageIds": [
|
|
20520
|
+
"css"
|
|
20521
|
+
]
|
|
20522
|
+
},
|
|
20523
|
+
{
|
|
20524
|
+
"linguistLanguageId": 262764437,
|
|
20525
|
+
"name": "PostCSS",
|
|
20526
|
+
"type": "markup",
|
|
20527
|
+
"color": "#dc3a0c",
|
|
20528
|
+
"tmScope": "source.postcss",
|
|
20529
|
+
"group": "CSS",
|
|
20530
|
+
"extensions": [
|
|
20531
|
+
".pcss",
|
|
20532
|
+
".postcss"
|
|
20533
|
+
],
|
|
20534
|
+
"aceMode": "text",
|
|
20535
|
+
"parsers": [
|
|
20536
|
+
"css"
|
|
20537
|
+
],
|
|
20538
|
+
"vscodeLanguageIds": [
|
|
20539
|
+
"postcss"
|
|
20540
|
+
]
|
|
20541
|
+
},
|
|
20542
|
+
{
|
|
20543
|
+
"linguistLanguageId": 198,
|
|
20544
|
+
"name": "Less",
|
|
20545
|
+
"type": "markup",
|
|
20546
|
+
"color": "#1d365d",
|
|
20547
|
+
"aliases": [
|
|
20548
|
+
"less-css"
|
|
20549
|
+
],
|
|
20550
|
+
"extensions": [
|
|
20551
|
+
".less"
|
|
20552
|
+
],
|
|
20553
|
+
"tmScope": "source.css.less",
|
|
20554
|
+
"aceMode": "less",
|
|
20555
|
+
"codemirrorMode": "css",
|
|
20556
|
+
"codemirrorMimeType": "text/css",
|
|
20557
|
+
"parsers": [
|
|
20558
|
+
"less"
|
|
20559
|
+
],
|
|
20560
|
+
"vscodeLanguageIds": [
|
|
20561
|
+
"less"
|
|
20562
|
+
]
|
|
20563
|
+
},
|
|
20564
|
+
{
|
|
20565
|
+
"linguistLanguageId": 329,
|
|
20566
|
+
"name": "SCSS",
|
|
20567
|
+
"type": "markup",
|
|
20568
|
+
"color": "#c6538c",
|
|
20569
|
+
"tmScope": "source.css.scss",
|
|
20570
|
+
"aceMode": "scss",
|
|
20571
|
+
"codemirrorMode": "css",
|
|
20572
|
+
"codemirrorMimeType": "text/x-scss",
|
|
20573
|
+
"extensions": [
|
|
20574
|
+
".scss"
|
|
20575
|
+
],
|
|
20576
|
+
"parsers": [
|
|
20577
|
+
"scss"
|
|
20578
|
+
],
|
|
20579
|
+
"vscodeLanguageIds": [
|
|
20580
|
+
"scss"
|
|
20581
|
+
]
|
|
20582
|
+
}
|
|
20583
|
+
];
|
|
20584
|
+
|
|
20585
|
+
// src/language-graphql/options.js
|
|
20586
|
+
var options2 = {
|
|
20587
|
+
bracketSpacing: common_options_evaluate_default.bracketSpacing
|
|
20588
|
+
};
|
|
20589
|
+
var options_default2 = options2;
|
|
20590
|
+
|
|
20591
|
+
// src/language-graphql/languages.evaluate.js
|
|
20592
|
+
var languages_evaluate_default2 = [
|
|
20593
|
+
{
|
|
20594
|
+
"linguistLanguageId": 139,
|
|
20595
|
+
"name": "GraphQL",
|
|
20596
|
+
"type": "data",
|
|
20597
|
+
"color": "#e10098",
|
|
20598
|
+
"extensions": [
|
|
20599
|
+
".graphql",
|
|
20600
|
+
".gql",
|
|
20601
|
+
".graphqls"
|
|
20602
|
+
],
|
|
20603
|
+
"tmScope": "source.graphql",
|
|
20604
|
+
"aceMode": "text",
|
|
20605
|
+
"parsers": [
|
|
20606
|
+
"graphql"
|
|
20607
|
+
],
|
|
20608
|
+
"vscodeLanguageIds": [
|
|
20609
|
+
"graphql"
|
|
20610
|
+
]
|
|
20611
|
+
}
|
|
20612
|
+
];
|
|
20613
|
+
|
|
20614
|
+
// src/language-handlebars/languages.evaluate.js
|
|
20615
|
+
var languages_evaluate_default3 = [
|
|
20616
|
+
{
|
|
20617
|
+
"linguistLanguageId": 155,
|
|
20618
|
+
"name": "Handlebars",
|
|
20619
|
+
"type": "markup",
|
|
20620
|
+
"color": "#f7931e",
|
|
20621
|
+
"aliases": [
|
|
20622
|
+
"hbs",
|
|
20623
|
+
"htmlbars"
|
|
20624
|
+
],
|
|
20625
|
+
"extensions": [
|
|
20626
|
+
".handlebars",
|
|
20627
|
+
".hbs"
|
|
20628
|
+
],
|
|
20629
|
+
"tmScope": "text.html.handlebars",
|
|
20630
|
+
"aceMode": "handlebars",
|
|
20631
|
+
"parsers": [
|
|
20632
|
+
"glimmer"
|
|
20633
|
+
],
|
|
20634
|
+
"vscodeLanguageIds": [
|
|
20635
|
+
"handlebars"
|
|
20636
|
+
]
|
|
20637
|
+
}
|
|
20638
|
+
];
|
|
20639
|
+
|
|
20640
|
+
// src/language-html/options.js
|
|
20641
|
+
var CATEGORY_HTML = "HTML";
|
|
20642
|
+
var options3 = {
|
|
20643
|
+
bracketSameLine: common_options_evaluate_default.bracketSameLine,
|
|
20644
|
+
htmlWhitespaceSensitivity: {
|
|
20645
|
+
category: CATEGORY_HTML,
|
|
20646
|
+
type: "choice",
|
|
20647
|
+
default: "css",
|
|
20648
|
+
description: "How to handle whitespaces in HTML.",
|
|
20649
|
+
choices: [
|
|
20650
|
+
{
|
|
20651
|
+
value: "css",
|
|
20652
|
+
description: "Respect the default value of CSS display property."
|
|
20653
|
+
},
|
|
20654
|
+
{
|
|
20655
|
+
value: "strict",
|
|
20656
|
+
description: "Whitespaces are considered sensitive."
|
|
20657
|
+
},
|
|
20658
|
+
{
|
|
20659
|
+
value: "ignore",
|
|
20660
|
+
description: "Whitespaces are considered insensitive."
|
|
20661
|
+
}
|
|
20662
|
+
]
|
|
20663
|
+
},
|
|
20664
|
+
singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine,
|
|
20665
|
+
vueIndentScriptAndStyle: {
|
|
20666
|
+
category: CATEGORY_HTML,
|
|
20667
|
+
type: "boolean",
|
|
20668
|
+
default: false,
|
|
20669
|
+
description: "Indent script and style tags in Vue files."
|
|
20670
|
+
}
|
|
20671
|
+
};
|
|
20672
|
+
var options_default3 = options3;
|
|
20673
|
+
|
|
20674
|
+
// src/language-html/languages.evaluate.js
|
|
20675
|
+
var languages_evaluate_default4 = [
|
|
20676
|
+
{
|
|
20677
|
+
"linguistLanguageId": 146,
|
|
20678
|
+
"name": "Angular",
|
|
20679
|
+
"type": "markup",
|
|
20680
|
+
"tmScope": "text.html.basic",
|
|
20681
|
+
"aceMode": "html",
|
|
20682
|
+
"codemirrorMode": "htmlmixed",
|
|
20683
|
+
"codemirrorMimeType": "text/html",
|
|
20684
|
+
"color": "#e34c26",
|
|
20685
|
+
"aliases": [
|
|
20686
|
+
"xhtml"
|
|
20687
|
+
],
|
|
20688
|
+
"extensions": [
|
|
20689
|
+
".component.html"
|
|
20690
|
+
],
|
|
20691
|
+
"parsers": [
|
|
20692
|
+
"angular"
|
|
20693
|
+
],
|
|
20694
|
+
"vscodeLanguageIds": [
|
|
20695
|
+
"html"
|
|
20696
|
+
],
|
|
20697
|
+
"filenames": []
|
|
20698
|
+
},
|
|
20699
|
+
{
|
|
20700
|
+
"linguistLanguageId": 146,
|
|
20701
|
+
"name": "HTML",
|
|
20702
|
+
"type": "markup",
|
|
20703
|
+
"tmScope": "text.html.basic",
|
|
20704
|
+
"aceMode": "html",
|
|
20705
|
+
"codemirrorMode": "htmlmixed",
|
|
20706
|
+
"codemirrorMimeType": "text/html",
|
|
20707
|
+
"color": "#e34c26",
|
|
20708
|
+
"aliases": [
|
|
20709
|
+
"xhtml"
|
|
20710
|
+
],
|
|
20711
|
+
"extensions": [
|
|
20712
|
+
".html",
|
|
20713
|
+
".hta",
|
|
20714
|
+
".htm",
|
|
20715
|
+
".html.hl",
|
|
20716
|
+
".inc",
|
|
20717
|
+
".xht",
|
|
20718
|
+
".xhtml",
|
|
20719
|
+
".mjml"
|
|
20720
|
+
],
|
|
20721
|
+
"parsers": [
|
|
20722
|
+
"html"
|
|
20723
|
+
],
|
|
20724
|
+
"vscodeLanguageIds": [
|
|
20725
|
+
"html"
|
|
20726
|
+
]
|
|
20727
|
+
},
|
|
20728
|
+
{
|
|
20729
|
+
"linguistLanguageId": 146,
|
|
20730
|
+
"name": "Lightning Web Components",
|
|
20731
|
+
"type": "markup",
|
|
20732
|
+
"tmScope": "text.html.basic",
|
|
20733
|
+
"aceMode": "html",
|
|
20734
|
+
"codemirrorMode": "htmlmixed",
|
|
20735
|
+
"codemirrorMimeType": "text/html",
|
|
20736
|
+
"color": "#e34c26",
|
|
20737
|
+
"aliases": [
|
|
20738
|
+
"xhtml"
|
|
20739
|
+
],
|
|
20740
|
+
"extensions": [],
|
|
20741
|
+
"parsers": [
|
|
20742
|
+
"lwc"
|
|
20743
|
+
],
|
|
20744
|
+
"vscodeLanguageIds": [
|
|
20745
|
+
"html"
|
|
20746
|
+
],
|
|
20747
|
+
"filenames": []
|
|
20748
|
+
},
|
|
20749
|
+
{
|
|
20750
|
+
"linguistLanguageId": 391,
|
|
20751
|
+
"name": "Vue",
|
|
20752
|
+
"type": "markup",
|
|
20753
|
+
"color": "#41b883",
|
|
20754
|
+
"extensions": [
|
|
20755
|
+
".vue"
|
|
20756
|
+
],
|
|
20757
|
+
"tmScope": "text.html.vue",
|
|
20758
|
+
"aceMode": "html",
|
|
20759
|
+
"parsers": [
|
|
20760
|
+
"vue"
|
|
20761
|
+
],
|
|
20762
|
+
"vscodeLanguageIds": [
|
|
20763
|
+
"vue"
|
|
20764
|
+
]
|
|
20765
|
+
}
|
|
20766
|
+
];
|
|
20767
|
+
|
|
20768
|
+
// src/language-js/options.js
|
|
20769
|
+
var CATEGORY_JAVASCRIPT = "JavaScript";
|
|
20770
|
+
var options4 = {
|
|
20771
|
+
arrowParens: {
|
|
20772
|
+
category: CATEGORY_JAVASCRIPT,
|
|
20773
|
+
type: "choice",
|
|
20774
|
+
default: "always",
|
|
20775
|
+
description: "Include parentheses around a sole arrow function parameter.",
|
|
20776
|
+
choices: [
|
|
20777
|
+
{
|
|
20778
|
+
value: "always",
|
|
20779
|
+
description: "Always include parens. Example: `(x) => x`"
|
|
20780
|
+
},
|
|
20781
|
+
{
|
|
20782
|
+
value: "avoid",
|
|
20783
|
+
description: "Omit parens when possible. Example: `x => x`"
|
|
20784
|
+
}
|
|
20785
|
+
]
|
|
20786
|
+
},
|
|
20787
|
+
bracketSameLine: common_options_evaluate_default.bracketSameLine,
|
|
20788
|
+
bracketSpacing: common_options_evaluate_default.bracketSpacing,
|
|
20789
|
+
jsxBracketSameLine: {
|
|
20790
|
+
category: CATEGORY_JAVASCRIPT,
|
|
20791
|
+
type: "boolean",
|
|
20792
|
+
description: "Put > on the last line instead of at a new line.",
|
|
20793
|
+
deprecated: "2.4.0"
|
|
20794
|
+
},
|
|
20795
|
+
semi: {
|
|
20796
|
+
category: CATEGORY_JAVASCRIPT,
|
|
20797
|
+
type: "boolean",
|
|
20798
|
+
default: true,
|
|
20799
|
+
description: "Print semicolons.",
|
|
20800
|
+
oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them."
|
|
20801
|
+
},
|
|
20802
|
+
singleQuote: common_options_evaluate_default.singleQuote,
|
|
20803
|
+
jsxSingleQuote: {
|
|
20804
|
+
category: CATEGORY_JAVASCRIPT,
|
|
20805
|
+
type: "boolean",
|
|
20806
|
+
default: false,
|
|
20807
|
+
description: "Use single quotes in JSX."
|
|
20808
|
+
},
|
|
20809
|
+
quoteProps: {
|
|
20810
|
+
category: CATEGORY_JAVASCRIPT,
|
|
20811
|
+
type: "choice",
|
|
20812
|
+
default: "as-needed",
|
|
20813
|
+
description: "Change when properties in objects are quoted.",
|
|
20814
|
+
choices: [
|
|
20815
|
+
{
|
|
20816
|
+
value: "as-needed",
|
|
20817
|
+
description: "Only add quotes around object properties where required."
|
|
20818
|
+
},
|
|
20819
|
+
{
|
|
20820
|
+
value: "consistent",
|
|
20821
|
+
description: "If at least one property in an object requires quotes, quote all properties."
|
|
20822
|
+
},
|
|
20823
|
+
{
|
|
20824
|
+
value: "preserve",
|
|
20825
|
+
description: "Respect the input use of quotes in object properties."
|
|
20826
|
+
}
|
|
20827
|
+
]
|
|
20828
|
+
},
|
|
20829
|
+
trailingComma: {
|
|
20830
|
+
category: CATEGORY_JAVASCRIPT,
|
|
20831
|
+
type: "choice",
|
|
20832
|
+
default: "all",
|
|
20833
|
+
description: "Print trailing commas wherever possible when multi-line.",
|
|
20834
|
+
choices: [
|
|
20835
|
+
{
|
|
20836
|
+
value: "all",
|
|
20837
|
+
description: "Trailing commas wherever possible (including function arguments)."
|
|
20838
|
+
},
|
|
20839
|
+
{
|
|
20840
|
+
value: "es5",
|
|
20841
|
+
description: "Trailing commas where valid in ES5 (objects, arrays, etc.)"
|
|
20842
|
+
},
|
|
20843
|
+
{ value: "none", description: "No trailing commas." }
|
|
20844
|
+
]
|
|
20845
|
+
},
|
|
20846
|
+
singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine
|
|
20847
|
+
};
|
|
20848
|
+
var options_default4 = options4;
|
|
20849
|
+
|
|
20850
|
+
// src/language-js/languages.evaluate.js
|
|
20851
|
+
var languages_evaluate_default5 = [
|
|
20852
|
+
{
|
|
20853
|
+
"linguistLanguageId": 183,
|
|
20854
|
+
"name": "JavaScript",
|
|
20855
|
+
"type": "programming",
|
|
20856
|
+
"tmScope": "source.js",
|
|
20857
|
+
"aceMode": "javascript",
|
|
20858
|
+
"codemirrorMode": "javascript",
|
|
20859
|
+
"codemirrorMimeType": "text/javascript",
|
|
20860
|
+
"color": "#f1e05a",
|
|
20861
|
+
"aliases": [
|
|
20862
|
+
"js",
|
|
20863
|
+
"node"
|
|
20864
|
+
],
|
|
20865
|
+
"extensions": [
|
|
20866
|
+
".js",
|
|
20867
|
+
"._js",
|
|
20868
|
+
".bones",
|
|
20869
|
+
".cjs",
|
|
20870
|
+
".es",
|
|
20871
|
+
".es6",
|
|
20872
|
+
".frag",
|
|
20873
|
+
".gs",
|
|
20874
|
+
".jake",
|
|
20875
|
+
".javascript",
|
|
20876
|
+
".jsb",
|
|
20877
|
+
".jscad",
|
|
20878
|
+
".jsfl",
|
|
20879
|
+
".jslib",
|
|
20880
|
+
".jsm",
|
|
20881
|
+
".jspre",
|
|
20882
|
+
".jss",
|
|
20883
|
+
".mjs",
|
|
20884
|
+
".njs",
|
|
20885
|
+
".pac",
|
|
20886
|
+
".sjs",
|
|
20887
|
+
".ssjs",
|
|
20888
|
+
".xsjs",
|
|
20889
|
+
".xsjslib",
|
|
20890
|
+
".wxs"
|
|
20891
|
+
],
|
|
20892
|
+
"filenames": [
|
|
20893
|
+
"Jakefile"
|
|
20894
|
+
],
|
|
20895
|
+
"interpreters": [
|
|
20896
|
+
"chakra",
|
|
20897
|
+
"d8",
|
|
20898
|
+
"gjs",
|
|
20899
|
+
"js",
|
|
20900
|
+
"node",
|
|
20901
|
+
"nodejs",
|
|
20902
|
+
"qjs",
|
|
20903
|
+
"rhino",
|
|
20904
|
+
"v8",
|
|
20905
|
+
"v8-shell",
|
|
20906
|
+
"zx"
|
|
20907
|
+
],
|
|
20908
|
+
"parsers": [
|
|
20909
|
+
"babel",
|
|
20910
|
+
"acorn",
|
|
20911
|
+
"espree",
|
|
20912
|
+
"meriyah",
|
|
20913
|
+
"babel-flow",
|
|
20914
|
+
"babel-ts",
|
|
20915
|
+
"flow",
|
|
20916
|
+
"typescript"
|
|
20917
|
+
],
|
|
20918
|
+
"vscodeLanguageIds": [
|
|
20919
|
+
"javascript",
|
|
20920
|
+
"mongo"
|
|
20921
|
+
]
|
|
20922
|
+
},
|
|
20923
|
+
{
|
|
20924
|
+
"linguistLanguageId": 183,
|
|
20925
|
+
"name": "Flow",
|
|
20926
|
+
"type": "programming",
|
|
20927
|
+
"tmScope": "source.js",
|
|
20928
|
+
"aceMode": "javascript",
|
|
20929
|
+
"codemirrorMode": "javascript",
|
|
20930
|
+
"codemirrorMimeType": "text/javascript",
|
|
20931
|
+
"color": "#f1e05a",
|
|
20932
|
+
"aliases": [],
|
|
20933
|
+
"extensions": [
|
|
20934
|
+
".js.flow"
|
|
20935
|
+
],
|
|
20936
|
+
"filenames": [],
|
|
20937
|
+
"interpreters": [
|
|
20938
|
+
"chakra",
|
|
20939
|
+
"d8",
|
|
20940
|
+
"gjs",
|
|
20941
|
+
"js",
|
|
20942
|
+
"node",
|
|
20943
|
+
"nodejs",
|
|
20944
|
+
"qjs",
|
|
20945
|
+
"rhino",
|
|
20946
|
+
"v8",
|
|
20947
|
+
"v8-shell"
|
|
20948
|
+
],
|
|
20949
|
+
"parsers": [
|
|
20950
|
+
"flow",
|
|
20951
|
+
"babel-flow"
|
|
20952
|
+
],
|
|
20953
|
+
"vscodeLanguageIds": [
|
|
20954
|
+
"javascript"
|
|
20955
|
+
]
|
|
20956
|
+
},
|
|
20957
|
+
{
|
|
20958
|
+
"linguistLanguageId": 183,
|
|
20959
|
+
"name": "JSX",
|
|
20960
|
+
"type": "programming",
|
|
20961
|
+
"tmScope": "source.js.jsx",
|
|
20962
|
+
"aceMode": "javascript",
|
|
20963
|
+
"codemirrorMode": "jsx",
|
|
20964
|
+
"codemirrorMimeType": "text/jsx",
|
|
20965
|
+
"color": void 0,
|
|
20966
|
+
"aliases": void 0,
|
|
20967
|
+
"extensions": [
|
|
20968
|
+
".jsx"
|
|
20969
|
+
],
|
|
20970
|
+
"filenames": void 0,
|
|
20971
|
+
"interpreters": void 0,
|
|
20972
|
+
"parsers": [
|
|
20973
|
+
"babel",
|
|
20974
|
+
"babel-flow",
|
|
20975
|
+
"babel-ts",
|
|
20976
|
+
"flow",
|
|
20977
|
+
"typescript",
|
|
20978
|
+
"espree",
|
|
20979
|
+
"meriyah"
|
|
20980
|
+
],
|
|
20981
|
+
"vscodeLanguageIds": [
|
|
20982
|
+
"javascriptreact"
|
|
20983
|
+
],
|
|
20984
|
+
"group": "JavaScript"
|
|
20985
|
+
},
|
|
20986
|
+
{
|
|
20987
|
+
"linguistLanguageId": 378,
|
|
20988
|
+
"name": "TypeScript",
|
|
20989
|
+
"type": "programming",
|
|
20990
|
+
"color": "#3178c6",
|
|
20991
|
+
"aliases": [
|
|
20992
|
+
"ts"
|
|
20993
|
+
],
|
|
20994
|
+
"interpreters": [
|
|
20995
|
+
"deno",
|
|
20996
|
+
"ts-node"
|
|
20997
|
+
],
|
|
20998
|
+
"extensions": [
|
|
20999
|
+
".ts",
|
|
21000
|
+
".cts",
|
|
21001
|
+
".mts"
|
|
21002
|
+
],
|
|
21003
|
+
"tmScope": "source.ts",
|
|
21004
|
+
"aceMode": "typescript",
|
|
21005
|
+
"codemirrorMode": "javascript",
|
|
21006
|
+
"codemirrorMimeType": "application/typescript",
|
|
21007
|
+
"parsers": [
|
|
21008
|
+
"typescript",
|
|
21009
|
+
"babel-ts"
|
|
21010
|
+
],
|
|
21011
|
+
"vscodeLanguageIds": [
|
|
21012
|
+
"typescript"
|
|
21013
|
+
]
|
|
21014
|
+
},
|
|
21015
|
+
{
|
|
21016
|
+
"linguistLanguageId": 94901924,
|
|
21017
|
+
"name": "TSX",
|
|
21018
|
+
"type": "programming",
|
|
21019
|
+
"color": "#3178c6",
|
|
21020
|
+
"group": "TypeScript",
|
|
21021
|
+
"extensions": [
|
|
21022
|
+
".tsx"
|
|
21023
|
+
],
|
|
21024
|
+
"tmScope": "source.tsx",
|
|
21025
|
+
"aceMode": "javascript",
|
|
21026
|
+
"codemirrorMode": "jsx",
|
|
21027
|
+
"codemirrorMimeType": "text/jsx",
|
|
21028
|
+
"parsers": [
|
|
21029
|
+
"typescript",
|
|
21030
|
+
"babel-ts"
|
|
21031
|
+
],
|
|
21032
|
+
"vscodeLanguageIds": [
|
|
21033
|
+
"typescriptreact"
|
|
21034
|
+
]
|
|
21035
|
+
}
|
|
21036
|
+
];
|
|
21037
|
+
|
|
21038
|
+
// src/language-json/languages.evaluate.js
|
|
21039
|
+
var languages_evaluate_default6 = [
|
|
21040
|
+
{
|
|
21041
|
+
"linguistLanguageId": 174,
|
|
21042
|
+
"name": "JSON.stringify",
|
|
21043
|
+
"type": "data",
|
|
21044
|
+
"color": "#292929",
|
|
21045
|
+
"tmScope": "source.json",
|
|
21046
|
+
"aceMode": "json",
|
|
21047
|
+
"codemirrorMode": "javascript",
|
|
21048
|
+
"codemirrorMimeType": "application/json",
|
|
21049
|
+
"aliases": [
|
|
21050
|
+
"geojson",
|
|
21051
|
+
"jsonl",
|
|
21052
|
+
"topojson"
|
|
21053
|
+
],
|
|
21054
|
+
"extensions": [
|
|
21055
|
+
".importmap"
|
|
21056
|
+
],
|
|
21057
|
+
"filenames": [
|
|
21058
|
+
"package.json",
|
|
21059
|
+
"package-lock.json",
|
|
21060
|
+
"composer.json"
|
|
21061
|
+
],
|
|
21062
|
+
"parsers": [
|
|
21063
|
+
"json-stringify"
|
|
21064
|
+
],
|
|
21065
|
+
"vscodeLanguageIds": [
|
|
21066
|
+
"json"
|
|
21067
|
+
]
|
|
21068
|
+
},
|
|
21069
|
+
{
|
|
21070
|
+
"linguistLanguageId": 174,
|
|
21071
|
+
"name": "JSON",
|
|
21072
|
+
"type": "data",
|
|
21073
|
+
"color": "#292929",
|
|
21074
|
+
"tmScope": "source.json",
|
|
21075
|
+
"aceMode": "json",
|
|
21076
|
+
"codemirrorMode": "javascript",
|
|
21077
|
+
"codemirrorMimeType": "application/json",
|
|
21078
|
+
"aliases": [
|
|
21079
|
+
"geojson",
|
|
21080
|
+
"jsonl",
|
|
21081
|
+
"topojson"
|
|
21082
|
+
],
|
|
21083
|
+
"extensions": [
|
|
21084
|
+
".json",
|
|
21085
|
+
".4DForm",
|
|
21086
|
+
".4DProject",
|
|
21087
|
+
".avsc",
|
|
21088
|
+
".geojson",
|
|
21089
|
+
".gltf",
|
|
21090
|
+
".har",
|
|
21091
|
+
".ice",
|
|
21092
|
+
".JSON-tmLanguage",
|
|
21093
|
+
".mcmeta",
|
|
21094
|
+
".tfstate",
|
|
21095
|
+
".tfstate.backup",
|
|
21096
|
+
".topojson",
|
|
21097
|
+
".webapp",
|
|
21098
|
+
".webmanifest",
|
|
21099
|
+
".yy",
|
|
21100
|
+
".yyp"
|
|
21101
|
+
],
|
|
21102
|
+
"filenames": [
|
|
21103
|
+
".arcconfig",
|
|
21104
|
+
".auto-changelog",
|
|
21105
|
+
".c8rc",
|
|
21106
|
+
".htmlhintrc",
|
|
21107
|
+
".imgbotconfig",
|
|
21108
|
+
".nycrc",
|
|
21109
|
+
".tern-config",
|
|
21110
|
+
".tern-project",
|
|
21111
|
+
".watchmanconfig",
|
|
21112
|
+
"Pipfile.lock",
|
|
21113
|
+
"composer.lock",
|
|
21114
|
+
"mcmod.info"
|
|
21115
|
+
],
|
|
21116
|
+
"parsers": [
|
|
21117
|
+
"json"
|
|
21118
|
+
],
|
|
21119
|
+
"vscodeLanguageIds": [
|
|
21120
|
+
"json"
|
|
21121
|
+
]
|
|
21122
|
+
},
|
|
21123
|
+
{
|
|
21124
|
+
"linguistLanguageId": 423,
|
|
21125
|
+
"name": "JSON with Comments",
|
|
21126
|
+
"type": "data",
|
|
21127
|
+
"color": "#292929",
|
|
21128
|
+
"group": "JSON",
|
|
21129
|
+
"tmScope": "source.js",
|
|
21130
|
+
"aceMode": "javascript",
|
|
21131
|
+
"codemirrorMode": "javascript",
|
|
21132
|
+
"codemirrorMimeType": "text/javascript",
|
|
21133
|
+
"aliases": [
|
|
21134
|
+
"jsonc"
|
|
21135
|
+
],
|
|
21136
|
+
"extensions": [
|
|
21137
|
+
".jsonc",
|
|
21138
|
+
".code-snippets",
|
|
21139
|
+
".sublime-build",
|
|
21140
|
+
".sublime-commands",
|
|
21141
|
+
".sublime-completions",
|
|
21142
|
+
".sublime-keymap",
|
|
21143
|
+
".sublime-macro",
|
|
21144
|
+
".sublime-menu",
|
|
21145
|
+
".sublime-mousemap",
|
|
21146
|
+
".sublime-project",
|
|
21147
|
+
".sublime-settings",
|
|
21148
|
+
".sublime-theme",
|
|
21149
|
+
".sublime-workspace",
|
|
21150
|
+
".sublime_metrics",
|
|
21151
|
+
".sublime_session"
|
|
21152
|
+
],
|
|
21153
|
+
"filenames": [
|
|
21154
|
+
".babelrc",
|
|
21155
|
+
".devcontainer.json",
|
|
21156
|
+
".eslintrc.json",
|
|
21157
|
+
".jscsrc",
|
|
21158
|
+
".jshintrc",
|
|
21159
|
+
".jslintrc",
|
|
21160
|
+
"api-extractor.json",
|
|
21161
|
+
"devcontainer.json",
|
|
21162
|
+
"jsconfig.json",
|
|
21163
|
+
"language-configuration.json",
|
|
21164
|
+
"tsconfig.json",
|
|
21165
|
+
"tslint.json",
|
|
21166
|
+
".eslintrc",
|
|
21167
|
+
".swcrc"
|
|
21168
|
+
],
|
|
21169
|
+
"parsers": [
|
|
21170
|
+
"json"
|
|
21171
|
+
],
|
|
21172
|
+
"vscodeLanguageIds": [
|
|
21173
|
+
"jsonc"
|
|
21174
|
+
]
|
|
21175
|
+
},
|
|
21176
|
+
{
|
|
21177
|
+
"linguistLanguageId": 175,
|
|
21178
|
+
"name": "JSON5",
|
|
21179
|
+
"type": "data",
|
|
21180
|
+
"color": "#267CB9",
|
|
21181
|
+
"extensions": [
|
|
21182
|
+
".json5"
|
|
21183
|
+
],
|
|
21184
|
+
"tmScope": "source.js",
|
|
21185
|
+
"aceMode": "javascript",
|
|
21186
|
+
"codemirrorMode": "javascript",
|
|
21187
|
+
"codemirrorMimeType": "application/json",
|
|
21188
|
+
"parsers": [
|
|
21189
|
+
"json5"
|
|
21190
|
+
],
|
|
21191
|
+
"vscodeLanguageIds": [
|
|
21192
|
+
"json5"
|
|
21193
|
+
]
|
|
21194
|
+
}
|
|
21195
|
+
];
|
|
21196
|
+
|
|
21197
|
+
// src/language-markdown/options.js
|
|
21198
|
+
var options5 = {
|
|
21199
|
+
proseWrap: common_options_evaluate_default.proseWrap,
|
|
21200
|
+
singleQuote: common_options_evaluate_default.singleQuote
|
|
21201
|
+
};
|
|
21202
|
+
var options_default5 = options5;
|
|
21203
|
+
|
|
21204
|
+
// src/language-markdown/languages.evaluate.js
|
|
21205
|
+
var languages_evaluate_default7 = [
|
|
21206
|
+
{
|
|
21207
|
+
"linguistLanguageId": 222,
|
|
21208
|
+
"name": "Markdown",
|
|
21209
|
+
"type": "prose",
|
|
21210
|
+
"color": "#083fa1",
|
|
21211
|
+
"aliases": [
|
|
21212
|
+
"pandoc"
|
|
21213
|
+
],
|
|
21214
|
+
"aceMode": "markdown",
|
|
21215
|
+
"codemirrorMode": "gfm",
|
|
21216
|
+
"codemirrorMimeType": "text/x-gfm",
|
|
21217
|
+
"wrap": true,
|
|
21218
|
+
"extensions": [
|
|
21219
|
+
".md",
|
|
21220
|
+
".livemd",
|
|
21221
|
+
".markdown",
|
|
21222
|
+
".mdown",
|
|
21223
|
+
".mdwn",
|
|
21224
|
+
".mkd",
|
|
21225
|
+
".mkdn",
|
|
21226
|
+
".mkdown",
|
|
21227
|
+
".ronn",
|
|
21228
|
+
".scd",
|
|
21229
|
+
".workbook"
|
|
21230
|
+
],
|
|
21231
|
+
"filenames": [
|
|
21232
|
+
"contents.lr",
|
|
21233
|
+
"README"
|
|
21234
|
+
],
|
|
21235
|
+
"tmScope": "source.gfm",
|
|
21236
|
+
"parsers": [
|
|
21237
|
+
"markdown"
|
|
21238
|
+
],
|
|
21239
|
+
"vscodeLanguageIds": [
|
|
21240
|
+
"markdown"
|
|
21241
|
+
]
|
|
21242
|
+
},
|
|
21243
|
+
{
|
|
21244
|
+
"linguistLanguageId": 222,
|
|
21245
|
+
"name": "MDX",
|
|
21246
|
+
"type": "prose",
|
|
21247
|
+
"color": "#083fa1",
|
|
21248
|
+
"aliases": [
|
|
21249
|
+
"pandoc"
|
|
21250
|
+
],
|
|
21251
|
+
"aceMode": "markdown",
|
|
21252
|
+
"codemirrorMode": "gfm",
|
|
21253
|
+
"codemirrorMimeType": "text/x-gfm",
|
|
21254
|
+
"wrap": true,
|
|
21255
|
+
"extensions": [
|
|
21256
|
+
".mdx"
|
|
21257
|
+
],
|
|
21258
|
+
"filenames": [],
|
|
21259
|
+
"tmScope": "source.gfm",
|
|
21260
|
+
"parsers": [
|
|
21261
|
+
"mdx"
|
|
21262
|
+
],
|
|
21263
|
+
"vscodeLanguageIds": [
|
|
21264
|
+
"mdx"
|
|
21265
|
+
]
|
|
21266
|
+
}
|
|
21267
|
+
];
|
|
21268
|
+
|
|
21269
|
+
// src/language-yaml/options.js
|
|
21270
|
+
var options6 = {
|
|
21271
|
+
bracketSpacing: common_options_evaluate_default.bracketSpacing,
|
|
21272
|
+
singleQuote: common_options_evaluate_default.singleQuote,
|
|
21273
|
+
proseWrap: common_options_evaluate_default.proseWrap
|
|
21274
|
+
};
|
|
21275
|
+
var options_default6 = options6;
|
|
21276
|
+
|
|
21277
|
+
// src/language-yaml/languages.evaluate.js
|
|
21278
|
+
var languages_evaluate_default8 = [
|
|
21279
|
+
{
|
|
21280
|
+
"linguistLanguageId": 407,
|
|
21281
|
+
"name": "YAML",
|
|
21282
|
+
"type": "data",
|
|
21283
|
+
"color": "#cb171e",
|
|
21284
|
+
"tmScope": "source.yaml",
|
|
21285
|
+
"aliases": [
|
|
21286
|
+
"yml"
|
|
21287
|
+
],
|
|
21288
|
+
"extensions": [
|
|
21289
|
+
".yml",
|
|
21290
|
+
".mir",
|
|
21291
|
+
".reek",
|
|
21292
|
+
".rviz",
|
|
21293
|
+
".sublime-syntax",
|
|
21294
|
+
".syntax",
|
|
21295
|
+
".yaml",
|
|
21296
|
+
".yaml-tmlanguage",
|
|
21297
|
+
".yaml.sed",
|
|
21298
|
+
".yml.mysql"
|
|
21299
|
+
],
|
|
21300
|
+
"filenames": [
|
|
21301
|
+
".clang-format",
|
|
21302
|
+
".clang-tidy",
|
|
21303
|
+
".gemrc",
|
|
21304
|
+
"CITATION.cff",
|
|
21305
|
+
"glide.lock",
|
|
21306
|
+
".prettierrc",
|
|
21307
|
+
".stylelintrc",
|
|
21308
|
+
".lintstagedrc"
|
|
21309
|
+
],
|
|
21310
|
+
"aceMode": "yaml",
|
|
21311
|
+
"codemirrorMode": "yaml",
|
|
21312
|
+
"codemirrorMimeType": "text/x-yaml",
|
|
21313
|
+
"parsers": [
|
|
21314
|
+
"yaml"
|
|
21315
|
+
],
|
|
21316
|
+
"vscodeLanguageIds": [
|
|
21317
|
+
"yaml",
|
|
21318
|
+
"ansible",
|
|
21319
|
+
"home-assistant"
|
|
21320
|
+
]
|
|
21321
|
+
}
|
|
21322
|
+
];
|
|
21323
|
+
|
|
21324
|
+
// src/plugins/builtin-plugins-proxy.js
|
|
21325
|
+
function createParsersAndParsers(modules) {
|
|
21326
|
+
const parsers2 = /* @__PURE__ */ Object.create(null);
|
|
21327
|
+
const printers2 = /* @__PURE__ */ Object.create(null);
|
|
21328
|
+
for (const {
|
|
21329
|
+
importPlugin: importPlugin2,
|
|
21330
|
+
parsers: parserNames = [],
|
|
21331
|
+
printers: printerNames = []
|
|
21332
|
+
} of modules) {
|
|
21333
|
+
const loadPlugin2 = async () => {
|
|
21334
|
+
const plugin = await importPlugin2();
|
|
21335
|
+
Object.assign(parsers2, plugin.parsers);
|
|
21336
|
+
Object.assign(printers2, plugin.printers);
|
|
21337
|
+
return plugin;
|
|
21338
|
+
};
|
|
21339
|
+
for (const parserName of parserNames) {
|
|
21340
|
+
parsers2[parserName] = async () => (await loadPlugin2()).parsers[parserName];
|
|
21341
|
+
}
|
|
21342
|
+
for (const printerName of printerNames) {
|
|
21343
|
+
printers2[printerName] = async () => (await loadPlugin2()).printers[printerName];
|
|
21344
|
+
}
|
|
21345
|
+
}
|
|
21346
|
+
return { parsers: parsers2, printers: printers2 };
|
|
21347
|
+
}
|
|
21348
|
+
var options7 = {
|
|
21349
|
+
...options_default,
|
|
21350
|
+
...options_default2,
|
|
21351
|
+
...options_default3,
|
|
21352
|
+
...options_default4,
|
|
21353
|
+
...options_default5,
|
|
21354
|
+
...options_default6
|
|
21355
|
+
};
|
|
21356
|
+
var languages = [
|
|
21357
|
+
...languages_evaluate_default,
|
|
21358
|
+
...languages_evaluate_default2,
|
|
21359
|
+
...languages_evaluate_default3,
|
|
21360
|
+
...languages_evaluate_default4,
|
|
21361
|
+
...languages_evaluate_default5,
|
|
21362
|
+
...languages_evaluate_default6,
|
|
21363
|
+
...languages_evaluate_default7,
|
|
21364
|
+
...languages_evaluate_default8
|
|
21365
|
+
];
|
|
21366
|
+
var { parsers, printers } = createParsersAndParsers([
|
|
21367
|
+
{
|
|
21368
|
+
importPlugin: () => import("./plugins/acorn.mjs"),
|
|
21369
|
+
parsers: ["acorn", "espree"]
|
|
21370
|
+
},
|
|
21371
|
+
{
|
|
21372
|
+
importPlugin: () => import("./plugins/angular.mjs"),
|
|
21373
|
+
parsers: [
|
|
21374
|
+
"__ng_action",
|
|
21375
|
+
"__ng_binding",
|
|
21376
|
+
"__ng_interpolation",
|
|
21377
|
+
"__ng_directive"
|
|
21378
|
+
]
|
|
21379
|
+
},
|
|
21380
|
+
{
|
|
21381
|
+
importPlugin: () => import("./plugins/babel.mjs"),
|
|
21382
|
+
parsers: [
|
|
21383
|
+
"babel",
|
|
21384
|
+
"babel-flow",
|
|
21385
|
+
"babel-ts",
|
|
21386
|
+
"__js_expression",
|
|
21387
|
+
"__ts_expression",
|
|
21388
|
+
"__vue_expression",
|
|
21389
|
+
"__vue_ts_expression",
|
|
21390
|
+
"__vue_event_binding",
|
|
21391
|
+
"__vue_ts_event_binding",
|
|
21392
|
+
"__babel_estree",
|
|
21393
|
+
"json",
|
|
21394
|
+
"json5",
|
|
21395
|
+
"json-stringify"
|
|
21396
|
+
]
|
|
21397
|
+
},
|
|
21398
|
+
{
|
|
21399
|
+
importPlugin: () => import("./plugins/estree.mjs"),
|
|
21400
|
+
printers: ["estree", "estree-json"]
|
|
21401
|
+
},
|
|
21402
|
+
{
|
|
21403
|
+
importPlugin: () => import("./plugins/flow.mjs"),
|
|
21404
|
+
parsers: ["flow"]
|
|
21405
|
+
},
|
|
21406
|
+
{
|
|
21407
|
+
importPlugin: () => import("./plugins/glimmer.mjs"),
|
|
21408
|
+
parsers: ["glimmer"],
|
|
21409
|
+
printers: ["glimmer"]
|
|
21410
|
+
},
|
|
21411
|
+
{
|
|
21412
|
+
importPlugin: () => import("./plugins/graphql.mjs"),
|
|
21413
|
+
parsers: ["graphql"],
|
|
21414
|
+
printers: ["graphql"]
|
|
21415
|
+
},
|
|
21416
|
+
{
|
|
21417
|
+
importPlugin: () => import("./plugins/html.mjs"),
|
|
21418
|
+
parsers: ["html", "angular", "vue", "lwc"],
|
|
21419
|
+
printers: ["html"]
|
|
21420
|
+
},
|
|
21421
|
+
{
|
|
21422
|
+
importPlugin: () => import("./plugins/markdown.mjs"),
|
|
21423
|
+
parsers: ["markdown", "mdx", "remark"],
|
|
21424
|
+
printers: ["mdast"]
|
|
21425
|
+
},
|
|
21426
|
+
{
|
|
21427
|
+
importPlugin: () => import("./plugins/meriyah.mjs"),
|
|
21428
|
+
parsers: ["meriyah"]
|
|
21429
|
+
},
|
|
21430
|
+
{
|
|
21431
|
+
importPlugin: () => import("./plugins/postcss.mjs"),
|
|
21432
|
+
parsers: ["css", "less", "scss"],
|
|
21433
|
+
printers: ["postcss"]
|
|
21434
|
+
},
|
|
21435
|
+
{
|
|
21436
|
+
importPlugin: () => import("./plugins/typescript.mjs"),
|
|
21437
|
+
parsers: ["typescript"]
|
|
21438
|
+
},
|
|
21439
|
+
{
|
|
21440
|
+
importPlugin: () => import("./plugins/yaml.mjs"),
|
|
21441
|
+
parsers: ["yaml"],
|
|
21442
|
+
printers: ["yaml"]
|
|
21443
|
+
}
|
|
21444
|
+
]);
|
|
21445
|
+
|
|
20433
21446
|
// src/main/plugins/load-builtin-plugins.js
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
builtinPlugins ?? (builtinPlugins = await Promise.all([
|
|
20437
|
-
import("./plugins/estree.mjs"),
|
|
20438
|
-
import("./plugins/babel.mjs"),
|
|
20439
|
-
import("./plugins/flow.mjs"),
|
|
20440
|
-
import("./plugins/typescript.mjs"),
|
|
20441
|
-
import("./plugins/acorn.mjs"),
|
|
20442
|
-
import("./plugins/meriyah.mjs"),
|
|
20443
|
-
import("./plugins/angular.mjs"),
|
|
20444
|
-
import("./plugins/postcss.mjs"),
|
|
20445
|
-
import("./plugins/graphql.mjs"),
|
|
20446
|
-
import("./plugins/markdown.mjs"),
|
|
20447
|
-
import("./plugins/glimmer.mjs"),
|
|
20448
|
-
import("./plugins/html.mjs"),
|
|
20449
|
-
import("./plugins/yaml.mjs")
|
|
20450
|
-
]));
|
|
20451
|
-
return builtinPlugins;
|
|
21447
|
+
function loadBuiltinPlugins() {
|
|
21448
|
+
return [builtin_plugins_proxy_exports];
|
|
20452
21449
|
}
|
|
20453
21450
|
var load_builtin_plugins_default = loadBuiltinPlugins;
|
|
20454
21451
|
|
|
@@ -20629,11 +21626,11 @@ function hasNewlineInRange(text, startIndex, endIndex) {
|
|
|
20629
21626
|
var has_newline_in_range_default = hasNewlineInRange;
|
|
20630
21627
|
|
|
20631
21628
|
// src/utils/has-spaces.js
|
|
20632
|
-
function hasSpaces(text, startIndex,
|
|
21629
|
+
function hasSpaces(text, startIndex, options8 = {}) {
|
|
20633
21630
|
const idx = skipSpaces(
|
|
20634
21631
|
text,
|
|
20635
|
-
|
|
20636
|
-
|
|
21632
|
+
options8.backwards ? startIndex - 1 : startIndex,
|
|
21633
|
+
options8
|
|
20637
21634
|
);
|
|
20638
21635
|
return idx !== startIndex;
|
|
20639
21636
|
}
|
|
@@ -20711,35 +21708,35 @@ function isNextLineEmpty2(text, startIndex) {
|
|
|
20711
21708
|
import * as doc from "./doc.mjs";
|
|
20712
21709
|
|
|
20713
21710
|
// src/main/version.evaluate.cjs
|
|
20714
|
-
var version_evaluate_default = "3.0.0-alpha.
|
|
21711
|
+
var version_evaluate_default = "3.0.0-alpha.11";
|
|
20715
21712
|
|
|
20716
21713
|
// src/index.js
|
|
20717
21714
|
function withPlugins(fn, optionsArgumentIndex = 1) {
|
|
20718
21715
|
return async (...args) => {
|
|
20719
|
-
const
|
|
20720
|
-
const { plugins = [], pluginSearchDirs } =
|
|
21716
|
+
const options8 = args[optionsArgumentIndex] ?? {};
|
|
21717
|
+
const { plugins = [], pluginSearchDirs } = options8;
|
|
20721
21718
|
args[optionsArgumentIndex] = {
|
|
20722
|
-
...
|
|
21719
|
+
...options8,
|
|
20723
21720
|
plugins: (await Promise.all([
|
|
20724
21721
|
load_builtin_plugins_default(),
|
|
20725
21722
|
// TODO: standalone version allow `plugins` to be `prettierPlugins` which is an object, should allow that too
|
|
20726
21723
|
load_plugins_default(plugins),
|
|
20727
|
-
|
|
21724
|
+
options8.pluginSearchDirs === false ? [] : searchPlugins(pluginSearchDirs)
|
|
20728
21725
|
])).flat()
|
|
20729
21726
|
};
|
|
20730
21727
|
return fn(...args);
|
|
20731
21728
|
};
|
|
20732
21729
|
}
|
|
20733
21730
|
var formatWithCursor2 = withPlugins(formatWithCursor);
|
|
20734
|
-
async function format2(text,
|
|
21731
|
+
async function format2(text, options8) {
|
|
20735
21732
|
const { formatted } = await formatWithCursor2(text, {
|
|
20736
|
-
...
|
|
21733
|
+
...options8,
|
|
20737
21734
|
cursorOffset: -1
|
|
20738
21735
|
});
|
|
20739
21736
|
return formatted;
|
|
20740
21737
|
}
|
|
20741
|
-
async function check(text,
|
|
20742
|
-
return await format2(text,
|
|
21738
|
+
async function check(text, options8) {
|
|
21739
|
+
return await format2(text, options8) === text;
|
|
20743
21740
|
}
|
|
20744
21741
|
async function clearCache5() {
|
|
20745
21742
|
clearCache();
|