@html-validate/eslint-config 5.4.19 → 5.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4942 -5
- package/dist/cli.js.map +4 -4
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -7621,6 +7621,4907 @@ var require_precompiled_loader = __commonJS({
|
|
|
7621
7621
|
}
|
|
7622
7622
|
});
|
|
7623
7623
|
|
|
7624
|
+
// ../../node_modules/picomatch/lib/constants.js
|
|
7625
|
+
var require_constants = __commonJS({
|
|
7626
|
+
"../../node_modules/picomatch/lib/constants.js"(exports, module2) {
|
|
7627
|
+
"use strict";
|
|
7628
|
+
var path3 = require("path");
|
|
7629
|
+
var WIN_SLASH = "\\\\/";
|
|
7630
|
+
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
7631
|
+
var DOT_LITERAL = "\\.";
|
|
7632
|
+
var PLUS_LITERAL = "\\+";
|
|
7633
|
+
var QMARK_LITERAL = "\\?";
|
|
7634
|
+
var SLASH_LITERAL = "\\/";
|
|
7635
|
+
var ONE_CHAR = "(?=.)";
|
|
7636
|
+
var QMARK = "[^/]";
|
|
7637
|
+
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
7638
|
+
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
7639
|
+
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
7640
|
+
var NO_DOT = `(?!${DOT_LITERAL})`;
|
|
7641
|
+
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
7642
|
+
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
7643
|
+
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
7644
|
+
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
7645
|
+
var STAR = `${QMARK}*?`;
|
|
7646
|
+
var POSIX_CHARS = {
|
|
7647
|
+
DOT_LITERAL,
|
|
7648
|
+
PLUS_LITERAL,
|
|
7649
|
+
QMARK_LITERAL,
|
|
7650
|
+
SLASH_LITERAL,
|
|
7651
|
+
ONE_CHAR,
|
|
7652
|
+
QMARK,
|
|
7653
|
+
END_ANCHOR,
|
|
7654
|
+
DOTS_SLASH,
|
|
7655
|
+
NO_DOT,
|
|
7656
|
+
NO_DOTS,
|
|
7657
|
+
NO_DOT_SLASH,
|
|
7658
|
+
NO_DOTS_SLASH,
|
|
7659
|
+
QMARK_NO_DOT,
|
|
7660
|
+
STAR,
|
|
7661
|
+
START_ANCHOR
|
|
7662
|
+
};
|
|
7663
|
+
var WINDOWS_CHARS = {
|
|
7664
|
+
...POSIX_CHARS,
|
|
7665
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
7666
|
+
QMARK: WIN_NO_SLASH,
|
|
7667
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
7668
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
7669
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
7670
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
7671
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
7672
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
7673
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
7674
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
7675
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
7676
|
+
};
|
|
7677
|
+
var POSIX_REGEX_SOURCE = {
|
|
7678
|
+
alnum: "a-zA-Z0-9",
|
|
7679
|
+
alpha: "a-zA-Z",
|
|
7680
|
+
ascii: "\\x00-\\x7F",
|
|
7681
|
+
blank: " \\t",
|
|
7682
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
7683
|
+
digit: "0-9",
|
|
7684
|
+
graph: "\\x21-\\x7E",
|
|
7685
|
+
lower: "a-z",
|
|
7686
|
+
print: "\\x20-\\x7E ",
|
|
7687
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
7688
|
+
space: " \\t\\r\\n\\v\\f",
|
|
7689
|
+
upper: "A-Z",
|
|
7690
|
+
word: "A-Za-z0-9_",
|
|
7691
|
+
xdigit: "A-Fa-f0-9"
|
|
7692
|
+
};
|
|
7693
|
+
module2.exports = {
|
|
7694
|
+
MAX_LENGTH: 1024 * 64,
|
|
7695
|
+
POSIX_REGEX_SOURCE,
|
|
7696
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
7697
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
7698
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
7699
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
7700
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
7701
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
7702
|
+
REPLACEMENTS: {
|
|
7703
|
+
"***": "*",
|
|
7704
|
+
"**/**": "**",
|
|
7705
|
+
"**/**/**": "**"
|
|
7706
|
+
},
|
|
7707
|
+
CHAR_0: 48,
|
|
7708
|
+
CHAR_9: 57,
|
|
7709
|
+
CHAR_UPPERCASE_A: 65,
|
|
7710
|
+
CHAR_LOWERCASE_A: 97,
|
|
7711
|
+
CHAR_UPPERCASE_Z: 90,
|
|
7712
|
+
CHAR_LOWERCASE_Z: 122,
|
|
7713
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
7714
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
7715
|
+
CHAR_ASTERISK: 42,
|
|
7716
|
+
CHAR_AMPERSAND: 38,
|
|
7717
|
+
CHAR_AT: 64,
|
|
7718
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
7719
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
7720
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
7721
|
+
CHAR_COLON: 58,
|
|
7722
|
+
CHAR_COMMA: 44,
|
|
7723
|
+
CHAR_DOT: 46,
|
|
7724
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
7725
|
+
CHAR_EQUAL: 61,
|
|
7726
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
7727
|
+
CHAR_FORM_FEED: 12,
|
|
7728
|
+
CHAR_FORWARD_SLASH: 47,
|
|
7729
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
7730
|
+
CHAR_HASH: 35,
|
|
7731
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
7732
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
7733
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
7734
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
7735
|
+
CHAR_LINE_FEED: 10,
|
|
7736
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
7737
|
+
CHAR_PERCENT: 37,
|
|
7738
|
+
CHAR_PLUS: 43,
|
|
7739
|
+
CHAR_QUESTION_MARK: 63,
|
|
7740
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
7741
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
7742
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
7743
|
+
CHAR_SEMICOLON: 59,
|
|
7744
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
7745
|
+
CHAR_SPACE: 32,
|
|
7746
|
+
CHAR_TAB: 9,
|
|
7747
|
+
CHAR_UNDERSCORE: 95,
|
|
7748
|
+
CHAR_VERTICAL_LINE: 124,
|
|
7749
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
7750
|
+
SEP: path3.sep,
|
|
7751
|
+
extglobChars(chars) {
|
|
7752
|
+
return {
|
|
7753
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
7754
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
7755
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
7756
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
7757
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
7758
|
+
};
|
|
7759
|
+
},
|
|
7760
|
+
globChars(win32) {
|
|
7761
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
7762
|
+
}
|
|
7763
|
+
};
|
|
7764
|
+
}
|
|
7765
|
+
});
|
|
7766
|
+
|
|
7767
|
+
// ../../node_modules/picomatch/lib/utils.js
|
|
7768
|
+
var require_utils = __commonJS({
|
|
7769
|
+
"../../node_modules/picomatch/lib/utils.js"(exports) {
|
|
7770
|
+
"use strict";
|
|
7771
|
+
var path3 = require("path");
|
|
7772
|
+
var win32 = process.platform === "win32";
|
|
7773
|
+
var {
|
|
7774
|
+
REGEX_BACKSLASH,
|
|
7775
|
+
REGEX_REMOVE_BACKSLASH,
|
|
7776
|
+
REGEX_SPECIAL_CHARS,
|
|
7777
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
7778
|
+
} = require_constants();
|
|
7779
|
+
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
7780
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
7781
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
7782
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
7783
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
7784
|
+
exports.removeBackslashes = (str) => {
|
|
7785
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
7786
|
+
return match === "\\" ? "" : match;
|
|
7787
|
+
});
|
|
7788
|
+
};
|
|
7789
|
+
exports.supportsLookbehinds = () => {
|
|
7790
|
+
const segs = process.version.slice(1).split(".").map(Number);
|
|
7791
|
+
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
|
|
7792
|
+
return true;
|
|
7793
|
+
}
|
|
7794
|
+
return false;
|
|
7795
|
+
};
|
|
7796
|
+
exports.isWindows = (options) => {
|
|
7797
|
+
if (options && typeof options.windows === "boolean") {
|
|
7798
|
+
return options.windows;
|
|
7799
|
+
}
|
|
7800
|
+
return win32 === true || path3.sep === "\\";
|
|
7801
|
+
};
|
|
7802
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
7803
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
7804
|
+
if (idx === -1)
|
|
7805
|
+
return input;
|
|
7806
|
+
if (input[idx - 1] === "\\")
|
|
7807
|
+
return exports.escapeLast(input, char, idx - 1);
|
|
7808
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
7809
|
+
};
|
|
7810
|
+
exports.removePrefix = (input, state = {}) => {
|
|
7811
|
+
let output = input;
|
|
7812
|
+
if (output.startsWith("./")) {
|
|
7813
|
+
output = output.slice(2);
|
|
7814
|
+
state.prefix = "./";
|
|
7815
|
+
}
|
|
7816
|
+
return output;
|
|
7817
|
+
};
|
|
7818
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
7819
|
+
const prepend = options.contains ? "" : "^";
|
|
7820
|
+
const append = options.contains ? "" : "$";
|
|
7821
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
7822
|
+
if (state.negated === true) {
|
|
7823
|
+
output = `(?:^(?!${output}).*$)`;
|
|
7824
|
+
}
|
|
7825
|
+
return output;
|
|
7826
|
+
};
|
|
7827
|
+
}
|
|
7828
|
+
});
|
|
7829
|
+
|
|
7830
|
+
// ../../node_modules/picomatch/lib/scan.js
|
|
7831
|
+
var require_scan = __commonJS({
|
|
7832
|
+
"../../node_modules/picomatch/lib/scan.js"(exports, module2) {
|
|
7833
|
+
"use strict";
|
|
7834
|
+
var utils = require_utils();
|
|
7835
|
+
var {
|
|
7836
|
+
CHAR_ASTERISK,
|
|
7837
|
+
CHAR_AT,
|
|
7838
|
+
CHAR_BACKWARD_SLASH,
|
|
7839
|
+
CHAR_COMMA,
|
|
7840
|
+
CHAR_DOT,
|
|
7841
|
+
CHAR_EXCLAMATION_MARK,
|
|
7842
|
+
CHAR_FORWARD_SLASH,
|
|
7843
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
7844
|
+
CHAR_LEFT_PARENTHESES,
|
|
7845
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
7846
|
+
CHAR_PLUS,
|
|
7847
|
+
CHAR_QUESTION_MARK,
|
|
7848
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
7849
|
+
CHAR_RIGHT_PARENTHESES,
|
|
7850
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
7851
|
+
} = require_constants();
|
|
7852
|
+
var isPathSeparator = (code) => {
|
|
7853
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
7854
|
+
};
|
|
7855
|
+
var depth = (token) => {
|
|
7856
|
+
if (token.isPrefix !== true) {
|
|
7857
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
7858
|
+
}
|
|
7859
|
+
};
|
|
7860
|
+
var scan = (input, options) => {
|
|
7861
|
+
const opts = options || {};
|
|
7862
|
+
const length = input.length - 1;
|
|
7863
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
7864
|
+
const slashes = [];
|
|
7865
|
+
const tokens = [];
|
|
7866
|
+
const parts = [];
|
|
7867
|
+
let str = input;
|
|
7868
|
+
let index = -1;
|
|
7869
|
+
let start = 0;
|
|
7870
|
+
let lastIndex = 0;
|
|
7871
|
+
let isBrace = false;
|
|
7872
|
+
let isBracket = false;
|
|
7873
|
+
let isGlob = false;
|
|
7874
|
+
let isExtglob = false;
|
|
7875
|
+
let isGlobstar = false;
|
|
7876
|
+
let braceEscaped = false;
|
|
7877
|
+
let backslashes = false;
|
|
7878
|
+
let negated = false;
|
|
7879
|
+
let negatedExtglob = false;
|
|
7880
|
+
let finished = false;
|
|
7881
|
+
let braces = 0;
|
|
7882
|
+
let prev;
|
|
7883
|
+
let code;
|
|
7884
|
+
let token = { value: "", depth: 0, isGlob: false };
|
|
7885
|
+
const eos = () => index >= length;
|
|
7886
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
7887
|
+
const advance = () => {
|
|
7888
|
+
prev = code;
|
|
7889
|
+
return str.charCodeAt(++index);
|
|
7890
|
+
};
|
|
7891
|
+
while (index < length) {
|
|
7892
|
+
code = advance();
|
|
7893
|
+
let next;
|
|
7894
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7895
|
+
backslashes = token.backslashes = true;
|
|
7896
|
+
code = advance();
|
|
7897
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
7898
|
+
braceEscaped = true;
|
|
7899
|
+
}
|
|
7900
|
+
continue;
|
|
7901
|
+
}
|
|
7902
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
7903
|
+
braces++;
|
|
7904
|
+
while (eos() !== true && (code = advance())) {
|
|
7905
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7906
|
+
backslashes = token.backslashes = true;
|
|
7907
|
+
advance();
|
|
7908
|
+
continue;
|
|
7909
|
+
}
|
|
7910
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
7911
|
+
braces++;
|
|
7912
|
+
continue;
|
|
7913
|
+
}
|
|
7914
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
7915
|
+
isBrace = token.isBrace = true;
|
|
7916
|
+
isGlob = token.isGlob = true;
|
|
7917
|
+
finished = true;
|
|
7918
|
+
if (scanToEnd === true) {
|
|
7919
|
+
continue;
|
|
7920
|
+
}
|
|
7921
|
+
break;
|
|
7922
|
+
}
|
|
7923
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
7924
|
+
isBrace = token.isBrace = true;
|
|
7925
|
+
isGlob = token.isGlob = true;
|
|
7926
|
+
finished = true;
|
|
7927
|
+
if (scanToEnd === true) {
|
|
7928
|
+
continue;
|
|
7929
|
+
}
|
|
7930
|
+
break;
|
|
7931
|
+
}
|
|
7932
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
7933
|
+
braces--;
|
|
7934
|
+
if (braces === 0) {
|
|
7935
|
+
braceEscaped = false;
|
|
7936
|
+
isBrace = token.isBrace = true;
|
|
7937
|
+
finished = true;
|
|
7938
|
+
break;
|
|
7939
|
+
}
|
|
7940
|
+
}
|
|
7941
|
+
}
|
|
7942
|
+
if (scanToEnd === true) {
|
|
7943
|
+
continue;
|
|
7944
|
+
}
|
|
7945
|
+
break;
|
|
7946
|
+
}
|
|
7947
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
7948
|
+
slashes.push(index);
|
|
7949
|
+
tokens.push(token);
|
|
7950
|
+
token = { value: "", depth: 0, isGlob: false };
|
|
7951
|
+
if (finished === true)
|
|
7952
|
+
continue;
|
|
7953
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
7954
|
+
start += 2;
|
|
7955
|
+
continue;
|
|
7956
|
+
}
|
|
7957
|
+
lastIndex = index + 1;
|
|
7958
|
+
continue;
|
|
7959
|
+
}
|
|
7960
|
+
if (opts.noext !== true) {
|
|
7961
|
+
const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
|
|
7962
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
7963
|
+
isGlob = token.isGlob = true;
|
|
7964
|
+
isExtglob = token.isExtglob = true;
|
|
7965
|
+
finished = true;
|
|
7966
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
7967
|
+
negatedExtglob = true;
|
|
7968
|
+
}
|
|
7969
|
+
if (scanToEnd === true) {
|
|
7970
|
+
while (eos() !== true && (code = advance())) {
|
|
7971
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7972
|
+
backslashes = token.backslashes = true;
|
|
7973
|
+
code = advance();
|
|
7974
|
+
continue;
|
|
7975
|
+
}
|
|
7976
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
7977
|
+
isGlob = token.isGlob = true;
|
|
7978
|
+
finished = true;
|
|
7979
|
+
break;
|
|
7980
|
+
}
|
|
7981
|
+
}
|
|
7982
|
+
continue;
|
|
7983
|
+
}
|
|
7984
|
+
break;
|
|
7985
|
+
}
|
|
7986
|
+
}
|
|
7987
|
+
if (code === CHAR_ASTERISK) {
|
|
7988
|
+
if (prev === CHAR_ASTERISK)
|
|
7989
|
+
isGlobstar = token.isGlobstar = true;
|
|
7990
|
+
isGlob = token.isGlob = true;
|
|
7991
|
+
finished = true;
|
|
7992
|
+
if (scanToEnd === true) {
|
|
7993
|
+
continue;
|
|
7994
|
+
}
|
|
7995
|
+
break;
|
|
7996
|
+
}
|
|
7997
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
7998
|
+
isGlob = token.isGlob = true;
|
|
7999
|
+
finished = true;
|
|
8000
|
+
if (scanToEnd === true) {
|
|
8001
|
+
continue;
|
|
8002
|
+
}
|
|
8003
|
+
break;
|
|
8004
|
+
}
|
|
8005
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
8006
|
+
while (eos() !== true && (next = advance())) {
|
|
8007
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
8008
|
+
backslashes = token.backslashes = true;
|
|
8009
|
+
advance();
|
|
8010
|
+
continue;
|
|
8011
|
+
}
|
|
8012
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
8013
|
+
isBracket = token.isBracket = true;
|
|
8014
|
+
isGlob = token.isGlob = true;
|
|
8015
|
+
finished = true;
|
|
8016
|
+
break;
|
|
8017
|
+
}
|
|
8018
|
+
}
|
|
8019
|
+
if (scanToEnd === true) {
|
|
8020
|
+
continue;
|
|
8021
|
+
}
|
|
8022
|
+
break;
|
|
8023
|
+
}
|
|
8024
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
8025
|
+
negated = token.negated = true;
|
|
8026
|
+
start++;
|
|
8027
|
+
continue;
|
|
8028
|
+
}
|
|
8029
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
8030
|
+
isGlob = token.isGlob = true;
|
|
8031
|
+
if (scanToEnd === true) {
|
|
8032
|
+
while (eos() !== true && (code = advance())) {
|
|
8033
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
8034
|
+
backslashes = token.backslashes = true;
|
|
8035
|
+
code = advance();
|
|
8036
|
+
continue;
|
|
8037
|
+
}
|
|
8038
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
8039
|
+
finished = true;
|
|
8040
|
+
break;
|
|
8041
|
+
}
|
|
8042
|
+
}
|
|
8043
|
+
continue;
|
|
8044
|
+
}
|
|
8045
|
+
break;
|
|
8046
|
+
}
|
|
8047
|
+
if (isGlob === true) {
|
|
8048
|
+
finished = true;
|
|
8049
|
+
if (scanToEnd === true) {
|
|
8050
|
+
continue;
|
|
8051
|
+
}
|
|
8052
|
+
break;
|
|
8053
|
+
}
|
|
8054
|
+
}
|
|
8055
|
+
if (opts.noext === true) {
|
|
8056
|
+
isExtglob = false;
|
|
8057
|
+
isGlob = false;
|
|
8058
|
+
}
|
|
8059
|
+
let base = str;
|
|
8060
|
+
let prefix = "";
|
|
8061
|
+
let glob = "";
|
|
8062
|
+
if (start > 0) {
|
|
8063
|
+
prefix = str.slice(0, start);
|
|
8064
|
+
str = str.slice(start);
|
|
8065
|
+
lastIndex -= start;
|
|
8066
|
+
}
|
|
8067
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
8068
|
+
base = str.slice(0, lastIndex);
|
|
8069
|
+
glob = str.slice(lastIndex);
|
|
8070
|
+
} else if (isGlob === true) {
|
|
8071
|
+
base = "";
|
|
8072
|
+
glob = str;
|
|
8073
|
+
} else {
|
|
8074
|
+
base = str;
|
|
8075
|
+
}
|
|
8076
|
+
if (base && base !== "" && base !== "/" && base !== str) {
|
|
8077
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
8078
|
+
base = base.slice(0, -1);
|
|
8079
|
+
}
|
|
8080
|
+
}
|
|
8081
|
+
if (opts.unescape === true) {
|
|
8082
|
+
if (glob)
|
|
8083
|
+
glob = utils.removeBackslashes(glob);
|
|
8084
|
+
if (base && backslashes === true) {
|
|
8085
|
+
base = utils.removeBackslashes(base);
|
|
8086
|
+
}
|
|
8087
|
+
}
|
|
8088
|
+
const state = {
|
|
8089
|
+
prefix,
|
|
8090
|
+
input,
|
|
8091
|
+
start,
|
|
8092
|
+
base,
|
|
8093
|
+
glob,
|
|
8094
|
+
isBrace,
|
|
8095
|
+
isBracket,
|
|
8096
|
+
isGlob,
|
|
8097
|
+
isExtglob,
|
|
8098
|
+
isGlobstar,
|
|
8099
|
+
negated,
|
|
8100
|
+
negatedExtglob
|
|
8101
|
+
};
|
|
8102
|
+
if (opts.tokens === true) {
|
|
8103
|
+
state.maxDepth = 0;
|
|
8104
|
+
if (!isPathSeparator(code)) {
|
|
8105
|
+
tokens.push(token);
|
|
8106
|
+
}
|
|
8107
|
+
state.tokens = tokens;
|
|
8108
|
+
}
|
|
8109
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
8110
|
+
let prevIndex;
|
|
8111
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
8112
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
8113
|
+
const i = slashes[idx];
|
|
8114
|
+
const value = input.slice(n, i);
|
|
8115
|
+
if (opts.tokens) {
|
|
8116
|
+
if (idx === 0 && start !== 0) {
|
|
8117
|
+
tokens[idx].isPrefix = true;
|
|
8118
|
+
tokens[idx].value = prefix;
|
|
8119
|
+
} else {
|
|
8120
|
+
tokens[idx].value = value;
|
|
8121
|
+
}
|
|
8122
|
+
depth(tokens[idx]);
|
|
8123
|
+
state.maxDepth += tokens[idx].depth;
|
|
8124
|
+
}
|
|
8125
|
+
if (idx !== 0 || value !== "") {
|
|
8126
|
+
parts.push(value);
|
|
8127
|
+
}
|
|
8128
|
+
prevIndex = i;
|
|
8129
|
+
}
|
|
8130
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
8131
|
+
const value = input.slice(prevIndex + 1);
|
|
8132
|
+
parts.push(value);
|
|
8133
|
+
if (opts.tokens) {
|
|
8134
|
+
tokens[tokens.length - 1].value = value;
|
|
8135
|
+
depth(tokens[tokens.length - 1]);
|
|
8136
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
8137
|
+
}
|
|
8138
|
+
}
|
|
8139
|
+
state.slashes = slashes;
|
|
8140
|
+
state.parts = parts;
|
|
8141
|
+
}
|
|
8142
|
+
return state;
|
|
8143
|
+
};
|
|
8144
|
+
module2.exports = scan;
|
|
8145
|
+
}
|
|
8146
|
+
});
|
|
8147
|
+
|
|
8148
|
+
// ../../node_modules/picomatch/lib/parse.js
|
|
8149
|
+
var require_parse = __commonJS({
|
|
8150
|
+
"../../node_modules/picomatch/lib/parse.js"(exports, module2) {
|
|
8151
|
+
"use strict";
|
|
8152
|
+
var constants = require_constants();
|
|
8153
|
+
var utils = require_utils();
|
|
8154
|
+
var {
|
|
8155
|
+
MAX_LENGTH,
|
|
8156
|
+
POSIX_REGEX_SOURCE,
|
|
8157
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
8158
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
8159
|
+
REPLACEMENTS
|
|
8160
|
+
} = constants;
|
|
8161
|
+
var expandRange = (args2, options) => {
|
|
8162
|
+
if (typeof options.expandRange === "function") {
|
|
8163
|
+
return options.expandRange(...args2, options);
|
|
8164
|
+
}
|
|
8165
|
+
args2.sort();
|
|
8166
|
+
const value = `[${args2.join("-")}]`;
|
|
8167
|
+
try {
|
|
8168
|
+
new RegExp(value);
|
|
8169
|
+
} catch (ex) {
|
|
8170
|
+
return args2.map((v) => utils.escapeRegex(v)).join("..");
|
|
8171
|
+
}
|
|
8172
|
+
return value;
|
|
8173
|
+
};
|
|
8174
|
+
var syntaxError = (type, char) => {
|
|
8175
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
8176
|
+
};
|
|
8177
|
+
var parse = (input, options) => {
|
|
8178
|
+
if (typeof input !== "string") {
|
|
8179
|
+
throw new TypeError("Expected a string");
|
|
8180
|
+
}
|
|
8181
|
+
input = REPLACEMENTS[input] || input;
|
|
8182
|
+
const opts = { ...options };
|
|
8183
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
8184
|
+
let len = input.length;
|
|
8185
|
+
if (len > max) {
|
|
8186
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
8187
|
+
}
|
|
8188
|
+
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
8189
|
+
const tokens = [bos];
|
|
8190
|
+
const capture = opts.capture ? "" : "?:";
|
|
8191
|
+
const win32 = utils.isWindows(options);
|
|
8192
|
+
const PLATFORM_CHARS = constants.globChars(win32);
|
|
8193
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
8194
|
+
const {
|
|
8195
|
+
DOT_LITERAL,
|
|
8196
|
+
PLUS_LITERAL,
|
|
8197
|
+
SLASH_LITERAL,
|
|
8198
|
+
ONE_CHAR,
|
|
8199
|
+
DOTS_SLASH,
|
|
8200
|
+
NO_DOT,
|
|
8201
|
+
NO_DOT_SLASH,
|
|
8202
|
+
NO_DOTS_SLASH,
|
|
8203
|
+
QMARK,
|
|
8204
|
+
QMARK_NO_DOT,
|
|
8205
|
+
STAR,
|
|
8206
|
+
START_ANCHOR
|
|
8207
|
+
} = PLATFORM_CHARS;
|
|
8208
|
+
const globstar = (opts2) => {
|
|
8209
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
8210
|
+
};
|
|
8211
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
8212
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
8213
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
8214
|
+
if (opts.capture) {
|
|
8215
|
+
star = `(${star})`;
|
|
8216
|
+
}
|
|
8217
|
+
if (typeof opts.noext === "boolean") {
|
|
8218
|
+
opts.noextglob = opts.noext;
|
|
8219
|
+
}
|
|
8220
|
+
const state = {
|
|
8221
|
+
input,
|
|
8222
|
+
index: -1,
|
|
8223
|
+
start: 0,
|
|
8224
|
+
dot: opts.dot === true,
|
|
8225
|
+
consumed: "",
|
|
8226
|
+
output: "",
|
|
8227
|
+
prefix: "",
|
|
8228
|
+
backtrack: false,
|
|
8229
|
+
negated: false,
|
|
8230
|
+
brackets: 0,
|
|
8231
|
+
braces: 0,
|
|
8232
|
+
parens: 0,
|
|
8233
|
+
quotes: 0,
|
|
8234
|
+
globstar: false,
|
|
8235
|
+
tokens
|
|
8236
|
+
};
|
|
8237
|
+
input = utils.removePrefix(input, state);
|
|
8238
|
+
len = input.length;
|
|
8239
|
+
const extglobs = [];
|
|
8240
|
+
const braces = [];
|
|
8241
|
+
const stack = [];
|
|
8242
|
+
let prev = bos;
|
|
8243
|
+
let value;
|
|
8244
|
+
const eos = () => state.index === len - 1;
|
|
8245
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
8246
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
8247
|
+
const remaining = () => input.slice(state.index + 1);
|
|
8248
|
+
const consume = (value2 = "", num = 0) => {
|
|
8249
|
+
state.consumed += value2;
|
|
8250
|
+
state.index += num;
|
|
8251
|
+
};
|
|
8252
|
+
const append = (token) => {
|
|
8253
|
+
state.output += token.output != null ? token.output : token.value;
|
|
8254
|
+
consume(token.value);
|
|
8255
|
+
};
|
|
8256
|
+
const negate = () => {
|
|
8257
|
+
let count = 1;
|
|
8258
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
8259
|
+
advance();
|
|
8260
|
+
state.start++;
|
|
8261
|
+
count++;
|
|
8262
|
+
}
|
|
8263
|
+
if (count % 2 === 0) {
|
|
8264
|
+
return false;
|
|
8265
|
+
}
|
|
8266
|
+
state.negated = true;
|
|
8267
|
+
state.start++;
|
|
8268
|
+
return true;
|
|
8269
|
+
};
|
|
8270
|
+
const increment = (type) => {
|
|
8271
|
+
state[type]++;
|
|
8272
|
+
stack.push(type);
|
|
8273
|
+
};
|
|
8274
|
+
const decrement = (type) => {
|
|
8275
|
+
state[type]--;
|
|
8276
|
+
stack.pop();
|
|
8277
|
+
};
|
|
8278
|
+
const push = (tok) => {
|
|
8279
|
+
if (prev.type === "globstar") {
|
|
8280
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
8281
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
8282
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
8283
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
8284
|
+
prev.type = "star";
|
|
8285
|
+
prev.value = "*";
|
|
8286
|
+
prev.output = star;
|
|
8287
|
+
state.output += prev.output;
|
|
8288
|
+
}
|
|
8289
|
+
}
|
|
8290
|
+
if (extglobs.length && tok.type !== "paren") {
|
|
8291
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
8292
|
+
}
|
|
8293
|
+
if (tok.value || tok.output)
|
|
8294
|
+
append(tok);
|
|
8295
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
8296
|
+
prev.value += tok.value;
|
|
8297
|
+
prev.output = (prev.output || "") + tok.value;
|
|
8298
|
+
return;
|
|
8299
|
+
}
|
|
8300
|
+
tok.prev = prev;
|
|
8301
|
+
tokens.push(tok);
|
|
8302
|
+
prev = tok;
|
|
8303
|
+
};
|
|
8304
|
+
const extglobOpen = (type, value2) => {
|
|
8305
|
+
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
8306
|
+
token.prev = prev;
|
|
8307
|
+
token.parens = state.parens;
|
|
8308
|
+
token.output = state.output;
|
|
8309
|
+
const output = (opts.capture ? "(" : "") + token.open;
|
|
8310
|
+
increment("parens");
|
|
8311
|
+
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
8312
|
+
push({ type: "paren", extglob: true, value: advance(), output });
|
|
8313
|
+
extglobs.push(token);
|
|
8314
|
+
};
|
|
8315
|
+
const extglobClose = (token) => {
|
|
8316
|
+
let output = token.close + (opts.capture ? ")" : "");
|
|
8317
|
+
let rest;
|
|
8318
|
+
if (token.type === "negate") {
|
|
8319
|
+
let extglobStar = star;
|
|
8320
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
8321
|
+
extglobStar = globstar(opts);
|
|
8322
|
+
}
|
|
8323
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
8324
|
+
output = token.close = `)$))${extglobStar}`;
|
|
8325
|
+
}
|
|
8326
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
8327
|
+
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
8328
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
8329
|
+
}
|
|
8330
|
+
if (token.prev.type === "bos") {
|
|
8331
|
+
state.negatedExtglob = true;
|
|
8332
|
+
}
|
|
8333
|
+
}
|
|
8334
|
+
push({ type: "paren", extglob: true, value, output });
|
|
8335
|
+
decrement("parens");
|
|
8336
|
+
};
|
|
8337
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
8338
|
+
let backslashes = false;
|
|
8339
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
8340
|
+
if (first === "\\") {
|
|
8341
|
+
backslashes = true;
|
|
8342
|
+
return m;
|
|
8343
|
+
}
|
|
8344
|
+
if (first === "?") {
|
|
8345
|
+
if (esc) {
|
|
8346
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
8347
|
+
}
|
|
8348
|
+
if (index === 0) {
|
|
8349
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
8350
|
+
}
|
|
8351
|
+
return QMARK.repeat(chars.length);
|
|
8352
|
+
}
|
|
8353
|
+
if (first === ".") {
|
|
8354
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
8355
|
+
}
|
|
8356
|
+
if (first === "*") {
|
|
8357
|
+
if (esc) {
|
|
8358
|
+
return esc + first + (rest ? star : "");
|
|
8359
|
+
}
|
|
8360
|
+
return star;
|
|
8361
|
+
}
|
|
8362
|
+
return esc ? m : `\\${m}`;
|
|
8363
|
+
});
|
|
8364
|
+
if (backslashes === true) {
|
|
8365
|
+
if (opts.unescape === true) {
|
|
8366
|
+
output = output.replace(/\\/g, "");
|
|
8367
|
+
} else {
|
|
8368
|
+
output = output.replace(/\\+/g, (m) => {
|
|
8369
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
8370
|
+
});
|
|
8371
|
+
}
|
|
8372
|
+
}
|
|
8373
|
+
if (output === input && opts.contains === true) {
|
|
8374
|
+
state.output = input;
|
|
8375
|
+
return state;
|
|
8376
|
+
}
|
|
8377
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
8378
|
+
return state;
|
|
8379
|
+
}
|
|
8380
|
+
while (!eos()) {
|
|
8381
|
+
value = advance();
|
|
8382
|
+
if (value === "\0") {
|
|
8383
|
+
continue;
|
|
8384
|
+
}
|
|
8385
|
+
if (value === "\\") {
|
|
8386
|
+
const next = peek();
|
|
8387
|
+
if (next === "/" && opts.bash !== true) {
|
|
8388
|
+
continue;
|
|
8389
|
+
}
|
|
8390
|
+
if (next === "." || next === ";") {
|
|
8391
|
+
continue;
|
|
8392
|
+
}
|
|
8393
|
+
if (!next) {
|
|
8394
|
+
value += "\\";
|
|
8395
|
+
push({ type: "text", value });
|
|
8396
|
+
continue;
|
|
8397
|
+
}
|
|
8398
|
+
const match = /^\\+/.exec(remaining());
|
|
8399
|
+
let slashes = 0;
|
|
8400
|
+
if (match && match[0].length > 2) {
|
|
8401
|
+
slashes = match[0].length;
|
|
8402
|
+
state.index += slashes;
|
|
8403
|
+
if (slashes % 2 !== 0) {
|
|
8404
|
+
value += "\\";
|
|
8405
|
+
}
|
|
8406
|
+
}
|
|
8407
|
+
if (opts.unescape === true) {
|
|
8408
|
+
value = advance();
|
|
8409
|
+
} else {
|
|
8410
|
+
value += advance();
|
|
8411
|
+
}
|
|
8412
|
+
if (state.brackets === 0) {
|
|
8413
|
+
push({ type: "text", value });
|
|
8414
|
+
continue;
|
|
8415
|
+
}
|
|
8416
|
+
}
|
|
8417
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
8418
|
+
if (opts.posix !== false && value === ":") {
|
|
8419
|
+
const inner = prev.value.slice(1);
|
|
8420
|
+
if (inner.includes("[")) {
|
|
8421
|
+
prev.posix = true;
|
|
8422
|
+
if (inner.includes(":")) {
|
|
8423
|
+
const idx = prev.value.lastIndexOf("[");
|
|
8424
|
+
const pre = prev.value.slice(0, idx);
|
|
8425
|
+
const rest2 = prev.value.slice(idx + 2);
|
|
8426
|
+
const posix = POSIX_REGEX_SOURCE[rest2];
|
|
8427
|
+
if (posix) {
|
|
8428
|
+
prev.value = pre + posix;
|
|
8429
|
+
state.backtrack = true;
|
|
8430
|
+
advance();
|
|
8431
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
8432
|
+
bos.output = ONE_CHAR;
|
|
8433
|
+
}
|
|
8434
|
+
continue;
|
|
8435
|
+
}
|
|
8436
|
+
}
|
|
8437
|
+
}
|
|
8438
|
+
}
|
|
8439
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
8440
|
+
value = `\\${value}`;
|
|
8441
|
+
}
|
|
8442
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
8443
|
+
value = `\\${value}`;
|
|
8444
|
+
}
|
|
8445
|
+
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
8446
|
+
value = "^";
|
|
8447
|
+
}
|
|
8448
|
+
prev.value += value;
|
|
8449
|
+
append({ value });
|
|
8450
|
+
continue;
|
|
8451
|
+
}
|
|
8452
|
+
if (state.quotes === 1 && value !== '"') {
|
|
8453
|
+
value = utils.escapeRegex(value);
|
|
8454
|
+
prev.value += value;
|
|
8455
|
+
append({ value });
|
|
8456
|
+
continue;
|
|
8457
|
+
}
|
|
8458
|
+
if (value === '"') {
|
|
8459
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
8460
|
+
if (opts.keepQuotes === true) {
|
|
8461
|
+
push({ type: "text", value });
|
|
8462
|
+
}
|
|
8463
|
+
continue;
|
|
8464
|
+
}
|
|
8465
|
+
if (value === "(") {
|
|
8466
|
+
increment("parens");
|
|
8467
|
+
push({ type: "paren", value });
|
|
8468
|
+
continue;
|
|
8469
|
+
}
|
|
8470
|
+
if (value === ")") {
|
|
8471
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
8472
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
8473
|
+
}
|
|
8474
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
8475
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
8476
|
+
extglobClose(extglobs.pop());
|
|
8477
|
+
continue;
|
|
8478
|
+
}
|
|
8479
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
|
|
8480
|
+
decrement("parens");
|
|
8481
|
+
continue;
|
|
8482
|
+
}
|
|
8483
|
+
if (value === "[") {
|
|
8484
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
8485
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
8486
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
8487
|
+
}
|
|
8488
|
+
value = `\\${value}`;
|
|
8489
|
+
} else {
|
|
8490
|
+
increment("brackets");
|
|
8491
|
+
}
|
|
8492
|
+
push({ type: "bracket", value });
|
|
8493
|
+
continue;
|
|
8494
|
+
}
|
|
8495
|
+
if (value === "]") {
|
|
8496
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
8497
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
8498
|
+
continue;
|
|
8499
|
+
}
|
|
8500
|
+
if (state.brackets === 0) {
|
|
8501
|
+
if (opts.strictBrackets === true) {
|
|
8502
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
8503
|
+
}
|
|
8504
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
8505
|
+
continue;
|
|
8506
|
+
}
|
|
8507
|
+
decrement("brackets");
|
|
8508
|
+
const prevValue = prev.value.slice(1);
|
|
8509
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
8510
|
+
value = `/${value}`;
|
|
8511
|
+
}
|
|
8512
|
+
prev.value += value;
|
|
8513
|
+
append({ value });
|
|
8514
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
8515
|
+
continue;
|
|
8516
|
+
}
|
|
8517
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
8518
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
8519
|
+
if (opts.literalBrackets === true) {
|
|
8520
|
+
state.output += escaped;
|
|
8521
|
+
prev.value = escaped;
|
|
8522
|
+
continue;
|
|
8523
|
+
}
|
|
8524
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
8525
|
+
state.output += prev.value;
|
|
8526
|
+
continue;
|
|
8527
|
+
}
|
|
8528
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
8529
|
+
increment("braces");
|
|
8530
|
+
const open = {
|
|
8531
|
+
type: "brace",
|
|
8532
|
+
value,
|
|
8533
|
+
output: "(",
|
|
8534
|
+
outputIndex: state.output.length,
|
|
8535
|
+
tokensIndex: state.tokens.length
|
|
8536
|
+
};
|
|
8537
|
+
braces.push(open);
|
|
8538
|
+
push(open);
|
|
8539
|
+
continue;
|
|
8540
|
+
}
|
|
8541
|
+
if (value === "}") {
|
|
8542
|
+
const brace = braces[braces.length - 1];
|
|
8543
|
+
if (opts.nobrace === true || !brace) {
|
|
8544
|
+
push({ type: "text", value, output: value });
|
|
8545
|
+
continue;
|
|
8546
|
+
}
|
|
8547
|
+
let output = ")";
|
|
8548
|
+
if (brace.dots === true) {
|
|
8549
|
+
const arr = tokens.slice();
|
|
8550
|
+
const range = [];
|
|
8551
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
8552
|
+
tokens.pop();
|
|
8553
|
+
if (arr[i].type === "brace") {
|
|
8554
|
+
break;
|
|
8555
|
+
}
|
|
8556
|
+
if (arr[i].type !== "dots") {
|
|
8557
|
+
range.unshift(arr[i].value);
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8560
|
+
output = expandRange(range, opts);
|
|
8561
|
+
state.backtrack = true;
|
|
8562
|
+
}
|
|
8563
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
8564
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
8565
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
8566
|
+
brace.value = brace.output = "\\{";
|
|
8567
|
+
value = output = "\\}";
|
|
8568
|
+
state.output = out;
|
|
8569
|
+
for (const t of toks) {
|
|
8570
|
+
state.output += t.output || t.value;
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8573
|
+
push({ type: "brace", value, output });
|
|
8574
|
+
decrement("braces");
|
|
8575
|
+
braces.pop();
|
|
8576
|
+
continue;
|
|
8577
|
+
}
|
|
8578
|
+
if (value === "|") {
|
|
8579
|
+
if (extglobs.length > 0) {
|
|
8580
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
8581
|
+
}
|
|
8582
|
+
push({ type: "text", value });
|
|
8583
|
+
continue;
|
|
8584
|
+
}
|
|
8585
|
+
if (value === ",") {
|
|
8586
|
+
let output = value;
|
|
8587
|
+
const brace = braces[braces.length - 1];
|
|
8588
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
8589
|
+
brace.comma = true;
|
|
8590
|
+
output = "|";
|
|
8591
|
+
}
|
|
8592
|
+
push({ type: "comma", value, output });
|
|
8593
|
+
continue;
|
|
8594
|
+
}
|
|
8595
|
+
if (value === "/") {
|
|
8596
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
8597
|
+
state.start = state.index + 1;
|
|
8598
|
+
state.consumed = "";
|
|
8599
|
+
state.output = "";
|
|
8600
|
+
tokens.pop();
|
|
8601
|
+
prev = bos;
|
|
8602
|
+
continue;
|
|
8603
|
+
}
|
|
8604
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
8605
|
+
continue;
|
|
8606
|
+
}
|
|
8607
|
+
if (value === ".") {
|
|
8608
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
8609
|
+
if (prev.value === ".")
|
|
8610
|
+
prev.output = DOT_LITERAL;
|
|
8611
|
+
const brace = braces[braces.length - 1];
|
|
8612
|
+
prev.type = "dots";
|
|
8613
|
+
prev.output += value;
|
|
8614
|
+
prev.value += value;
|
|
8615
|
+
brace.dots = true;
|
|
8616
|
+
continue;
|
|
8617
|
+
}
|
|
8618
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
8619
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
8620
|
+
continue;
|
|
8621
|
+
}
|
|
8622
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
8623
|
+
continue;
|
|
8624
|
+
}
|
|
8625
|
+
if (value === "?") {
|
|
8626
|
+
const isGroup = prev && prev.value === "(";
|
|
8627
|
+
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
8628
|
+
extglobOpen("qmark", value);
|
|
8629
|
+
continue;
|
|
8630
|
+
}
|
|
8631
|
+
if (prev && prev.type === "paren") {
|
|
8632
|
+
const next = peek();
|
|
8633
|
+
let output = value;
|
|
8634
|
+
if (next === "<" && !utils.supportsLookbehinds()) {
|
|
8635
|
+
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
8636
|
+
}
|
|
8637
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
8638
|
+
output = `\\${value}`;
|
|
8639
|
+
}
|
|
8640
|
+
push({ type: "text", value, output });
|
|
8641
|
+
continue;
|
|
8642
|
+
}
|
|
8643
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
8644
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
8645
|
+
continue;
|
|
8646
|
+
}
|
|
8647
|
+
push({ type: "qmark", value, output: QMARK });
|
|
8648
|
+
continue;
|
|
8649
|
+
}
|
|
8650
|
+
if (value === "!") {
|
|
8651
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
8652
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
8653
|
+
extglobOpen("negate", value);
|
|
8654
|
+
continue;
|
|
8655
|
+
}
|
|
8656
|
+
}
|
|
8657
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
8658
|
+
negate();
|
|
8659
|
+
continue;
|
|
8660
|
+
}
|
|
8661
|
+
}
|
|
8662
|
+
if (value === "+") {
|
|
8663
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
8664
|
+
extglobOpen("plus", value);
|
|
8665
|
+
continue;
|
|
8666
|
+
}
|
|
8667
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
8668
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
8669
|
+
continue;
|
|
8670
|
+
}
|
|
8671
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
8672
|
+
push({ type: "plus", value });
|
|
8673
|
+
continue;
|
|
8674
|
+
}
|
|
8675
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
8676
|
+
continue;
|
|
8677
|
+
}
|
|
8678
|
+
if (value === "@") {
|
|
8679
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
8680
|
+
push({ type: "at", extglob: true, value, output: "" });
|
|
8681
|
+
continue;
|
|
8682
|
+
}
|
|
8683
|
+
push({ type: "text", value });
|
|
8684
|
+
continue;
|
|
8685
|
+
}
|
|
8686
|
+
if (value !== "*") {
|
|
8687
|
+
if (value === "$" || value === "^") {
|
|
8688
|
+
value = `\\${value}`;
|
|
8689
|
+
}
|
|
8690
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
8691
|
+
if (match) {
|
|
8692
|
+
value += match[0];
|
|
8693
|
+
state.index += match[0].length;
|
|
8694
|
+
}
|
|
8695
|
+
push({ type: "text", value });
|
|
8696
|
+
continue;
|
|
8697
|
+
}
|
|
8698
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
8699
|
+
prev.type = "star";
|
|
8700
|
+
prev.star = true;
|
|
8701
|
+
prev.value += value;
|
|
8702
|
+
prev.output = star;
|
|
8703
|
+
state.backtrack = true;
|
|
8704
|
+
state.globstar = true;
|
|
8705
|
+
consume(value);
|
|
8706
|
+
continue;
|
|
8707
|
+
}
|
|
8708
|
+
let rest = remaining();
|
|
8709
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
8710
|
+
extglobOpen("star", value);
|
|
8711
|
+
continue;
|
|
8712
|
+
}
|
|
8713
|
+
if (prev.type === "star") {
|
|
8714
|
+
if (opts.noglobstar === true) {
|
|
8715
|
+
consume(value);
|
|
8716
|
+
continue;
|
|
8717
|
+
}
|
|
8718
|
+
const prior = prev.prev;
|
|
8719
|
+
const before = prior.prev;
|
|
8720
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
8721
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
8722
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
8723
|
+
push({ type: "star", value, output: "" });
|
|
8724
|
+
continue;
|
|
8725
|
+
}
|
|
8726
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
8727
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
8728
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
8729
|
+
push({ type: "star", value, output: "" });
|
|
8730
|
+
continue;
|
|
8731
|
+
}
|
|
8732
|
+
while (rest.slice(0, 3) === "/**") {
|
|
8733
|
+
const after = input[state.index + 4];
|
|
8734
|
+
if (after && after !== "/") {
|
|
8735
|
+
break;
|
|
8736
|
+
}
|
|
8737
|
+
rest = rest.slice(3);
|
|
8738
|
+
consume("/**", 3);
|
|
8739
|
+
}
|
|
8740
|
+
if (prior.type === "bos" && eos()) {
|
|
8741
|
+
prev.type = "globstar";
|
|
8742
|
+
prev.value += value;
|
|
8743
|
+
prev.output = globstar(opts);
|
|
8744
|
+
state.output = prev.output;
|
|
8745
|
+
state.globstar = true;
|
|
8746
|
+
consume(value);
|
|
8747
|
+
continue;
|
|
8748
|
+
}
|
|
8749
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
8750
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
8751
|
+
prior.output = `(?:${prior.output}`;
|
|
8752
|
+
prev.type = "globstar";
|
|
8753
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
8754
|
+
prev.value += value;
|
|
8755
|
+
state.globstar = true;
|
|
8756
|
+
state.output += prior.output + prev.output;
|
|
8757
|
+
consume(value);
|
|
8758
|
+
continue;
|
|
8759
|
+
}
|
|
8760
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
8761
|
+
const end = rest[1] !== void 0 ? "|$" : "";
|
|
8762
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
8763
|
+
prior.output = `(?:${prior.output}`;
|
|
8764
|
+
prev.type = "globstar";
|
|
8765
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
8766
|
+
prev.value += value;
|
|
8767
|
+
state.output += prior.output + prev.output;
|
|
8768
|
+
state.globstar = true;
|
|
8769
|
+
consume(value + advance());
|
|
8770
|
+
push({ type: "slash", value: "/", output: "" });
|
|
8771
|
+
continue;
|
|
8772
|
+
}
|
|
8773
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
8774
|
+
prev.type = "globstar";
|
|
8775
|
+
prev.value += value;
|
|
8776
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
8777
|
+
state.output = prev.output;
|
|
8778
|
+
state.globstar = true;
|
|
8779
|
+
consume(value + advance());
|
|
8780
|
+
push({ type: "slash", value: "/", output: "" });
|
|
8781
|
+
continue;
|
|
8782
|
+
}
|
|
8783
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
8784
|
+
prev.type = "globstar";
|
|
8785
|
+
prev.output = globstar(opts);
|
|
8786
|
+
prev.value += value;
|
|
8787
|
+
state.output += prev.output;
|
|
8788
|
+
state.globstar = true;
|
|
8789
|
+
consume(value);
|
|
8790
|
+
continue;
|
|
8791
|
+
}
|
|
8792
|
+
const token = { type: "star", value, output: star };
|
|
8793
|
+
if (opts.bash === true) {
|
|
8794
|
+
token.output = ".*?";
|
|
8795
|
+
if (prev.type === "bos" || prev.type === "slash") {
|
|
8796
|
+
token.output = nodot + token.output;
|
|
8797
|
+
}
|
|
8798
|
+
push(token);
|
|
8799
|
+
continue;
|
|
8800
|
+
}
|
|
8801
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
8802
|
+
token.output = value;
|
|
8803
|
+
push(token);
|
|
8804
|
+
continue;
|
|
8805
|
+
}
|
|
8806
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
8807
|
+
if (prev.type === "dot") {
|
|
8808
|
+
state.output += NO_DOT_SLASH;
|
|
8809
|
+
prev.output += NO_DOT_SLASH;
|
|
8810
|
+
} else if (opts.dot === true) {
|
|
8811
|
+
state.output += NO_DOTS_SLASH;
|
|
8812
|
+
prev.output += NO_DOTS_SLASH;
|
|
8813
|
+
} else {
|
|
8814
|
+
state.output += nodot;
|
|
8815
|
+
prev.output += nodot;
|
|
8816
|
+
}
|
|
8817
|
+
if (peek() !== "*") {
|
|
8818
|
+
state.output += ONE_CHAR;
|
|
8819
|
+
prev.output += ONE_CHAR;
|
|
8820
|
+
}
|
|
8821
|
+
}
|
|
8822
|
+
push(token);
|
|
8823
|
+
}
|
|
8824
|
+
while (state.brackets > 0) {
|
|
8825
|
+
if (opts.strictBrackets === true)
|
|
8826
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
8827
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
8828
|
+
decrement("brackets");
|
|
8829
|
+
}
|
|
8830
|
+
while (state.parens > 0) {
|
|
8831
|
+
if (opts.strictBrackets === true)
|
|
8832
|
+
throw new SyntaxError(syntaxError("closing", ")"));
|
|
8833
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
8834
|
+
decrement("parens");
|
|
8835
|
+
}
|
|
8836
|
+
while (state.braces > 0) {
|
|
8837
|
+
if (opts.strictBrackets === true)
|
|
8838
|
+
throw new SyntaxError(syntaxError("closing", "}"));
|
|
8839
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
8840
|
+
decrement("braces");
|
|
8841
|
+
}
|
|
8842
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
8843
|
+
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
8844
|
+
}
|
|
8845
|
+
if (state.backtrack === true) {
|
|
8846
|
+
state.output = "";
|
|
8847
|
+
for (const token of state.tokens) {
|
|
8848
|
+
state.output += token.output != null ? token.output : token.value;
|
|
8849
|
+
if (token.suffix) {
|
|
8850
|
+
state.output += token.suffix;
|
|
8851
|
+
}
|
|
8852
|
+
}
|
|
8853
|
+
}
|
|
8854
|
+
return state;
|
|
8855
|
+
};
|
|
8856
|
+
parse.fastpaths = (input, options) => {
|
|
8857
|
+
const opts = { ...options };
|
|
8858
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
8859
|
+
const len = input.length;
|
|
8860
|
+
if (len > max) {
|
|
8861
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
8862
|
+
}
|
|
8863
|
+
input = REPLACEMENTS[input] || input;
|
|
8864
|
+
const win32 = utils.isWindows(options);
|
|
8865
|
+
const {
|
|
8866
|
+
DOT_LITERAL,
|
|
8867
|
+
SLASH_LITERAL,
|
|
8868
|
+
ONE_CHAR,
|
|
8869
|
+
DOTS_SLASH,
|
|
8870
|
+
NO_DOT,
|
|
8871
|
+
NO_DOTS,
|
|
8872
|
+
NO_DOTS_SLASH,
|
|
8873
|
+
STAR,
|
|
8874
|
+
START_ANCHOR
|
|
8875
|
+
} = constants.globChars(win32);
|
|
8876
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
8877
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
8878
|
+
const capture = opts.capture ? "" : "?:";
|
|
8879
|
+
const state = { negated: false, prefix: "" };
|
|
8880
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
8881
|
+
if (opts.capture) {
|
|
8882
|
+
star = `(${star})`;
|
|
8883
|
+
}
|
|
8884
|
+
const globstar = (opts2) => {
|
|
8885
|
+
if (opts2.noglobstar === true)
|
|
8886
|
+
return star;
|
|
8887
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
8888
|
+
};
|
|
8889
|
+
const create = (str) => {
|
|
8890
|
+
switch (str) {
|
|
8891
|
+
case "*":
|
|
8892
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
8893
|
+
case ".*":
|
|
8894
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
8895
|
+
case "*.*":
|
|
8896
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
8897
|
+
case "*/*":
|
|
8898
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
8899
|
+
case "**":
|
|
8900
|
+
return nodot + globstar(opts);
|
|
8901
|
+
case "**/*":
|
|
8902
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
8903
|
+
case "**/*.*":
|
|
8904
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
8905
|
+
case "**/.*":
|
|
8906
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
8907
|
+
default: {
|
|
8908
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
8909
|
+
if (!match)
|
|
8910
|
+
return;
|
|
8911
|
+
const source2 = create(match[1]);
|
|
8912
|
+
if (!source2)
|
|
8913
|
+
return;
|
|
8914
|
+
return source2 + DOT_LITERAL + match[2];
|
|
8915
|
+
}
|
|
8916
|
+
}
|
|
8917
|
+
};
|
|
8918
|
+
const output = utils.removePrefix(input, state);
|
|
8919
|
+
let source = create(output);
|
|
8920
|
+
if (source && opts.strictSlashes !== true) {
|
|
8921
|
+
source += `${SLASH_LITERAL}?`;
|
|
8922
|
+
}
|
|
8923
|
+
return source;
|
|
8924
|
+
};
|
|
8925
|
+
module2.exports = parse;
|
|
8926
|
+
}
|
|
8927
|
+
});
|
|
8928
|
+
|
|
8929
|
+
// ../../node_modules/picomatch/lib/picomatch.js
|
|
8930
|
+
var require_picomatch = __commonJS({
|
|
8931
|
+
"../../node_modules/picomatch/lib/picomatch.js"(exports, module2) {
|
|
8932
|
+
"use strict";
|
|
8933
|
+
var path3 = require("path");
|
|
8934
|
+
var scan = require_scan();
|
|
8935
|
+
var parse = require_parse();
|
|
8936
|
+
var utils = require_utils();
|
|
8937
|
+
var constants = require_constants();
|
|
8938
|
+
var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
8939
|
+
var picomatch = (glob, options, returnState = false) => {
|
|
8940
|
+
if (Array.isArray(glob)) {
|
|
8941
|
+
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
8942
|
+
const arrayMatcher = (str) => {
|
|
8943
|
+
for (const isMatch of fns) {
|
|
8944
|
+
const state2 = isMatch(str);
|
|
8945
|
+
if (state2)
|
|
8946
|
+
return state2;
|
|
8947
|
+
}
|
|
8948
|
+
return false;
|
|
8949
|
+
};
|
|
8950
|
+
return arrayMatcher;
|
|
8951
|
+
}
|
|
8952
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
8953
|
+
if (glob === "" || typeof glob !== "string" && !isState) {
|
|
8954
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
8955
|
+
}
|
|
8956
|
+
const opts = options || {};
|
|
8957
|
+
const posix = utils.isWindows(options);
|
|
8958
|
+
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
8959
|
+
const state = regex.state;
|
|
8960
|
+
delete regex.state;
|
|
8961
|
+
let isIgnored = () => false;
|
|
8962
|
+
if (opts.ignore) {
|
|
8963
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
8964
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
8965
|
+
}
|
|
8966
|
+
const matcher = (input, returnObject = false) => {
|
|
8967
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
8968
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
8969
|
+
if (typeof opts.onResult === "function") {
|
|
8970
|
+
opts.onResult(result);
|
|
8971
|
+
}
|
|
8972
|
+
if (isMatch === false) {
|
|
8973
|
+
result.isMatch = false;
|
|
8974
|
+
return returnObject ? result : false;
|
|
8975
|
+
}
|
|
8976
|
+
if (isIgnored(input)) {
|
|
8977
|
+
if (typeof opts.onIgnore === "function") {
|
|
8978
|
+
opts.onIgnore(result);
|
|
8979
|
+
}
|
|
8980
|
+
result.isMatch = false;
|
|
8981
|
+
return returnObject ? result : false;
|
|
8982
|
+
}
|
|
8983
|
+
if (typeof opts.onMatch === "function") {
|
|
8984
|
+
opts.onMatch(result);
|
|
8985
|
+
}
|
|
8986
|
+
return returnObject ? result : true;
|
|
8987
|
+
};
|
|
8988
|
+
if (returnState) {
|
|
8989
|
+
matcher.state = state;
|
|
8990
|
+
}
|
|
8991
|
+
return matcher;
|
|
8992
|
+
};
|
|
8993
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
8994
|
+
if (typeof input !== "string") {
|
|
8995
|
+
throw new TypeError("Expected input to be a string");
|
|
8996
|
+
}
|
|
8997
|
+
if (input === "") {
|
|
8998
|
+
return { isMatch: false, output: "" };
|
|
8999
|
+
}
|
|
9000
|
+
const opts = options || {};
|
|
9001
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
9002
|
+
let match = input === glob;
|
|
9003
|
+
let output = match && format ? format(input) : input;
|
|
9004
|
+
if (match === false) {
|
|
9005
|
+
output = format ? format(input) : input;
|
|
9006
|
+
match = output === glob;
|
|
9007
|
+
}
|
|
9008
|
+
if (match === false || opts.capture === true) {
|
|
9009
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
9010
|
+
match = picomatch.matchBase(input, regex, options, posix);
|
|
9011
|
+
} else {
|
|
9012
|
+
match = regex.exec(output);
|
|
9013
|
+
}
|
|
9014
|
+
}
|
|
9015
|
+
return { isMatch: Boolean(match), match, output };
|
|
9016
|
+
};
|
|
9017
|
+
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
9018
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
9019
|
+
return regex.test(path3.basename(input));
|
|
9020
|
+
};
|
|
9021
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
9022
|
+
picomatch.parse = (pattern, options) => {
|
|
9023
|
+
if (Array.isArray(pattern))
|
|
9024
|
+
return pattern.map((p) => picomatch.parse(p, options));
|
|
9025
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
9026
|
+
};
|
|
9027
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
9028
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
9029
|
+
if (returnOutput === true) {
|
|
9030
|
+
return state.output;
|
|
9031
|
+
}
|
|
9032
|
+
const opts = options || {};
|
|
9033
|
+
const prepend = opts.contains ? "" : "^";
|
|
9034
|
+
const append = opts.contains ? "" : "$";
|
|
9035
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
9036
|
+
if (state && state.negated === true) {
|
|
9037
|
+
source = `^(?!${source}).*$`;
|
|
9038
|
+
}
|
|
9039
|
+
const regex = picomatch.toRegex(source, options);
|
|
9040
|
+
if (returnState === true) {
|
|
9041
|
+
regex.state = state;
|
|
9042
|
+
}
|
|
9043
|
+
return regex;
|
|
9044
|
+
};
|
|
9045
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
9046
|
+
if (!input || typeof input !== "string") {
|
|
9047
|
+
throw new TypeError("Expected a non-empty string");
|
|
9048
|
+
}
|
|
9049
|
+
let parsed = { negated: false, fastpaths: true };
|
|
9050
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
9051
|
+
parsed.output = parse.fastpaths(input, options);
|
|
9052
|
+
}
|
|
9053
|
+
if (!parsed.output) {
|
|
9054
|
+
parsed = parse(input, options);
|
|
9055
|
+
}
|
|
9056
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
9057
|
+
};
|
|
9058
|
+
picomatch.toRegex = (source, options) => {
|
|
9059
|
+
try {
|
|
9060
|
+
const opts = options || {};
|
|
9061
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
9062
|
+
} catch (err) {
|
|
9063
|
+
if (options && options.debug === true)
|
|
9064
|
+
throw err;
|
|
9065
|
+
return /$^/;
|
|
9066
|
+
}
|
|
9067
|
+
};
|
|
9068
|
+
picomatch.constants = constants;
|
|
9069
|
+
module2.exports = picomatch;
|
|
9070
|
+
}
|
|
9071
|
+
});
|
|
9072
|
+
|
|
9073
|
+
// ../../node_modules/picomatch/index.js
|
|
9074
|
+
var require_picomatch2 = __commonJS({
|
|
9075
|
+
"../../node_modules/picomatch/index.js"(exports, module2) {
|
|
9076
|
+
"use strict";
|
|
9077
|
+
module2.exports = require_picomatch();
|
|
9078
|
+
}
|
|
9079
|
+
});
|
|
9080
|
+
|
|
9081
|
+
// ../../node_modules/readdirp/index.js
|
|
9082
|
+
var require_readdirp = __commonJS({
|
|
9083
|
+
"../../node_modules/readdirp/index.js"(exports, module2) {
|
|
9084
|
+
"use strict";
|
|
9085
|
+
var fs3 = require("fs");
|
|
9086
|
+
var { Readable } = require("stream");
|
|
9087
|
+
var sysPath = require("path");
|
|
9088
|
+
var { promisify: promisify2 } = require("util");
|
|
9089
|
+
var picomatch = require_picomatch2();
|
|
9090
|
+
var readdir = promisify2(fs3.readdir);
|
|
9091
|
+
var stat = promisify2(fs3.stat);
|
|
9092
|
+
var lstat = promisify2(fs3.lstat);
|
|
9093
|
+
var realpath = promisify2(fs3.realpath);
|
|
9094
|
+
var BANG = "!";
|
|
9095
|
+
var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
9096
|
+
var NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
9097
|
+
var FILE_TYPE = "files";
|
|
9098
|
+
var DIR_TYPE = "directories";
|
|
9099
|
+
var FILE_DIR_TYPE = "files_directories";
|
|
9100
|
+
var EVERYTHING_TYPE = "all";
|
|
9101
|
+
var ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
|
|
9102
|
+
var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
|
|
9103
|
+
var [maj, min] = process.versions.node.split(".").slice(0, 2).map((n) => Number.parseInt(n, 10));
|
|
9104
|
+
var wantBigintFsStats = process.platform === "win32" && (maj > 10 || maj === 10 && min >= 5);
|
|
9105
|
+
var normalizeFilter = (filter) => {
|
|
9106
|
+
if (filter === void 0)
|
|
9107
|
+
return;
|
|
9108
|
+
if (typeof filter === "function")
|
|
9109
|
+
return filter;
|
|
9110
|
+
if (typeof filter === "string") {
|
|
9111
|
+
const glob = picomatch(filter.trim());
|
|
9112
|
+
return (entry) => glob(entry.basename);
|
|
9113
|
+
}
|
|
9114
|
+
if (Array.isArray(filter)) {
|
|
9115
|
+
const positive = [];
|
|
9116
|
+
const negative = [];
|
|
9117
|
+
for (const item of filter) {
|
|
9118
|
+
const trimmed = item.trim();
|
|
9119
|
+
if (trimmed.charAt(0) === BANG) {
|
|
9120
|
+
negative.push(picomatch(trimmed.slice(1)));
|
|
9121
|
+
} else {
|
|
9122
|
+
positive.push(picomatch(trimmed));
|
|
9123
|
+
}
|
|
9124
|
+
}
|
|
9125
|
+
if (negative.length > 0) {
|
|
9126
|
+
if (positive.length > 0) {
|
|
9127
|
+
return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename));
|
|
9128
|
+
}
|
|
9129
|
+
return (entry) => !negative.some((f) => f(entry.basename));
|
|
9130
|
+
}
|
|
9131
|
+
return (entry) => positive.some((f) => f(entry.basename));
|
|
9132
|
+
}
|
|
9133
|
+
};
|
|
9134
|
+
var ReaddirpStream = class extends Readable {
|
|
9135
|
+
static get defaultOptions() {
|
|
9136
|
+
return {
|
|
9137
|
+
root: ".",
|
|
9138
|
+
fileFilter: (path3) => true,
|
|
9139
|
+
directoryFilter: (path3) => true,
|
|
9140
|
+
type: FILE_TYPE,
|
|
9141
|
+
lstat: false,
|
|
9142
|
+
depth: 2147483648,
|
|
9143
|
+
alwaysStat: false
|
|
9144
|
+
};
|
|
9145
|
+
}
|
|
9146
|
+
constructor(options = {}) {
|
|
9147
|
+
super({
|
|
9148
|
+
objectMode: true,
|
|
9149
|
+
autoDestroy: true,
|
|
9150
|
+
highWaterMark: options.highWaterMark || 4096
|
|
9151
|
+
});
|
|
9152
|
+
const opts = { ...ReaddirpStream.defaultOptions, ...options };
|
|
9153
|
+
const { root, type } = opts;
|
|
9154
|
+
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
9155
|
+
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
9156
|
+
const statMethod = opts.lstat ? lstat : stat;
|
|
9157
|
+
if (wantBigintFsStats) {
|
|
9158
|
+
this._stat = (path3) => statMethod(path3, { bigint: true });
|
|
9159
|
+
} else {
|
|
9160
|
+
this._stat = statMethod;
|
|
9161
|
+
}
|
|
9162
|
+
this._maxDepth = opts.depth;
|
|
9163
|
+
this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
|
9164
|
+
this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
|
9165
|
+
this._wantsEverything = type === EVERYTHING_TYPE;
|
|
9166
|
+
this._root = sysPath.resolve(root);
|
|
9167
|
+
this._isDirent = "Dirent" in fs3 && !opts.alwaysStat;
|
|
9168
|
+
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
9169
|
+
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
9170
|
+
this.parents = [this._exploreDir(root, 1)];
|
|
9171
|
+
this.reading = false;
|
|
9172
|
+
this.parent = void 0;
|
|
9173
|
+
}
|
|
9174
|
+
async _read(batch) {
|
|
9175
|
+
if (this.reading)
|
|
9176
|
+
return;
|
|
9177
|
+
this.reading = true;
|
|
9178
|
+
try {
|
|
9179
|
+
while (!this.destroyed && batch > 0) {
|
|
9180
|
+
const { path: path3, depth, files = [] } = this.parent || {};
|
|
9181
|
+
if (files.length > 0) {
|
|
9182
|
+
const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path3));
|
|
9183
|
+
for (const entry of await Promise.all(slice)) {
|
|
9184
|
+
if (this.destroyed)
|
|
9185
|
+
return;
|
|
9186
|
+
const entryType = await this._getEntryType(entry);
|
|
9187
|
+
if (entryType === "directory" && this._directoryFilter(entry)) {
|
|
9188
|
+
if (depth <= this._maxDepth) {
|
|
9189
|
+
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
|
|
9190
|
+
}
|
|
9191
|
+
if (this._wantsDir) {
|
|
9192
|
+
this.push(entry);
|
|
9193
|
+
batch--;
|
|
9194
|
+
}
|
|
9195
|
+
} else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
|
9196
|
+
if (this._wantsFile) {
|
|
9197
|
+
this.push(entry);
|
|
9198
|
+
batch--;
|
|
9199
|
+
}
|
|
9200
|
+
}
|
|
9201
|
+
}
|
|
9202
|
+
} else {
|
|
9203
|
+
const parent = this.parents.pop();
|
|
9204
|
+
if (!parent) {
|
|
9205
|
+
this.push(null);
|
|
9206
|
+
break;
|
|
9207
|
+
}
|
|
9208
|
+
this.parent = await parent;
|
|
9209
|
+
if (this.destroyed)
|
|
9210
|
+
return;
|
|
9211
|
+
}
|
|
9212
|
+
}
|
|
9213
|
+
} catch (error) {
|
|
9214
|
+
this.destroy(error);
|
|
9215
|
+
} finally {
|
|
9216
|
+
this.reading = false;
|
|
9217
|
+
}
|
|
9218
|
+
}
|
|
9219
|
+
async _exploreDir(path3, depth) {
|
|
9220
|
+
let files;
|
|
9221
|
+
try {
|
|
9222
|
+
files = await readdir(path3, this._rdOptions);
|
|
9223
|
+
} catch (error) {
|
|
9224
|
+
this._onError(error);
|
|
9225
|
+
}
|
|
9226
|
+
return { files, depth, path: path3 };
|
|
9227
|
+
}
|
|
9228
|
+
async _formatEntry(dirent, path3) {
|
|
9229
|
+
let entry;
|
|
9230
|
+
try {
|
|
9231
|
+
const basename = this._isDirent ? dirent.name : dirent;
|
|
9232
|
+
const fullPath = sysPath.resolve(sysPath.join(path3, basename));
|
|
9233
|
+
entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename };
|
|
9234
|
+
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
9235
|
+
} catch (err) {
|
|
9236
|
+
this._onError(err);
|
|
9237
|
+
}
|
|
9238
|
+
return entry;
|
|
9239
|
+
}
|
|
9240
|
+
_onError(err) {
|
|
9241
|
+
if (isNormalFlowError(err) && !this.destroyed) {
|
|
9242
|
+
this.emit("warn", err);
|
|
9243
|
+
} else {
|
|
9244
|
+
this.destroy(err);
|
|
9245
|
+
}
|
|
9246
|
+
}
|
|
9247
|
+
async _getEntryType(entry) {
|
|
9248
|
+
const stats = entry && entry[this._statsProp];
|
|
9249
|
+
if (!stats) {
|
|
9250
|
+
return;
|
|
9251
|
+
}
|
|
9252
|
+
if (stats.isFile()) {
|
|
9253
|
+
return "file";
|
|
9254
|
+
}
|
|
9255
|
+
if (stats.isDirectory()) {
|
|
9256
|
+
return "directory";
|
|
9257
|
+
}
|
|
9258
|
+
if (stats && stats.isSymbolicLink()) {
|
|
9259
|
+
const full = entry.fullPath;
|
|
9260
|
+
try {
|
|
9261
|
+
const entryRealPath = await realpath(full);
|
|
9262
|
+
const entryRealPathStats = await lstat(entryRealPath);
|
|
9263
|
+
if (entryRealPathStats.isFile()) {
|
|
9264
|
+
return "file";
|
|
9265
|
+
}
|
|
9266
|
+
if (entryRealPathStats.isDirectory()) {
|
|
9267
|
+
const len = entryRealPath.length;
|
|
9268
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
|
|
9269
|
+
const recursiveError = new Error(
|
|
9270
|
+
`Circular symlink detected: "${full}" points to "${entryRealPath}"`
|
|
9271
|
+
);
|
|
9272
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
9273
|
+
return this._onError(recursiveError);
|
|
9274
|
+
}
|
|
9275
|
+
return "directory";
|
|
9276
|
+
}
|
|
9277
|
+
} catch (error) {
|
|
9278
|
+
this._onError(error);
|
|
9279
|
+
}
|
|
9280
|
+
}
|
|
9281
|
+
}
|
|
9282
|
+
_includeAsFile(entry) {
|
|
9283
|
+
const stats = entry && entry[this._statsProp];
|
|
9284
|
+
return stats && this._wantsEverything && !stats.isDirectory();
|
|
9285
|
+
}
|
|
9286
|
+
};
|
|
9287
|
+
var readdirp = (root, options = {}) => {
|
|
9288
|
+
let type = options.entryType || options.type;
|
|
9289
|
+
if (type === "both")
|
|
9290
|
+
type = FILE_DIR_TYPE;
|
|
9291
|
+
if (type)
|
|
9292
|
+
options.type = type;
|
|
9293
|
+
if (!root) {
|
|
9294
|
+
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
9295
|
+
} else if (typeof root !== "string") {
|
|
9296
|
+
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
9297
|
+
} else if (type && !ALL_TYPES.includes(type)) {
|
|
9298
|
+
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
9299
|
+
}
|
|
9300
|
+
options.root = root;
|
|
9301
|
+
return new ReaddirpStream(options);
|
|
9302
|
+
};
|
|
9303
|
+
var readdirpPromise = (root, options = {}) => {
|
|
9304
|
+
return new Promise((resolve, reject) => {
|
|
9305
|
+
const files = [];
|
|
9306
|
+
readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
|
|
9307
|
+
});
|
|
9308
|
+
};
|
|
9309
|
+
readdirp.promise = readdirpPromise;
|
|
9310
|
+
readdirp.ReaddirpStream = ReaddirpStream;
|
|
9311
|
+
readdirp.default = readdirp;
|
|
9312
|
+
module2.exports = readdirp;
|
|
9313
|
+
}
|
|
9314
|
+
});
|
|
9315
|
+
|
|
9316
|
+
// ../../node_modules/normalize-path/index.js
|
|
9317
|
+
var require_normalize_path = __commonJS({
|
|
9318
|
+
"../../node_modules/normalize-path/index.js"(exports, module2) {
|
|
9319
|
+
module2.exports = function(path3, stripTrailing) {
|
|
9320
|
+
if (typeof path3 !== "string") {
|
|
9321
|
+
throw new TypeError("expected path to be a string");
|
|
9322
|
+
}
|
|
9323
|
+
if (path3 === "\\" || path3 === "/")
|
|
9324
|
+
return "/";
|
|
9325
|
+
var len = path3.length;
|
|
9326
|
+
if (len <= 1)
|
|
9327
|
+
return path3;
|
|
9328
|
+
var prefix = "";
|
|
9329
|
+
if (len > 4 && path3[3] === "\\") {
|
|
9330
|
+
var ch = path3[2];
|
|
9331
|
+
if ((ch === "?" || ch === ".") && path3.slice(0, 2) === "\\\\") {
|
|
9332
|
+
path3 = path3.slice(2);
|
|
9333
|
+
prefix = "//";
|
|
9334
|
+
}
|
|
9335
|
+
}
|
|
9336
|
+
var segs = path3.split(/[/\\]+/);
|
|
9337
|
+
if (stripTrailing !== false && segs[segs.length - 1] === "") {
|
|
9338
|
+
segs.pop();
|
|
9339
|
+
}
|
|
9340
|
+
return prefix + segs.join("/");
|
|
9341
|
+
};
|
|
9342
|
+
}
|
|
9343
|
+
});
|
|
9344
|
+
|
|
9345
|
+
// ../../node_modules/anymatch/index.js
|
|
9346
|
+
var require_anymatch = __commonJS({
|
|
9347
|
+
"../../node_modules/anymatch/index.js"(exports, module2) {
|
|
9348
|
+
"use strict";
|
|
9349
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9350
|
+
var picomatch = require_picomatch2();
|
|
9351
|
+
var normalizePath = require_normalize_path();
|
|
9352
|
+
var BANG = "!";
|
|
9353
|
+
var DEFAULT_OPTIONS = { returnIndex: false };
|
|
9354
|
+
var arrify = (item) => Array.isArray(item) ? item : [item];
|
|
9355
|
+
var createPattern = (matcher, options) => {
|
|
9356
|
+
if (typeof matcher === "function") {
|
|
9357
|
+
return matcher;
|
|
9358
|
+
}
|
|
9359
|
+
if (typeof matcher === "string") {
|
|
9360
|
+
const glob = picomatch(matcher, options);
|
|
9361
|
+
return (string) => matcher === string || glob(string);
|
|
9362
|
+
}
|
|
9363
|
+
if (matcher instanceof RegExp) {
|
|
9364
|
+
return (string) => matcher.test(string);
|
|
9365
|
+
}
|
|
9366
|
+
return (string) => false;
|
|
9367
|
+
};
|
|
9368
|
+
var matchPatterns = (patterns, negPatterns, args2, returnIndex) => {
|
|
9369
|
+
const isList = Array.isArray(args2);
|
|
9370
|
+
const _path = isList ? args2[0] : args2;
|
|
9371
|
+
if (!isList && typeof _path !== "string") {
|
|
9372
|
+
throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(_path));
|
|
9373
|
+
}
|
|
9374
|
+
const path3 = normalizePath(_path);
|
|
9375
|
+
for (let index = 0; index < negPatterns.length; index++) {
|
|
9376
|
+
const nglob = negPatterns[index];
|
|
9377
|
+
if (nglob(path3)) {
|
|
9378
|
+
return returnIndex ? -1 : false;
|
|
9379
|
+
}
|
|
9380
|
+
}
|
|
9381
|
+
const applied = isList && [path3].concat(args2.slice(1));
|
|
9382
|
+
for (let index = 0; index < patterns.length; index++) {
|
|
9383
|
+
const pattern = patterns[index];
|
|
9384
|
+
if (isList ? pattern(...applied) : pattern(path3)) {
|
|
9385
|
+
return returnIndex ? index : true;
|
|
9386
|
+
}
|
|
9387
|
+
}
|
|
9388
|
+
return returnIndex ? -1 : false;
|
|
9389
|
+
};
|
|
9390
|
+
var anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
9391
|
+
if (matchers == null) {
|
|
9392
|
+
throw new TypeError("anymatch: specify first argument");
|
|
9393
|
+
}
|
|
9394
|
+
const opts = typeof options === "boolean" ? { returnIndex: options } : options;
|
|
9395
|
+
const returnIndex = opts.returnIndex || false;
|
|
9396
|
+
const mtchers = arrify(matchers);
|
|
9397
|
+
const negatedGlobs = mtchers.filter((item) => typeof item === "string" && item.charAt(0) === BANG).map((item) => item.slice(1)).map((item) => picomatch(item, opts));
|
|
9398
|
+
const patterns = mtchers.filter((item) => typeof item !== "string" || typeof item === "string" && item.charAt(0) !== BANG).map((matcher) => createPattern(matcher, opts));
|
|
9399
|
+
if (testString == null) {
|
|
9400
|
+
return (testString2, ri = false) => {
|
|
9401
|
+
const returnIndex2 = typeof ri === "boolean" ? ri : false;
|
|
9402
|
+
return matchPatterns(patterns, negatedGlobs, testString2, returnIndex2);
|
|
9403
|
+
};
|
|
9404
|
+
}
|
|
9405
|
+
return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
|
|
9406
|
+
};
|
|
9407
|
+
anymatch.default = anymatch;
|
|
9408
|
+
module2.exports = anymatch;
|
|
9409
|
+
}
|
|
9410
|
+
});
|
|
9411
|
+
|
|
9412
|
+
// ../../node_modules/is-extglob/index.js
|
|
9413
|
+
var require_is_extglob = __commonJS({
|
|
9414
|
+
"../../node_modules/is-extglob/index.js"(exports, module2) {
|
|
9415
|
+
module2.exports = function isExtglob(str) {
|
|
9416
|
+
if (typeof str !== "string" || str === "") {
|
|
9417
|
+
return false;
|
|
9418
|
+
}
|
|
9419
|
+
var match;
|
|
9420
|
+
while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
|
|
9421
|
+
if (match[2])
|
|
9422
|
+
return true;
|
|
9423
|
+
str = str.slice(match.index + match[0].length);
|
|
9424
|
+
}
|
|
9425
|
+
return false;
|
|
9426
|
+
};
|
|
9427
|
+
}
|
|
9428
|
+
});
|
|
9429
|
+
|
|
9430
|
+
// ../../node_modules/is-glob/index.js
|
|
9431
|
+
var require_is_glob = __commonJS({
|
|
9432
|
+
"../../node_modules/is-glob/index.js"(exports, module2) {
|
|
9433
|
+
var isExtglob = require_is_extglob();
|
|
9434
|
+
var chars = { "{": "}", "(": ")", "[": "]" };
|
|
9435
|
+
var strictCheck = function(str) {
|
|
9436
|
+
if (str[0] === "!") {
|
|
9437
|
+
return true;
|
|
9438
|
+
}
|
|
9439
|
+
var index = 0;
|
|
9440
|
+
var pipeIndex = -2;
|
|
9441
|
+
var closeSquareIndex = -2;
|
|
9442
|
+
var closeCurlyIndex = -2;
|
|
9443
|
+
var closeParenIndex = -2;
|
|
9444
|
+
var backSlashIndex = -2;
|
|
9445
|
+
while (index < str.length) {
|
|
9446
|
+
if (str[index] === "*") {
|
|
9447
|
+
return true;
|
|
9448
|
+
}
|
|
9449
|
+
if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
|
|
9450
|
+
return true;
|
|
9451
|
+
}
|
|
9452
|
+
if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
|
|
9453
|
+
if (closeSquareIndex < index) {
|
|
9454
|
+
closeSquareIndex = str.indexOf("]", index);
|
|
9455
|
+
}
|
|
9456
|
+
if (closeSquareIndex > index) {
|
|
9457
|
+
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
|
|
9458
|
+
return true;
|
|
9459
|
+
}
|
|
9460
|
+
backSlashIndex = str.indexOf("\\", index);
|
|
9461
|
+
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
|
|
9462
|
+
return true;
|
|
9463
|
+
}
|
|
9464
|
+
}
|
|
9465
|
+
}
|
|
9466
|
+
if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
|
|
9467
|
+
closeCurlyIndex = str.indexOf("}", index);
|
|
9468
|
+
if (closeCurlyIndex > index) {
|
|
9469
|
+
backSlashIndex = str.indexOf("\\", index);
|
|
9470
|
+
if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
|
|
9471
|
+
return true;
|
|
9472
|
+
}
|
|
9473
|
+
}
|
|
9474
|
+
}
|
|
9475
|
+
if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
|
|
9476
|
+
closeParenIndex = str.indexOf(")", index);
|
|
9477
|
+
if (closeParenIndex > index) {
|
|
9478
|
+
backSlashIndex = str.indexOf("\\", index);
|
|
9479
|
+
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
|
|
9480
|
+
return true;
|
|
9481
|
+
}
|
|
9482
|
+
}
|
|
9483
|
+
}
|
|
9484
|
+
if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
|
|
9485
|
+
if (pipeIndex < index) {
|
|
9486
|
+
pipeIndex = str.indexOf("|", index);
|
|
9487
|
+
}
|
|
9488
|
+
if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
|
|
9489
|
+
closeParenIndex = str.indexOf(")", pipeIndex);
|
|
9490
|
+
if (closeParenIndex > pipeIndex) {
|
|
9491
|
+
backSlashIndex = str.indexOf("\\", pipeIndex);
|
|
9492
|
+
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
|
|
9493
|
+
return true;
|
|
9494
|
+
}
|
|
9495
|
+
}
|
|
9496
|
+
}
|
|
9497
|
+
}
|
|
9498
|
+
if (str[index] === "\\") {
|
|
9499
|
+
var open = str[index + 1];
|
|
9500
|
+
index += 2;
|
|
9501
|
+
var close = chars[open];
|
|
9502
|
+
if (close) {
|
|
9503
|
+
var n = str.indexOf(close, index);
|
|
9504
|
+
if (n !== -1) {
|
|
9505
|
+
index = n + 1;
|
|
9506
|
+
}
|
|
9507
|
+
}
|
|
9508
|
+
if (str[index] === "!") {
|
|
9509
|
+
return true;
|
|
9510
|
+
}
|
|
9511
|
+
} else {
|
|
9512
|
+
index++;
|
|
9513
|
+
}
|
|
9514
|
+
}
|
|
9515
|
+
return false;
|
|
9516
|
+
};
|
|
9517
|
+
var relaxedCheck = function(str) {
|
|
9518
|
+
if (str[0] === "!") {
|
|
9519
|
+
return true;
|
|
9520
|
+
}
|
|
9521
|
+
var index = 0;
|
|
9522
|
+
while (index < str.length) {
|
|
9523
|
+
if (/[*?{}()[\]]/.test(str[index])) {
|
|
9524
|
+
return true;
|
|
9525
|
+
}
|
|
9526
|
+
if (str[index] === "\\") {
|
|
9527
|
+
var open = str[index + 1];
|
|
9528
|
+
index += 2;
|
|
9529
|
+
var close = chars[open];
|
|
9530
|
+
if (close) {
|
|
9531
|
+
var n = str.indexOf(close, index);
|
|
9532
|
+
if (n !== -1) {
|
|
9533
|
+
index = n + 1;
|
|
9534
|
+
}
|
|
9535
|
+
}
|
|
9536
|
+
if (str[index] === "!") {
|
|
9537
|
+
return true;
|
|
9538
|
+
}
|
|
9539
|
+
} else {
|
|
9540
|
+
index++;
|
|
9541
|
+
}
|
|
9542
|
+
}
|
|
9543
|
+
return false;
|
|
9544
|
+
};
|
|
9545
|
+
module2.exports = function isGlob(str, options) {
|
|
9546
|
+
if (typeof str !== "string" || str === "") {
|
|
9547
|
+
return false;
|
|
9548
|
+
}
|
|
9549
|
+
if (isExtglob(str)) {
|
|
9550
|
+
return true;
|
|
9551
|
+
}
|
|
9552
|
+
var check = strictCheck;
|
|
9553
|
+
if (options && options.strict === false) {
|
|
9554
|
+
check = relaxedCheck;
|
|
9555
|
+
}
|
|
9556
|
+
return check(str);
|
|
9557
|
+
};
|
|
9558
|
+
}
|
|
9559
|
+
});
|
|
9560
|
+
|
|
9561
|
+
// ../../node_modules/glob-parent/index.js
|
|
9562
|
+
var require_glob_parent = __commonJS({
|
|
9563
|
+
"../../node_modules/glob-parent/index.js"(exports, module2) {
|
|
9564
|
+
"use strict";
|
|
9565
|
+
var isGlob = require_is_glob();
|
|
9566
|
+
var pathPosixDirname = require("path").posix.dirname;
|
|
9567
|
+
var isWin32 = require("os").platform() === "win32";
|
|
9568
|
+
var slash = "/";
|
|
9569
|
+
var backslash = /\\/g;
|
|
9570
|
+
var enclosure = /[\{\[].*[\}\]]$/;
|
|
9571
|
+
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
|
9572
|
+
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
9573
|
+
module2.exports = function globParent(str, opts) {
|
|
9574
|
+
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
9575
|
+
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
|
9576
|
+
str = str.replace(backslash, slash);
|
|
9577
|
+
}
|
|
9578
|
+
if (enclosure.test(str)) {
|
|
9579
|
+
str += slash;
|
|
9580
|
+
}
|
|
9581
|
+
str += "a";
|
|
9582
|
+
do {
|
|
9583
|
+
str = pathPosixDirname(str);
|
|
9584
|
+
} while (isGlob(str) || globby.test(str));
|
|
9585
|
+
return str.replace(escaped, "$1");
|
|
9586
|
+
};
|
|
9587
|
+
}
|
|
9588
|
+
});
|
|
9589
|
+
|
|
9590
|
+
// ../../node_modules/braces/lib/utils.js
|
|
9591
|
+
var require_utils2 = __commonJS({
|
|
9592
|
+
"../../node_modules/braces/lib/utils.js"(exports) {
|
|
9593
|
+
"use strict";
|
|
9594
|
+
exports.isInteger = (num) => {
|
|
9595
|
+
if (typeof num === "number") {
|
|
9596
|
+
return Number.isInteger(num);
|
|
9597
|
+
}
|
|
9598
|
+
if (typeof num === "string" && num.trim() !== "") {
|
|
9599
|
+
return Number.isInteger(Number(num));
|
|
9600
|
+
}
|
|
9601
|
+
return false;
|
|
9602
|
+
};
|
|
9603
|
+
exports.find = (node, type) => node.nodes.find((node2) => node2.type === type);
|
|
9604
|
+
exports.exceedsLimit = (min, max, step = 1, limit) => {
|
|
9605
|
+
if (limit === false)
|
|
9606
|
+
return false;
|
|
9607
|
+
if (!exports.isInteger(min) || !exports.isInteger(max))
|
|
9608
|
+
return false;
|
|
9609
|
+
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
9610
|
+
};
|
|
9611
|
+
exports.escapeNode = (block, n = 0, type) => {
|
|
9612
|
+
let node = block.nodes[n];
|
|
9613
|
+
if (!node)
|
|
9614
|
+
return;
|
|
9615
|
+
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
9616
|
+
if (node.escaped !== true) {
|
|
9617
|
+
node.value = "\\" + node.value;
|
|
9618
|
+
node.escaped = true;
|
|
9619
|
+
}
|
|
9620
|
+
}
|
|
9621
|
+
};
|
|
9622
|
+
exports.encloseBrace = (node) => {
|
|
9623
|
+
if (node.type !== "brace")
|
|
9624
|
+
return false;
|
|
9625
|
+
if (node.commas >> 0 + node.ranges >> 0 === 0) {
|
|
9626
|
+
node.invalid = true;
|
|
9627
|
+
return true;
|
|
9628
|
+
}
|
|
9629
|
+
return false;
|
|
9630
|
+
};
|
|
9631
|
+
exports.isInvalidBrace = (block) => {
|
|
9632
|
+
if (block.type !== "brace")
|
|
9633
|
+
return false;
|
|
9634
|
+
if (block.invalid === true || block.dollar)
|
|
9635
|
+
return true;
|
|
9636
|
+
if (block.commas >> 0 + block.ranges >> 0 === 0) {
|
|
9637
|
+
block.invalid = true;
|
|
9638
|
+
return true;
|
|
9639
|
+
}
|
|
9640
|
+
if (block.open !== true || block.close !== true) {
|
|
9641
|
+
block.invalid = true;
|
|
9642
|
+
return true;
|
|
9643
|
+
}
|
|
9644
|
+
return false;
|
|
9645
|
+
};
|
|
9646
|
+
exports.isOpenOrClose = (node) => {
|
|
9647
|
+
if (node.type === "open" || node.type === "close") {
|
|
9648
|
+
return true;
|
|
9649
|
+
}
|
|
9650
|
+
return node.open === true || node.close === true;
|
|
9651
|
+
};
|
|
9652
|
+
exports.reduce = (nodes) => nodes.reduce((acc, node) => {
|
|
9653
|
+
if (node.type === "text")
|
|
9654
|
+
acc.push(node.value);
|
|
9655
|
+
if (node.type === "range")
|
|
9656
|
+
node.type = "text";
|
|
9657
|
+
return acc;
|
|
9658
|
+
}, []);
|
|
9659
|
+
exports.flatten = (...args2) => {
|
|
9660
|
+
const result = [];
|
|
9661
|
+
const flat = (arr) => {
|
|
9662
|
+
for (let i = 0; i < arr.length; i++) {
|
|
9663
|
+
let ele = arr[i];
|
|
9664
|
+
Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
|
|
9665
|
+
}
|
|
9666
|
+
return result;
|
|
9667
|
+
};
|
|
9668
|
+
flat(args2);
|
|
9669
|
+
return result;
|
|
9670
|
+
};
|
|
9671
|
+
}
|
|
9672
|
+
});
|
|
9673
|
+
|
|
9674
|
+
// ../../node_modules/braces/lib/stringify.js
|
|
9675
|
+
var require_stringify = __commonJS({
|
|
9676
|
+
"../../node_modules/braces/lib/stringify.js"(exports, module2) {
|
|
9677
|
+
"use strict";
|
|
9678
|
+
var utils = require_utils2();
|
|
9679
|
+
module2.exports = (ast, options = {}) => {
|
|
9680
|
+
let stringify = (node, parent = {}) => {
|
|
9681
|
+
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
9682
|
+
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
9683
|
+
let output = "";
|
|
9684
|
+
if (node.value) {
|
|
9685
|
+
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
|
9686
|
+
return "\\" + node.value;
|
|
9687
|
+
}
|
|
9688
|
+
return node.value;
|
|
9689
|
+
}
|
|
9690
|
+
if (node.value) {
|
|
9691
|
+
return node.value;
|
|
9692
|
+
}
|
|
9693
|
+
if (node.nodes) {
|
|
9694
|
+
for (let child of node.nodes) {
|
|
9695
|
+
output += stringify(child);
|
|
9696
|
+
}
|
|
9697
|
+
}
|
|
9698
|
+
return output;
|
|
9699
|
+
};
|
|
9700
|
+
return stringify(ast);
|
|
9701
|
+
};
|
|
9702
|
+
}
|
|
9703
|
+
});
|
|
9704
|
+
|
|
9705
|
+
// ../../node_modules/is-number/index.js
|
|
9706
|
+
var require_is_number = __commonJS({
|
|
9707
|
+
"../../node_modules/is-number/index.js"(exports, module2) {
|
|
9708
|
+
"use strict";
|
|
9709
|
+
module2.exports = function(num) {
|
|
9710
|
+
if (typeof num === "number") {
|
|
9711
|
+
return num - num === 0;
|
|
9712
|
+
}
|
|
9713
|
+
if (typeof num === "string" && num.trim() !== "") {
|
|
9714
|
+
return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
|
9715
|
+
}
|
|
9716
|
+
return false;
|
|
9717
|
+
};
|
|
9718
|
+
}
|
|
9719
|
+
});
|
|
9720
|
+
|
|
9721
|
+
// ../../node_modules/to-regex-range/index.js
|
|
9722
|
+
var require_to_regex_range = __commonJS({
|
|
9723
|
+
"../../node_modules/to-regex-range/index.js"(exports, module2) {
|
|
9724
|
+
"use strict";
|
|
9725
|
+
var isNumber = require_is_number();
|
|
9726
|
+
var toRegexRange = (min, max, options) => {
|
|
9727
|
+
if (isNumber(min) === false) {
|
|
9728
|
+
throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
9729
|
+
}
|
|
9730
|
+
if (max === void 0 || min === max) {
|
|
9731
|
+
return String(min);
|
|
9732
|
+
}
|
|
9733
|
+
if (isNumber(max) === false) {
|
|
9734
|
+
throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
9735
|
+
}
|
|
9736
|
+
let opts = { relaxZeros: true, ...options };
|
|
9737
|
+
if (typeof opts.strictZeros === "boolean") {
|
|
9738
|
+
opts.relaxZeros = opts.strictZeros === false;
|
|
9739
|
+
}
|
|
9740
|
+
let relax = String(opts.relaxZeros);
|
|
9741
|
+
let shorthand = String(opts.shorthand);
|
|
9742
|
+
let capture = String(opts.capture);
|
|
9743
|
+
let wrap = String(opts.wrap);
|
|
9744
|
+
let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
|
|
9745
|
+
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
9746
|
+
return toRegexRange.cache[cacheKey].result;
|
|
9747
|
+
}
|
|
9748
|
+
let a = Math.min(min, max);
|
|
9749
|
+
let b = Math.max(min, max);
|
|
9750
|
+
if (Math.abs(a - b) === 1) {
|
|
9751
|
+
let result = min + "|" + max;
|
|
9752
|
+
if (opts.capture) {
|
|
9753
|
+
return `(${result})`;
|
|
9754
|
+
}
|
|
9755
|
+
if (opts.wrap === false) {
|
|
9756
|
+
return result;
|
|
9757
|
+
}
|
|
9758
|
+
return `(?:${result})`;
|
|
9759
|
+
}
|
|
9760
|
+
let isPadded = hasPadding(min) || hasPadding(max);
|
|
9761
|
+
let state = { min, max, a, b };
|
|
9762
|
+
let positives = [];
|
|
9763
|
+
let negatives = [];
|
|
9764
|
+
if (isPadded) {
|
|
9765
|
+
state.isPadded = isPadded;
|
|
9766
|
+
state.maxLen = String(state.max).length;
|
|
9767
|
+
}
|
|
9768
|
+
if (a < 0) {
|
|
9769
|
+
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
9770
|
+
negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
|
|
9771
|
+
a = state.a = 0;
|
|
9772
|
+
}
|
|
9773
|
+
if (b >= 0) {
|
|
9774
|
+
positives = splitToPatterns(a, b, state, opts);
|
|
9775
|
+
}
|
|
9776
|
+
state.negatives = negatives;
|
|
9777
|
+
state.positives = positives;
|
|
9778
|
+
state.result = collatePatterns(negatives, positives, opts);
|
|
9779
|
+
if (opts.capture === true) {
|
|
9780
|
+
state.result = `(${state.result})`;
|
|
9781
|
+
} else if (opts.wrap !== false && positives.length + negatives.length > 1) {
|
|
9782
|
+
state.result = `(?:${state.result})`;
|
|
9783
|
+
}
|
|
9784
|
+
toRegexRange.cache[cacheKey] = state;
|
|
9785
|
+
return state.result;
|
|
9786
|
+
};
|
|
9787
|
+
function collatePatterns(neg, pos, options) {
|
|
9788
|
+
let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
|
|
9789
|
+
let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
|
|
9790
|
+
let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
|
|
9791
|
+
let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
|
|
9792
|
+
return subpatterns.join("|");
|
|
9793
|
+
}
|
|
9794
|
+
function splitToRanges(min, max) {
|
|
9795
|
+
let nines = 1;
|
|
9796
|
+
let zeros = 1;
|
|
9797
|
+
let stop = countNines(min, nines);
|
|
9798
|
+
let stops = /* @__PURE__ */ new Set([max]);
|
|
9799
|
+
while (min <= stop && stop <= max) {
|
|
9800
|
+
stops.add(stop);
|
|
9801
|
+
nines += 1;
|
|
9802
|
+
stop = countNines(min, nines);
|
|
9803
|
+
}
|
|
9804
|
+
stop = countZeros(max + 1, zeros) - 1;
|
|
9805
|
+
while (min < stop && stop <= max) {
|
|
9806
|
+
stops.add(stop);
|
|
9807
|
+
zeros += 1;
|
|
9808
|
+
stop = countZeros(max + 1, zeros) - 1;
|
|
9809
|
+
}
|
|
9810
|
+
stops = [...stops];
|
|
9811
|
+
stops.sort(compare);
|
|
9812
|
+
return stops;
|
|
9813
|
+
}
|
|
9814
|
+
function rangeToPattern(start, stop, options) {
|
|
9815
|
+
if (start === stop) {
|
|
9816
|
+
return { pattern: start, count: [], digits: 0 };
|
|
9817
|
+
}
|
|
9818
|
+
let zipped = zip(start, stop);
|
|
9819
|
+
let digits = zipped.length;
|
|
9820
|
+
let pattern = "";
|
|
9821
|
+
let count = 0;
|
|
9822
|
+
for (let i = 0; i < digits; i++) {
|
|
9823
|
+
let [startDigit, stopDigit] = zipped[i];
|
|
9824
|
+
if (startDigit === stopDigit) {
|
|
9825
|
+
pattern += startDigit;
|
|
9826
|
+
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
9827
|
+
pattern += toCharacterClass(startDigit, stopDigit, options);
|
|
9828
|
+
} else {
|
|
9829
|
+
count++;
|
|
9830
|
+
}
|
|
9831
|
+
}
|
|
9832
|
+
if (count) {
|
|
9833
|
+
pattern += options.shorthand === true ? "\\d" : "[0-9]";
|
|
9834
|
+
}
|
|
9835
|
+
return { pattern, count: [count], digits };
|
|
9836
|
+
}
|
|
9837
|
+
function splitToPatterns(min, max, tok, options) {
|
|
9838
|
+
let ranges = splitToRanges(min, max);
|
|
9839
|
+
let tokens = [];
|
|
9840
|
+
let start = min;
|
|
9841
|
+
let prev;
|
|
9842
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
9843
|
+
let max2 = ranges[i];
|
|
9844
|
+
let obj = rangeToPattern(String(start), String(max2), options);
|
|
9845
|
+
let zeros = "";
|
|
9846
|
+
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
9847
|
+
if (prev.count.length > 1) {
|
|
9848
|
+
prev.count.pop();
|
|
9849
|
+
}
|
|
9850
|
+
prev.count.push(obj.count[0]);
|
|
9851
|
+
prev.string = prev.pattern + toQuantifier(prev.count);
|
|
9852
|
+
start = max2 + 1;
|
|
9853
|
+
continue;
|
|
9854
|
+
}
|
|
9855
|
+
if (tok.isPadded) {
|
|
9856
|
+
zeros = padZeros(max2, tok, options);
|
|
9857
|
+
}
|
|
9858
|
+
obj.string = zeros + obj.pattern + toQuantifier(obj.count);
|
|
9859
|
+
tokens.push(obj);
|
|
9860
|
+
start = max2 + 1;
|
|
9861
|
+
prev = obj;
|
|
9862
|
+
}
|
|
9863
|
+
return tokens;
|
|
9864
|
+
}
|
|
9865
|
+
function filterPatterns(arr, comparison, prefix, intersection, options) {
|
|
9866
|
+
let result = [];
|
|
9867
|
+
for (let ele of arr) {
|
|
9868
|
+
let { string } = ele;
|
|
9869
|
+
if (!intersection && !contains(comparison, "string", string)) {
|
|
9870
|
+
result.push(prefix + string);
|
|
9871
|
+
}
|
|
9872
|
+
if (intersection && contains(comparison, "string", string)) {
|
|
9873
|
+
result.push(prefix + string);
|
|
9874
|
+
}
|
|
9875
|
+
}
|
|
9876
|
+
return result;
|
|
9877
|
+
}
|
|
9878
|
+
function zip(a, b) {
|
|
9879
|
+
let arr = [];
|
|
9880
|
+
for (let i = 0; i < a.length; i++)
|
|
9881
|
+
arr.push([a[i], b[i]]);
|
|
9882
|
+
return arr;
|
|
9883
|
+
}
|
|
9884
|
+
function compare(a, b) {
|
|
9885
|
+
return a > b ? 1 : b > a ? -1 : 0;
|
|
9886
|
+
}
|
|
9887
|
+
function contains(arr, key, val) {
|
|
9888
|
+
return arr.some((ele) => ele[key] === val);
|
|
9889
|
+
}
|
|
9890
|
+
function countNines(min, len) {
|
|
9891
|
+
return Number(String(min).slice(0, -len) + "9".repeat(len));
|
|
9892
|
+
}
|
|
9893
|
+
function countZeros(integer, zeros) {
|
|
9894
|
+
return integer - integer % Math.pow(10, zeros);
|
|
9895
|
+
}
|
|
9896
|
+
function toQuantifier(digits) {
|
|
9897
|
+
let [start = 0, stop = ""] = digits;
|
|
9898
|
+
if (stop || start > 1) {
|
|
9899
|
+
return `{${start + (stop ? "," + stop : "")}}`;
|
|
9900
|
+
}
|
|
9901
|
+
return "";
|
|
9902
|
+
}
|
|
9903
|
+
function toCharacterClass(a, b, options) {
|
|
9904
|
+
return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
|
|
9905
|
+
}
|
|
9906
|
+
function hasPadding(str) {
|
|
9907
|
+
return /^-?(0+)\d/.test(str);
|
|
9908
|
+
}
|
|
9909
|
+
function padZeros(value, tok, options) {
|
|
9910
|
+
if (!tok.isPadded) {
|
|
9911
|
+
return value;
|
|
9912
|
+
}
|
|
9913
|
+
let diff = Math.abs(tok.maxLen - String(value).length);
|
|
9914
|
+
let relax = options.relaxZeros !== false;
|
|
9915
|
+
switch (diff) {
|
|
9916
|
+
case 0:
|
|
9917
|
+
return "";
|
|
9918
|
+
case 1:
|
|
9919
|
+
return relax ? "0?" : "0";
|
|
9920
|
+
case 2:
|
|
9921
|
+
return relax ? "0{0,2}" : "00";
|
|
9922
|
+
default: {
|
|
9923
|
+
return relax ? `0{0,${diff}}` : `0{${diff}}`;
|
|
9924
|
+
}
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9927
|
+
toRegexRange.cache = {};
|
|
9928
|
+
toRegexRange.clearCache = () => toRegexRange.cache = {};
|
|
9929
|
+
module2.exports = toRegexRange;
|
|
9930
|
+
}
|
|
9931
|
+
});
|
|
9932
|
+
|
|
9933
|
+
// ../../node_modules/fill-range/index.js
|
|
9934
|
+
var require_fill_range = __commonJS({
|
|
9935
|
+
"../../node_modules/fill-range/index.js"(exports, module2) {
|
|
9936
|
+
"use strict";
|
|
9937
|
+
var util = require("util");
|
|
9938
|
+
var toRegexRange = require_to_regex_range();
|
|
9939
|
+
var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
9940
|
+
var transform = (toNumber) => {
|
|
9941
|
+
return (value) => toNumber === true ? Number(value) : String(value);
|
|
9942
|
+
};
|
|
9943
|
+
var isValidValue = (value) => {
|
|
9944
|
+
return typeof value === "number" || typeof value === "string" && value !== "";
|
|
9945
|
+
};
|
|
9946
|
+
var isNumber = (num) => Number.isInteger(+num);
|
|
9947
|
+
var zeros = (input) => {
|
|
9948
|
+
let value = `${input}`;
|
|
9949
|
+
let index = -1;
|
|
9950
|
+
if (value[0] === "-")
|
|
9951
|
+
value = value.slice(1);
|
|
9952
|
+
if (value === "0")
|
|
9953
|
+
return false;
|
|
9954
|
+
while (value[++index] === "0")
|
|
9955
|
+
;
|
|
9956
|
+
return index > 0;
|
|
9957
|
+
};
|
|
9958
|
+
var stringify = (start, end, options) => {
|
|
9959
|
+
if (typeof start === "string" || typeof end === "string") {
|
|
9960
|
+
return true;
|
|
9961
|
+
}
|
|
9962
|
+
return options.stringify === true;
|
|
9963
|
+
};
|
|
9964
|
+
var pad = (input, maxLength, toNumber) => {
|
|
9965
|
+
if (maxLength > 0) {
|
|
9966
|
+
let dash = input[0] === "-" ? "-" : "";
|
|
9967
|
+
if (dash)
|
|
9968
|
+
input = input.slice(1);
|
|
9969
|
+
input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
|
|
9970
|
+
}
|
|
9971
|
+
if (toNumber === false) {
|
|
9972
|
+
return String(input);
|
|
9973
|
+
}
|
|
9974
|
+
return input;
|
|
9975
|
+
};
|
|
9976
|
+
var toMaxLen = (input, maxLength) => {
|
|
9977
|
+
let negative = input[0] === "-" ? "-" : "";
|
|
9978
|
+
if (negative) {
|
|
9979
|
+
input = input.slice(1);
|
|
9980
|
+
maxLength--;
|
|
9981
|
+
}
|
|
9982
|
+
while (input.length < maxLength)
|
|
9983
|
+
input = "0" + input;
|
|
9984
|
+
return negative ? "-" + input : input;
|
|
9985
|
+
};
|
|
9986
|
+
var toSequence = (parts, options) => {
|
|
9987
|
+
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
9988
|
+
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
9989
|
+
let prefix = options.capture ? "" : "?:";
|
|
9990
|
+
let positives = "";
|
|
9991
|
+
let negatives = "";
|
|
9992
|
+
let result;
|
|
9993
|
+
if (parts.positives.length) {
|
|
9994
|
+
positives = parts.positives.join("|");
|
|
9995
|
+
}
|
|
9996
|
+
if (parts.negatives.length) {
|
|
9997
|
+
negatives = `-(${prefix}${parts.negatives.join("|")})`;
|
|
9998
|
+
}
|
|
9999
|
+
if (positives && negatives) {
|
|
10000
|
+
result = `${positives}|${negatives}`;
|
|
10001
|
+
} else {
|
|
10002
|
+
result = positives || negatives;
|
|
10003
|
+
}
|
|
10004
|
+
if (options.wrap) {
|
|
10005
|
+
return `(${prefix}${result})`;
|
|
10006
|
+
}
|
|
10007
|
+
return result;
|
|
10008
|
+
};
|
|
10009
|
+
var toRange = (a, b, isNumbers, options) => {
|
|
10010
|
+
if (isNumbers) {
|
|
10011
|
+
return toRegexRange(a, b, { wrap: false, ...options });
|
|
10012
|
+
}
|
|
10013
|
+
let start = String.fromCharCode(a);
|
|
10014
|
+
if (a === b)
|
|
10015
|
+
return start;
|
|
10016
|
+
let stop = String.fromCharCode(b);
|
|
10017
|
+
return `[${start}-${stop}]`;
|
|
10018
|
+
};
|
|
10019
|
+
var toRegex = (start, end, options) => {
|
|
10020
|
+
if (Array.isArray(start)) {
|
|
10021
|
+
let wrap = options.wrap === true;
|
|
10022
|
+
let prefix = options.capture ? "" : "?:";
|
|
10023
|
+
return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
|
|
10024
|
+
}
|
|
10025
|
+
return toRegexRange(start, end, options);
|
|
10026
|
+
};
|
|
10027
|
+
var rangeError = (...args2) => {
|
|
10028
|
+
return new RangeError("Invalid range arguments: " + util.inspect(...args2));
|
|
10029
|
+
};
|
|
10030
|
+
var invalidRange = (start, end, options) => {
|
|
10031
|
+
if (options.strictRanges === true)
|
|
10032
|
+
throw rangeError([start, end]);
|
|
10033
|
+
return [];
|
|
10034
|
+
};
|
|
10035
|
+
var invalidStep = (step, options) => {
|
|
10036
|
+
if (options.strictRanges === true) {
|
|
10037
|
+
throw new TypeError(`Expected step "${step}" to be a number`);
|
|
10038
|
+
}
|
|
10039
|
+
return [];
|
|
10040
|
+
};
|
|
10041
|
+
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
10042
|
+
let a = Number(start);
|
|
10043
|
+
let b = Number(end);
|
|
10044
|
+
if (!Number.isInteger(a) || !Number.isInteger(b)) {
|
|
10045
|
+
if (options.strictRanges === true)
|
|
10046
|
+
throw rangeError([start, end]);
|
|
10047
|
+
return [];
|
|
10048
|
+
}
|
|
10049
|
+
if (a === 0)
|
|
10050
|
+
a = 0;
|
|
10051
|
+
if (b === 0)
|
|
10052
|
+
b = 0;
|
|
10053
|
+
let descending = a > b;
|
|
10054
|
+
let startString = String(start);
|
|
10055
|
+
let endString = String(end);
|
|
10056
|
+
let stepString = String(step);
|
|
10057
|
+
step = Math.max(Math.abs(step), 1);
|
|
10058
|
+
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
10059
|
+
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
10060
|
+
let toNumber = padded === false && stringify(start, end, options) === false;
|
|
10061
|
+
let format = options.transform || transform(toNumber);
|
|
10062
|
+
if (options.toRegex && step === 1) {
|
|
10063
|
+
return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
|
|
10064
|
+
}
|
|
10065
|
+
let parts = { negatives: [], positives: [] };
|
|
10066
|
+
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
10067
|
+
let range = [];
|
|
10068
|
+
let index = 0;
|
|
10069
|
+
while (descending ? a >= b : a <= b) {
|
|
10070
|
+
if (options.toRegex === true && step > 1) {
|
|
10071
|
+
push(a);
|
|
10072
|
+
} else {
|
|
10073
|
+
range.push(pad(format(a, index), maxLen, toNumber));
|
|
10074
|
+
}
|
|
10075
|
+
a = descending ? a - step : a + step;
|
|
10076
|
+
index++;
|
|
10077
|
+
}
|
|
10078
|
+
if (options.toRegex === true) {
|
|
10079
|
+
return step > 1 ? toSequence(parts, options) : toRegex(range, null, { wrap: false, ...options });
|
|
10080
|
+
}
|
|
10081
|
+
return range;
|
|
10082
|
+
};
|
|
10083
|
+
var fillLetters = (start, end, step = 1, options = {}) => {
|
|
10084
|
+
if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
|
|
10085
|
+
return invalidRange(start, end, options);
|
|
10086
|
+
}
|
|
10087
|
+
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
10088
|
+
let a = `${start}`.charCodeAt(0);
|
|
10089
|
+
let b = `${end}`.charCodeAt(0);
|
|
10090
|
+
let descending = a > b;
|
|
10091
|
+
let min = Math.min(a, b);
|
|
10092
|
+
let max = Math.max(a, b);
|
|
10093
|
+
if (options.toRegex && step === 1) {
|
|
10094
|
+
return toRange(min, max, false, options);
|
|
10095
|
+
}
|
|
10096
|
+
let range = [];
|
|
10097
|
+
let index = 0;
|
|
10098
|
+
while (descending ? a >= b : a <= b) {
|
|
10099
|
+
range.push(format(a, index));
|
|
10100
|
+
a = descending ? a - step : a + step;
|
|
10101
|
+
index++;
|
|
10102
|
+
}
|
|
10103
|
+
if (options.toRegex === true) {
|
|
10104
|
+
return toRegex(range, null, { wrap: false, options });
|
|
10105
|
+
}
|
|
10106
|
+
return range;
|
|
10107
|
+
};
|
|
10108
|
+
var fill = (start, end, step, options = {}) => {
|
|
10109
|
+
if (end == null && isValidValue(start)) {
|
|
10110
|
+
return [start];
|
|
10111
|
+
}
|
|
10112
|
+
if (!isValidValue(start) || !isValidValue(end)) {
|
|
10113
|
+
return invalidRange(start, end, options);
|
|
10114
|
+
}
|
|
10115
|
+
if (typeof step === "function") {
|
|
10116
|
+
return fill(start, end, 1, { transform: step });
|
|
10117
|
+
}
|
|
10118
|
+
if (isObject(step)) {
|
|
10119
|
+
return fill(start, end, 0, step);
|
|
10120
|
+
}
|
|
10121
|
+
let opts = { ...options };
|
|
10122
|
+
if (opts.capture === true)
|
|
10123
|
+
opts.wrap = true;
|
|
10124
|
+
step = step || opts.step || 1;
|
|
10125
|
+
if (!isNumber(step)) {
|
|
10126
|
+
if (step != null && !isObject(step))
|
|
10127
|
+
return invalidStep(step, opts);
|
|
10128
|
+
return fill(start, end, 1, step);
|
|
10129
|
+
}
|
|
10130
|
+
if (isNumber(start) && isNumber(end)) {
|
|
10131
|
+
return fillNumbers(start, end, step, opts);
|
|
10132
|
+
}
|
|
10133
|
+
return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
|
|
10134
|
+
};
|
|
10135
|
+
module2.exports = fill;
|
|
10136
|
+
}
|
|
10137
|
+
});
|
|
10138
|
+
|
|
10139
|
+
// ../../node_modules/braces/lib/compile.js
|
|
10140
|
+
var require_compile = __commonJS({
|
|
10141
|
+
"../../node_modules/braces/lib/compile.js"(exports, module2) {
|
|
10142
|
+
"use strict";
|
|
10143
|
+
var fill = require_fill_range();
|
|
10144
|
+
var utils = require_utils2();
|
|
10145
|
+
var compile = (ast, options = {}) => {
|
|
10146
|
+
let walk = (node, parent = {}) => {
|
|
10147
|
+
let invalidBlock = utils.isInvalidBrace(parent);
|
|
10148
|
+
let invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
10149
|
+
let invalid = invalidBlock === true || invalidNode === true;
|
|
10150
|
+
let prefix = options.escapeInvalid === true ? "\\" : "";
|
|
10151
|
+
let output = "";
|
|
10152
|
+
if (node.isOpen === true) {
|
|
10153
|
+
return prefix + node.value;
|
|
10154
|
+
}
|
|
10155
|
+
if (node.isClose === true) {
|
|
10156
|
+
return prefix + node.value;
|
|
10157
|
+
}
|
|
10158
|
+
if (node.type === "open") {
|
|
10159
|
+
return invalid ? prefix + node.value : "(";
|
|
10160
|
+
}
|
|
10161
|
+
if (node.type === "close") {
|
|
10162
|
+
return invalid ? prefix + node.value : ")";
|
|
10163
|
+
}
|
|
10164
|
+
if (node.type === "comma") {
|
|
10165
|
+
return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
|
|
10166
|
+
}
|
|
10167
|
+
if (node.value) {
|
|
10168
|
+
return node.value;
|
|
10169
|
+
}
|
|
10170
|
+
if (node.nodes && node.ranges > 0) {
|
|
10171
|
+
let args2 = utils.reduce(node.nodes);
|
|
10172
|
+
let range = fill(...args2, { ...options, wrap: false, toRegex: true });
|
|
10173
|
+
if (range.length !== 0) {
|
|
10174
|
+
return args2.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
10175
|
+
}
|
|
10176
|
+
}
|
|
10177
|
+
if (node.nodes) {
|
|
10178
|
+
for (let child of node.nodes) {
|
|
10179
|
+
output += walk(child, node);
|
|
10180
|
+
}
|
|
10181
|
+
}
|
|
10182
|
+
return output;
|
|
10183
|
+
};
|
|
10184
|
+
return walk(ast);
|
|
10185
|
+
};
|
|
10186
|
+
module2.exports = compile;
|
|
10187
|
+
}
|
|
10188
|
+
});
|
|
10189
|
+
|
|
10190
|
+
// ../../node_modules/braces/lib/expand.js
|
|
10191
|
+
var require_expand = __commonJS({
|
|
10192
|
+
"../../node_modules/braces/lib/expand.js"(exports, module2) {
|
|
10193
|
+
"use strict";
|
|
10194
|
+
var fill = require_fill_range();
|
|
10195
|
+
var stringify = require_stringify();
|
|
10196
|
+
var utils = require_utils2();
|
|
10197
|
+
var append = (queue = "", stash = "", enclose = false) => {
|
|
10198
|
+
let result = [];
|
|
10199
|
+
queue = [].concat(queue);
|
|
10200
|
+
stash = [].concat(stash);
|
|
10201
|
+
if (!stash.length)
|
|
10202
|
+
return queue;
|
|
10203
|
+
if (!queue.length) {
|
|
10204
|
+
return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
|
10205
|
+
}
|
|
10206
|
+
for (let item of queue) {
|
|
10207
|
+
if (Array.isArray(item)) {
|
|
10208
|
+
for (let value of item) {
|
|
10209
|
+
result.push(append(value, stash, enclose));
|
|
10210
|
+
}
|
|
10211
|
+
} else {
|
|
10212
|
+
for (let ele of stash) {
|
|
10213
|
+
if (enclose === true && typeof ele === "string")
|
|
10214
|
+
ele = `{${ele}}`;
|
|
10215
|
+
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
|
|
10216
|
+
}
|
|
10217
|
+
}
|
|
10218
|
+
}
|
|
10219
|
+
return utils.flatten(result);
|
|
10220
|
+
};
|
|
10221
|
+
var expand = (ast, options = {}) => {
|
|
10222
|
+
let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
10223
|
+
let walk = (node, parent = {}) => {
|
|
10224
|
+
node.queue = [];
|
|
10225
|
+
let p = parent;
|
|
10226
|
+
let q = parent.queue;
|
|
10227
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
10228
|
+
p = p.parent;
|
|
10229
|
+
q = p.queue;
|
|
10230
|
+
}
|
|
10231
|
+
if (node.invalid || node.dollar) {
|
|
10232
|
+
q.push(append(q.pop(), stringify(node, options)));
|
|
10233
|
+
return;
|
|
10234
|
+
}
|
|
10235
|
+
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
10236
|
+
q.push(append(q.pop(), ["{}"]));
|
|
10237
|
+
return;
|
|
10238
|
+
}
|
|
10239
|
+
if (node.nodes && node.ranges > 0) {
|
|
10240
|
+
let args2 = utils.reduce(node.nodes);
|
|
10241
|
+
if (utils.exceedsLimit(...args2, options.step, rangeLimit)) {
|
|
10242
|
+
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
10243
|
+
}
|
|
10244
|
+
let range = fill(...args2, options);
|
|
10245
|
+
if (range.length === 0) {
|
|
10246
|
+
range = stringify(node, options);
|
|
10247
|
+
}
|
|
10248
|
+
q.push(append(q.pop(), range));
|
|
10249
|
+
node.nodes = [];
|
|
10250
|
+
return;
|
|
10251
|
+
}
|
|
10252
|
+
let enclose = utils.encloseBrace(node);
|
|
10253
|
+
let queue = node.queue;
|
|
10254
|
+
let block = node;
|
|
10255
|
+
while (block.type !== "brace" && block.type !== "root" && block.parent) {
|
|
10256
|
+
block = block.parent;
|
|
10257
|
+
queue = block.queue;
|
|
10258
|
+
}
|
|
10259
|
+
for (let i = 0; i < node.nodes.length; i++) {
|
|
10260
|
+
let child = node.nodes[i];
|
|
10261
|
+
if (child.type === "comma" && node.type === "brace") {
|
|
10262
|
+
if (i === 1)
|
|
10263
|
+
queue.push("");
|
|
10264
|
+
queue.push("");
|
|
10265
|
+
continue;
|
|
10266
|
+
}
|
|
10267
|
+
if (child.type === "close") {
|
|
10268
|
+
q.push(append(q.pop(), queue, enclose));
|
|
10269
|
+
continue;
|
|
10270
|
+
}
|
|
10271
|
+
if (child.value && child.type !== "open") {
|
|
10272
|
+
queue.push(append(queue.pop(), child.value));
|
|
10273
|
+
continue;
|
|
10274
|
+
}
|
|
10275
|
+
if (child.nodes) {
|
|
10276
|
+
walk(child, node);
|
|
10277
|
+
}
|
|
10278
|
+
}
|
|
10279
|
+
return queue;
|
|
10280
|
+
};
|
|
10281
|
+
return utils.flatten(walk(ast));
|
|
10282
|
+
};
|
|
10283
|
+
module2.exports = expand;
|
|
10284
|
+
}
|
|
10285
|
+
});
|
|
10286
|
+
|
|
10287
|
+
// ../../node_modules/braces/lib/constants.js
|
|
10288
|
+
var require_constants2 = __commonJS({
|
|
10289
|
+
"../../node_modules/braces/lib/constants.js"(exports, module2) {
|
|
10290
|
+
"use strict";
|
|
10291
|
+
module2.exports = {
|
|
10292
|
+
MAX_LENGTH: 1024 * 64,
|
|
10293
|
+
CHAR_0: "0",
|
|
10294
|
+
CHAR_9: "9",
|
|
10295
|
+
CHAR_UPPERCASE_A: "A",
|
|
10296
|
+
CHAR_LOWERCASE_A: "a",
|
|
10297
|
+
CHAR_UPPERCASE_Z: "Z",
|
|
10298
|
+
CHAR_LOWERCASE_Z: "z",
|
|
10299
|
+
CHAR_LEFT_PARENTHESES: "(",
|
|
10300
|
+
CHAR_RIGHT_PARENTHESES: ")",
|
|
10301
|
+
CHAR_ASTERISK: "*",
|
|
10302
|
+
CHAR_AMPERSAND: "&",
|
|
10303
|
+
CHAR_AT: "@",
|
|
10304
|
+
CHAR_BACKSLASH: "\\",
|
|
10305
|
+
CHAR_BACKTICK: "`",
|
|
10306
|
+
CHAR_CARRIAGE_RETURN: "\r",
|
|
10307
|
+
CHAR_CIRCUMFLEX_ACCENT: "^",
|
|
10308
|
+
CHAR_COLON: ":",
|
|
10309
|
+
CHAR_COMMA: ",",
|
|
10310
|
+
CHAR_DOLLAR: "$",
|
|
10311
|
+
CHAR_DOT: ".",
|
|
10312
|
+
CHAR_DOUBLE_QUOTE: '"',
|
|
10313
|
+
CHAR_EQUAL: "=",
|
|
10314
|
+
CHAR_EXCLAMATION_MARK: "!",
|
|
10315
|
+
CHAR_FORM_FEED: "\f",
|
|
10316
|
+
CHAR_FORWARD_SLASH: "/",
|
|
10317
|
+
CHAR_HASH: "#",
|
|
10318
|
+
CHAR_HYPHEN_MINUS: "-",
|
|
10319
|
+
CHAR_LEFT_ANGLE_BRACKET: "<",
|
|
10320
|
+
CHAR_LEFT_CURLY_BRACE: "{",
|
|
10321
|
+
CHAR_LEFT_SQUARE_BRACKET: "[",
|
|
10322
|
+
CHAR_LINE_FEED: "\n",
|
|
10323
|
+
CHAR_NO_BREAK_SPACE: "\xA0",
|
|
10324
|
+
CHAR_PERCENT: "%",
|
|
10325
|
+
CHAR_PLUS: "+",
|
|
10326
|
+
CHAR_QUESTION_MARK: "?",
|
|
10327
|
+
CHAR_RIGHT_ANGLE_BRACKET: ">",
|
|
10328
|
+
CHAR_RIGHT_CURLY_BRACE: "}",
|
|
10329
|
+
CHAR_RIGHT_SQUARE_BRACKET: "]",
|
|
10330
|
+
CHAR_SEMICOLON: ";",
|
|
10331
|
+
CHAR_SINGLE_QUOTE: "'",
|
|
10332
|
+
CHAR_SPACE: " ",
|
|
10333
|
+
CHAR_TAB: " ",
|
|
10334
|
+
CHAR_UNDERSCORE: "_",
|
|
10335
|
+
CHAR_VERTICAL_LINE: "|",
|
|
10336
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
|
|
10337
|
+
};
|
|
10338
|
+
}
|
|
10339
|
+
});
|
|
10340
|
+
|
|
10341
|
+
// ../../node_modules/braces/lib/parse.js
|
|
10342
|
+
var require_parse2 = __commonJS({
|
|
10343
|
+
"../../node_modules/braces/lib/parse.js"(exports, module2) {
|
|
10344
|
+
"use strict";
|
|
10345
|
+
var stringify = require_stringify();
|
|
10346
|
+
var {
|
|
10347
|
+
MAX_LENGTH,
|
|
10348
|
+
CHAR_BACKSLASH,
|
|
10349
|
+
CHAR_BACKTICK,
|
|
10350
|
+
CHAR_COMMA,
|
|
10351
|
+
CHAR_DOT,
|
|
10352
|
+
CHAR_LEFT_PARENTHESES,
|
|
10353
|
+
CHAR_RIGHT_PARENTHESES,
|
|
10354
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
10355
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
10356
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
10357
|
+
CHAR_RIGHT_SQUARE_BRACKET,
|
|
10358
|
+
CHAR_DOUBLE_QUOTE,
|
|
10359
|
+
CHAR_SINGLE_QUOTE,
|
|
10360
|
+
CHAR_NO_BREAK_SPACE,
|
|
10361
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
10362
|
+
} = require_constants2();
|
|
10363
|
+
var parse = (input, options = {}) => {
|
|
10364
|
+
if (typeof input !== "string") {
|
|
10365
|
+
throw new TypeError("Expected a string");
|
|
10366
|
+
}
|
|
10367
|
+
let opts = options || {};
|
|
10368
|
+
let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
10369
|
+
if (input.length > max) {
|
|
10370
|
+
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
10371
|
+
}
|
|
10372
|
+
let ast = { type: "root", input, nodes: [] };
|
|
10373
|
+
let stack = [ast];
|
|
10374
|
+
let block = ast;
|
|
10375
|
+
let prev = ast;
|
|
10376
|
+
let brackets = 0;
|
|
10377
|
+
let length = input.length;
|
|
10378
|
+
let index = 0;
|
|
10379
|
+
let depth = 0;
|
|
10380
|
+
let value;
|
|
10381
|
+
let memo = {};
|
|
10382
|
+
const advance = () => input[index++];
|
|
10383
|
+
const push = (node) => {
|
|
10384
|
+
if (node.type === "text" && prev.type === "dot") {
|
|
10385
|
+
prev.type = "text";
|
|
10386
|
+
}
|
|
10387
|
+
if (prev && prev.type === "text" && node.type === "text") {
|
|
10388
|
+
prev.value += node.value;
|
|
10389
|
+
return;
|
|
10390
|
+
}
|
|
10391
|
+
block.nodes.push(node);
|
|
10392
|
+
node.parent = block;
|
|
10393
|
+
node.prev = prev;
|
|
10394
|
+
prev = node;
|
|
10395
|
+
return node;
|
|
10396
|
+
};
|
|
10397
|
+
push({ type: "bos" });
|
|
10398
|
+
while (index < length) {
|
|
10399
|
+
block = stack[stack.length - 1];
|
|
10400
|
+
value = advance();
|
|
10401
|
+
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
10402
|
+
continue;
|
|
10403
|
+
}
|
|
10404
|
+
if (value === CHAR_BACKSLASH) {
|
|
10405
|
+
push({ type: "text", value: (options.keepEscaping ? value : "") + advance() });
|
|
10406
|
+
continue;
|
|
10407
|
+
}
|
|
10408
|
+
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
10409
|
+
push({ type: "text", value: "\\" + value });
|
|
10410
|
+
continue;
|
|
10411
|
+
}
|
|
10412
|
+
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
10413
|
+
brackets++;
|
|
10414
|
+
let closed = true;
|
|
10415
|
+
let next;
|
|
10416
|
+
while (index < length && (next = advance())) {
|
|
10417
|
+
value += next;
|
|
10418
|
+
if (next === CHAR_LEFT_SQUARE_BRACKET) {
|
|
10419
|
+
brackets++;
|
|
10420
|
+
continue;
|
|
10421
|
+
}
|
|
10422
|
+
if (next === CHAR_BACKSLASH) {
|
|
10423
|
+
value += advance();
|
|
10424
|
+
continue;
|
|
10425
|
+
}
|
|
10426
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
10427
|
+
brackets--;
|
|
10428
|
+
if (brackets === 0) {
|
|
10429
|
+
break;
|
|
10430
|
+
}
|
|
10431
|
+
}
|
|
10432
|
+
}
|
|
10433
|
+
push({ type: "text", value });
|
|
10434
|
+
continue;
|
|
10435
|
+
}
|
|
10436
|
+
if (value === CHAR_LEFT_PARENTHESES) {
|
|
10437
|
+
block = push({ type: "paren", nodes: [] });
|
|
10438
|
+
stack.push(block);
|
|
10439
|
+
push({ type: "text", value });
|
|
10440
|
+
continue;
|
|
10441
|
+
}
|
|
10442
|
+
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
10443
|
+
if (block.type !== "paren") {
|
|
10444
|
+
push({ type: "text", value });
|
|
10445
|
+
continue;
|
|
10446
|
+
}
|
|
10447
|
+
block = stack.pop();
|
|
10448
|
+
push({ type: "text", value });
|
|
10449
|
+
block = stack[stack.length - 1];
|
|
10450
|
+
continue;
|
|
10451
|
+
}
|
|
10452
|
+
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
10453
|
+
let open = value;
|
|
10454
|
+
let next;
|
|
10455
|
+
if (options.keepQuotes !== true) {
|
|
10456
|
+
value = "";
|
|
10457
|
+
}
|
|
10458
|
+
while (index < length && (next = advance())) {
|
|
10459
|
+
if (next === CHAR_BACKSLASH) {
|
|
10460
|
+
value += next + advance();
|
|
10461
|
+
continue;
|
|
10462
|
+
}
|
|
10463
|
+
if (next === open) {
|
|
10464
|
+
if (options.keepQuotes === true)
|
|
10465
|
+
value += next;
|
|
10466
|
+
break;
|
|
10467
|
+
}
|
|
10468
|
+
value += next;
|
|
10469
|
+
}
|
|
10470
|
+
push({ type: "text", value });
|
|
10471
|
+
continue;
|
|
10472
|
+
}
|
|
10473
|
+
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
10474
|
+
depth++;
|
|
10475
|
+
let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
|
|
10476
|
+
let brace = {
|
|
10477
|
+
type: "brace",
|
|
10478
|
+
open: true,
|
|
10479
|
+
close: false,
|
|
10480
|
+
dollar,
|
|
10481
|
+
depth,
|
|
10482
|
+
commas: 0,
|
|
10483
|
+
ranges: 0,
|
|
10484
|
+
nodes: []
|
|
10485
|
+
};
|
|
10486
|
+
block = push(brace);
|
|
10487
|
+
stack.push(block);
|
|
10488
|
+
push({ type: "open", value });
|
|
10489
|
+
continue;
|
|
10490
|
+
}
|
|
10491
|
+
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
10492
|
+
if (block.type !== "brace") {
|
|
10493
|
+
push({ type: "text", value });
|
|
10494
|
+
continue;
|
|
10495
|
+
}
|
|
10496
|
+
let type = "close";
|
|
10497
|
+
block = stack.pop();
|
|
10498
|
+
block.close = true;
|
|
10499
|
+
push({ type, value });
|
|
10500
|
+
depth--;
|
|
10501
|
+
block = stack[stack.length - 1];
|
|
10502
|
+
continue;
|
|
10503
|
+
}
|
|
10504
|
+
if (value === CHAR_COMMA && depth > 0) {
|
|
10505
|
+
if (block.ranges > 0) {
|
|
10506
|
+
block.ranges = 0;
|
|
10507
|
+
let open = block.nodes.shift();
|
|
10508
|
+
block.nodes = [open, { type: "text", value: stringify(block) }];
|
|
10509
|
+
}
|
|
10510
|
+
push({ type: "comma", value });
|
|
10511
|
+
block.commas++;
|
|
10512
|
+
continue;
|
|
10513
|
+
}
|
|
10514
|
+
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
10515
|
+
let siblings = block.nodes;
|
|
10516
|
+
if (depth === 0 || siblings.length === 0) {
|
|
10517
|
+
push({ type: "text", value });
|
|
10518
|
+
continue;
|
|
10519
|
+
}
|
|
10520
|
+
if (prev.type === "dot") {
|
|
10521
|
+
block.range = [];
|
|
10522
|
+
prev.value += value;
|
|
10523
|
+
prev.type = "range";
|
|
10524
|
+
if (block.nodes.length !== 3 && block.nodes.length !== 5) {
|
|
10525
|
+
block.invalid = true;
|
|
10526
|
+
block.ranges = 0;
|
|
10527
|
+
prev.type = "text";
|
|
10528
|
+
continue;
|
|
10529
|
+
}
|
|
10530
|
+
block.ranges++;
|
|
10531
|
+
block.args = [];
|
|
10532
|
+
continue;
|
|
10533
|
+
}
|
|
10534
|
+
if (prev.type === "range") {
|
|
10535
|
+
siblings.pop();
|
|
10536
|
+
let before = siblings[siblings.length - 1];
|
|
10537
|
+
before.value += prev.value + value;
|
|
10538
|
+
prev = before;
|
|
10539
|
+
block.ranges--;
|
|
10540
|
+
continue;
|
|
10541
|
+
}
|
|
10542
|
+
push({ type: "dot", value });
|
|
10543
|
+
continue;
|
|
10544
|
+
}
|
|
10545
|
+
push({ type: "text", value });
|
|
10546
|
+
}
|
|
10547
|
+
do {
|
|
10548
|
+
block = stack.pop();
|
|
10549
|
+
if (block.type !== "root") {
|
|
10550
|
+
block.nodes.forEach((node) => {
|
|
10551
|
+
if (!node.nodes) {
|
|
10552
|
+
if (node.type === "open")
|
|
10553
|
+
node.isOpen = true;
|
|
10554
|
+
if (node.type === "close")
|
|
10555
|
+
node.isClose = true;
|
|
10556
|
+
if (!node.nodes)
|
|
10557
|
+
node.type = "text";
|
|
10558
|
+
node.invalid = true;
|
|
10559
|
+
}
|
|
10560
|
+
});
|
|
10561
|
+
let parent = stack[stack.length - 1];
|
|
10562
|
+
let index2 = parent.nodes.indexOf(block);
|
|
10563
|
+
parent.nodes.splice(index2, 1, ...block.nodes);
|
|
10564
|
+
}
|
|
10565
|
+
} while (stack.length > 0);
|
|
10566
|
+
push({ type: "eos" });
|
|
10567
|
+
return ast;
|
|
10568
|
+
};
|
|
10569
|
+
module2.exports = parse;
|
|
10570
|
+
}
|
|
10571
|
+
});
|
|
10572
|
+
|
|
10573
|
+
// ../../node_modules/braces/index.js
|
|
10574
|
+
var require_braces = __commonJS({
|
|
10575
|
+
"../../node_modules/braces/index.js"(exports, module2) {
|
|
10576
|
+
"use strict";
|
|
10577
|
+
var stringify = require_stringify();
|
|
10578
|
+
var compile = require_compile();
|
|
10579
|
+
var expand = require_expand();
|
|
10580
|
+
var parse = require_parse2();
|
|
10581
|
+
var braces = (input, options = {}) => {
|
|
10582
|
+
let output = [];
|
|
10583
|
+
if (Array.isArray(input)) {
|
|
10584
|
+
for (let pattern of input) {
|
|
10585
|
+
let result = braces.create(pattern, options);
|
|
10586
|
+
if (Array.isArray(result)) {
|
|
10587
|
+
output.push(...result);
|
|
10588
|
+
} else {
|
|
10589
|
+
output.push(result);
|
|
10590
|
+
}
|
|
10591
|
+
}
|
|
10592
|
+
} else {
|
|
10593
|
+
output = [].concat(braces.create(input, options));
|
|
10594
|
+
}
|
|
10595
|
+
if (options && options.expand === true && options.nodupes === true) {
|
|
10596
|
+
output = [...new Set(output)];
|
|
10597
|
+
}
|
|
10598
|
+
return output;
|
|
10599
|
+
};
|
|
10600
|
+
braces.parse = (input, options = {}) => parse(input, options);
|
|
10601
|
+
braces.stringify = (input, options = {}) => {
|
|
10602
|
+
if (typeof input === "string") {
|
|
10603
|
+
return stringify(braces.parse(input, options), options);
|
|
10604
|
+
}
|
|
10605
|
+
return stringify(input, options);
|
|
10606
|
+
};
|
|
10607
|
+
braces.compile = (input, options = {}) => {
|
|
10608
|
+
if (typeof input === "string") {
|
|
10609
|
+
input = braces.parse(input, options);
|
|
10610
|
+
}
|
|
10611
|
+
return compile(input, options);
|
|
10612
|
+
};
|
|
10613
|
+
braces.expand = (input, options = {}) => {
|
|
10614
|
+
if (typeof input === "string") {
|
|
10615
|
+
input = braces.parse(input, options);
|
|
10616
|
+
}
|
|
10617
|
+
let result = expand(input, options);
|
|
10618
|
+
if (options.noempty === true) {
|
|
10619
|
+
result = result.filter(Boolean);
|
|
10620
|
+
}
|
|
10621
|
+
if (options.nodupes === true) {
|
|
10622
|
+
result = [...new Set(result)];
|
|
10623
|
+
}
|
|
10624
|
+
return result;
|
|
10625
|
+
};
|
|
10626
|
+
braces.create = (input, options = {}) => {
|
|
10627
|
+
if (input === "" || input.length < 3) {
|
|
10628
|
+
return [input];
|
|
10629
|
+
}
|
|
10630
|
+
return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
|
|
10631
|
+
};
|
|
10632
|
+
module2.exports = braces;
|
|
10633
|
+
}
|
|
10634
|
+
});
|
|
10635
|
+
|
|
10636
|
+
// ../../node_modules/binary-extensions/binary-extensions.json
|
|
10637
|
+
var require_binary_extensions = __commonJS({
|
|
10638
|
+
"../../node_modules/binary-extensions/binary-extensions.json"(exports, module2) {
|
|
10639
|
+
module2.exports = [
|
|
10640
|
+
"3dm",
|
|
10641
|
+
"3ds",
|
|
10642
|
+
"3g2",
|
|
10643
|
+
"3gp",
|
|
10644
|
+
"7z",
|
|
10645
|
+
"a",
|
|
10646
|
+
"aac",
|
|
10647
|
+
"adp",
|
|
10648
|
+
"ai",
|
|
10649
|
+
"aif",
|
|
10650
|
+
"aiff",
|
|
10651
|
+
"alz",
|
|
10652
|
+
"ape",
|
|
10653
|
+
"apk",
|
|
10654
|
+
"appimage",
|
|
10655
|
+
"ar",
|
|
10656
|
+
"arj",
|
|
10657
|
+
"asf",
|
|
10658
|
+
"au",
|
|
10659
|
+
"avi",
|
|
10660
|
+
"bak",
|
|
10661
|
+
"baml",
|
|
10662
|
+
"bh",
|
|
10663
|
+
"bin",
|
|
10664
|
+
"bk",
|
|
10665
|
+
"bmp",
|
|
10666
|
+
"btif",
|
|
10667
|
+
"bz2",
|
|
10668
|
+
"bzip2",
|
|
10669
|
+
"cab",
|
|
10670
|
+
"caf",
|
|
10671
|
+
"cgm",
|
|
10672
|
+
"class",
|
|
10673
|
+
"cmx",
|
|
10674
|
+
"cpio",
|
|
10675
|
+
"cr2",
|
|
10676
|
+
"cur",
|
|
10677
|
+
"dat",
|
|
10678
|
+
"dcm",
|
|
10679
|
+
"deb",
|
|
10680
|
+
"dex",
|
|
10681
|
+
"djvu",
|
|
10682
|
+
"dll",
|
|
10683
|
+
"dmg",
|
|
10684
|
+
"dng",
|
|
10685
|
+
"doc",
|
|
10686
|
+
"docm",
|
|
10687
|
+
"docx",
|
|
10688
|
+
"dot",
|
|
10689
|
+
"dotm",
|
|
10690
|
+
"dra",
|
|
10691
|
+
"DS_Store",
|
|
10692
|
+
"dsk",
|
|
10693
|
+
"dts",
|
|
10694
|
+
"dtshd",
|
|
10695
|
+
"dvb",
|
|
10696
|
+
"dwg",
|
|
10697
|
+
"dxf",
|
|
10698
|
+
"ecelp4800",
|
|
10699
|
+
"ecelp7470",
|
|
10700
|
+
"ecelp9600",
|
|
10701
|
+
"egg",
|
|
10702
|
+
"eol",
|
|
10703
|
+
"eot",
|
|
10704
|
+
"epub",
|
|
10705
|
+
"exe",
|
|
10706
|
+
"f4v",
|
|
10707
|
+
"fbs",
|
|
10708
|
+
"fh",
|
|
10709
|
+
"fla",
|
|
10710
|
+
"flac",
|
|
10711
|
+
"flatpak",
|
|
10712
|
+
"fli",
|
|
10713
|
+
"flv",
|
|
10714
|
+
"fpx",
|
|
10715
|
+
"fst",
|
|
10716
|
+
"fvt",
|
|
10717
|
+
"g3",
|
|
10718
|
+
"gh",
|
|
10719
|
+
"gif",
|
|
10720
|
+
"graffle",
|
|
10721
|
+
"gz",
|
|
10722
|
+
"gzip",
|
|
10723
|
+
"h261",
|
|
10724
|
+
"h263",
|
|
10725
|
+
"h264",
|
|
10726
|
+
"icns",
|
|
10727
|
+
"ico",
|
|
10728
|
+
"ief",
|
|
10729
|
+
"img",
|
|
10730
|
+
"ipa",
|
|
10731
|
+
"iso",
|
|
10732
|
+
"jar",
|
|
10733
|
+
"jpeg",
|
|
10734
|
+
"jpg",
|
|
10735
|
+
"jpgv",
|
|
10736
|
+
"jpm",
|
|
10737
|
+
"jxr",
|
|
10738
|
+
"key",
|
|
10739
|
+
"ktx",
|
|
10740
|
+
"lha",
|
|
10741
|
+
"lib",
|
|
10742
|
+
"lvp",
|
|
10743
|
+
"lz",
|
|
10744
|
+
"lzh",
|
|
10745
|
+
"lzma",
|
|
10746
|
+
"lzo",
|
|
10747
|
+
"m3u",
|
|
10748
|
+
"m4a",
|
|
10749
|
+
"m4v",
|
|
10750
|
+
"mar",
|
|
10751
|
+
"mdi",
|
|
10752
|
+
"mht",
|
|
10753
|
+
"mid",
|
|
10754
|
+
"midi",
|
|
10755
|
+
"mj2",
|
|
10756
|
+
"mka",
|
|
10757
|
+
"mkv",
|
|
10758
|
+
"mmr",
|
|
10759
|
+
"mng",
|
|
10760
|
+
"mobi",
|
|
10761
|
+
"mov",
|
|
10762
|
+
"movie",
|
|
10763
|
+
"mp3",
|
|
10764
|
+
"mp4",
|
|
10765
|
+
"mp4a",
|
|
10766
|
+
"mpeg",
|
|
10767
|
+
"mpg",
|
|
10768
|
+
"mpga",
|
|
10769
|
+
"mxu",
|
|
10770
|
+
"nef",
|
|
10771
|
+
"npx",
|
|
10772
|
+
"numbers",
|
|
10773
|
+
"nupkg",
|
|
10774
|
+
"o",
|
|
10775
|
+
"odp",
|
|
10776
|
+
"ods",
|
|
10777
|
+
"odt",
|
|
10778
|
+
"oga",
|
|
10779
|
+
"ogg",
|
|
10780
|
+
"ogv",
|
|
10781
|
+
"otf",
|
|
10782
|
+
"ott",
|
|
10783
|
+
"pages",
|
|
10784
|
+
"pbm",
|
|
10785
|
+
"pcx",
|
|
10786
|
+
"pdb",
|
|
10787
|
+
"pdf",
|
|
10788
|
+
"pea",
|
|
10789
|
+
"pgm",
|
|
10790
|
+
"pic",
|
|
10791
|
+
"png",
|
|
10792
|
+
"pnm",
|
|
10793
|
+
"pot",
|
|
10794
|
+
"potm",
|
|
10795
|
+
"potx",
|
|
10796
|
+
"ppa",
|
|
10797
|
+
"ppam",
|
|
10798
|
+
"ppm",
|
|
10799
|
+
"pps",
|
|
10800
|
+
"ppsm",
|
|
10801
|
+
"ppsx",
|
|
10802
|
+
"ppt",
|
|
10803
|
+
"pptm",
|
|
10804
|
+
"pptx",
|
|
10805
|
+
"psd",
|
|
10806
|
+
"pya",
|
|
10807
|
+
"pyc",
|
|
10808
|
+
"pyo",
|
|
10809
|
+
"pyv",
|
|
10810
|
+
"qt",
|
|
10811
|
+
"rar",
|
|
10812
|
+
"ras",
|
|
10813
|
+
"raw",
|
|
10814
|
+
"resources",
|
|
10815
|
+
"rgb",
|
|
10816
|
+
"rip",
|
|
10817
|
+
"rlc",
|
|
10818
|
+
"rmf",
|
|
10819
|
+
"rmvb",
|
|
10820
|
+
"rpm",
|
|
10821
|
+
"rtf",
|
|
10822
|
+
"rz",
|
|
10823
|
+
"s3m",
|
|
10824
|
+
"s7z",
|
|
10825
|
+
"scpt",
|
|
10826
|
+
"sgi",
|
|
10827
|
+
"shar",
|
|
10828
|
+
"snap",
|
|
10829
|
+
"sil",
|
|
10830
|
+
"sketch",
|
|
10831
|
+
"slk",
|
|
10832
|
+
"smv",
|
|
10833
|
+
"snk",
|
|
10834
|
+
"so",
|
|
10835
|
+
"stl",
|
|
10836
|
+
"suo",
|
|
10837
|
+
"sub",
|
|
10838
|
+
"swf",
|
|
10839
|
+
"tar",
|
|
10840
|
+
"tbz",
|
|
10841
|
+
"tbz2",
|
|
10842
|
+
"tga",
|
|
10843
|
+
"tgz",
|
|
10844
|
+
"thmx",
|
|
10845
|
+
"tif",
|
|
10846
|
+
"tiff",
|
|
10847
|
+
"tlz",
|
|
10848
|
+
"ttc",
|
|
10849
|
+
"ttf",
|
|
10850
|
+
"txz",
|
|
10851
|
+
"udf",
|
|
10852
|
+
"uvh",
|
|
10853
|
+
"uvi",
|
|
10854
|
+
"uvm",
|
|
10855
|
+
"uvp",
|
|
10856
|
+
"uvs",
|
|
10857
|
+
"uvu",
|
|
10858
|
+
"viv",
|
|
10859
|
+
"vob",
|
|
10860
|
+
"war",
|
|
10861
|
+
"wav",
|
|
10862
|
+
"wax",
|
|
10863
|
+
"wbmp",
|
|
10864
|
+
"wdp",
|
|
10865
|
+
"weba",
|
|
10866
|
+
"webm",
|
|
10867
|
+
"webp",
|
|
10868
|
+
"whl",
|
|
10869
|
+
"wim",
|
|
10870
|
+
"wm",
|
|
10871
|
+
"wma",
|
|
10872
|
+
"wmv",
|
|
10873
|
+
"wmx",
|
|
10874
|
+
"woff",
|
|
10875
|
+
"woff2",
|
|
10876
|
+
"wrm",
|
|
10877
|
+
"wvx",
|
|
10878
|
+
"xbm",
|
|
10879
|
+
"xif",
|
|
10880
|
+
"xla",
|
|
10881
|
+
"xlam",
|
|
10882
|
+
"xls",
|
|
10883
|
+
"xlsb",
|
|
10884
|
+
"xlsm",
|
|
10885
|
+
"xlsx",
|
|
10886
|
+
"xlt",
|
|
10887
|
+
"xltm",
|
|
10888
|
+
"xltx",
|
|
10889
|
+
"xm",
|
|
10890
|
+
"xmind",
|
|
10891
|
+
"xpi",
|
|
10892
|
+
"xpm",
|
|
10893
|
+
"xwd",
|
|
10894
|
+
"xz",
|
|
10895
|
+
"z",
|
|
10896
|
+
"zip",
|
|
10897
|
+
"zipx"
|
|
10898
|
+
];
|
|
10899
|
+
}
|
|
10900
|
+
});
|
|
10901
|
+
|
|
10902
|
+
// ../../node_modules/binary-extensions/index.js
|
|
10903
|
+
var require_binary_extensions2 = __commonJS({
|
|
10904
|
+
"../../node_modules/binary-extensions/index.js"(exports, module2) {
|
|
10905
|
+
module2.exports = require_binary_extensions();
|
|
10906
|
+
}
|
|
10907
|
+
});
|
|
10908
|
+
|
|
10909
|
+
// ../../node_modules/is-binary-path/index.js
|
|
10910
|
+
var require_is_binary_path = __commonJS({
|
|
10911
|
+
"../../node_modules/is-binary-path/index.js"(exports, module2) {
|
|
10912
|
+
"use strict";
|
|
10913
|
+
var path3 = require("path");
|
|
10914
|
+
var binaryExtensions = require_binary_extensions2();
|
|
10915
|
+
var extensions = new Set(binaryExtensions);
|
|
10916
|
+
module2.exports = (filePath) => extensions.has(path3.extname(filePath).slice(1).toLowerCase());
|
|
10917
|
+
}
|
|
10918
|
+
});
|
|
10919
|
+
|
|
10920
|
+
// ../../node_modules/chokidar/lib/constants.js
|
|
10921
|
+
var require_constants3 = __commonJS({
|
|
10922
|
+
"../../node_modules/chokidar/lib/constants.js"(exports) {
|
|
10923
|
+
"use strict";
|
|
10924
|
+
var { sep } = require("path");
|
|
10925
|
+
var { platform } = process;
|
|
10926
|
+
var os = require("os");
|
|
10927
|
+
exports.EV_ALL = "all";
|
|
10928
|
+
exports.EV_READY = "ready";
|
|
10929
|
+
exports.EV_ADD = "add";
|
|
10930
|
+
exports.EV_CHANGE = "change";
|
|
10931
|
+
exports.EV_ADD_DIR = "addDir";
|
|
10932
|
+
exports.EV_UNLINK = "unlink";
|
|
10933
|
+
exports.EV_UNLINK_DIR = "unlinkDir";
|
|
10934
|
+
exports.EV_RAW = "raw";
|
|
10935
|
+
exports.EV_ERROR = "error";
|
|
10936
|
+
exports.STR_DATA = "data";
|
|
10937
|
+
exports.STR_END = "end";
|
|
10938
|
+
exports.STR_CLOSE = "close";
|
|
10939
|
+
exports.FSEVENT_CREATED = "created";
|
|
10940
|
+
exports.FSEVENT_MODIFIED = "modified";
|
|
10941
|
+
exports.FSEVENT_DELETED = "deleted";
|
|
10942
|
+
exports.FSEVENT_MOVED = "moved";
|
|
10943
|
+
exports.FSEVENT_CLONED = "cloned";
|
|
10944
|
+
exports.FSEVENT_UNKNOWN = "unknown";
|
|
10945
|
+
exports.FSEVENT_TYPE_FILE = "file";
|
|
10946
|
+
exports.FSEVENT_TYPE_DIRECTORY = "directory";
|
|
10947
|
+
exports.FSEVENT_TYPE_SYMLINK = "symlink";
|
|
10948
|
+
exports.KEY_LISTENERS = "listeners";
|
|
10949
|
+
exports.KEY_ERR = "errHandlers";
|
|
10950
|
+
exports.KEY_RAW = "rawEmitters";
|
|
10951
|
+
exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW];
|
|
10952
|
+
exports.DOT_SLASH = `.${sep}`;
|
|
10953
|
+
exports.BACK_SLASH_RE = /\\/g;
|
|
10954
|
+
exports.DOUBLE_SLASH_RE = /\/\//;
|
|
10955
|
+
exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
|
10956
|
+
exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
10957
|
+
exports.REPLACER_RE = /^\.[/\\]/;
|
|
10958
|
+
exports.SLASH = "/";
|
|
10959
|
+
exports.SLASH_SLASH = "//";
|
|
10960
|
+
exports.BRACE_START = "{";
|
|
10961
|
+
exports.BANG = "!";
|
|
10962
|
+
exports.ONE_DOT = ".";
|
|
10963
|
+
exports.TWO_DOTS = "..";
|
|
10964
|
+
exports.STAR = "*";
|
|
10965
|
+
exports.GLOBSTAR = "**";
|
|
10966
|
+
exports.ROOT_GLOBSTAR = "/**/*";
|
|
10967
|
+
exports.SLASH_GLOBSTAR = "/**";
|
|
10968
|
+
exports.DIR_SUFFIX = "Dir";
|
|
10969
|
+
exports.ANYMATCH_OPTS = { dot: true };
|
|
10970
|
+
exports.STRING_TYPE = "string";
|
|
10971
|
+
exports.FUNCTION_TYPE = "function";
|
|
10972
|
+
exports.EMPTY_STR = "";
|
|
10973
|
+
exports.EMPTY_FN = () => {
|
|
10974
|
+
};
|
|
10975
|
+
exports.IDENTITY_FN = (val) => val;
|
|
10976
|
+
exports.isWindows = platform === "win32";
|
|
10977
|
+
exports.isMacos = platform === "darwin";
|
|
10978
|
+
exports.isLinux = platform === "linux";
|
|
10979
|
+
exports.isIBMi = os.type() === "OS400";
|
|
10980
|
+
}
|
|
10981
|
+
});
|
|
10982
|
+
|
|
10983
|
+
// ../../node_modules/chokidar/lib/nodefs-handler.js
|
|
10984
|
+
var require_nodefs_handler = __commonJS({
|
|
10985
|
+
"../../node_modules/chokidar/lib/nodefs-handler.js"(exports, module2) {
|
|
10986
|
+
"use strict";
|
|
10987
|
+
var fs3 = require("fs");
|
|
10988
|
+
var sysPath = require("path");
|
|
10989
|
+
var { promisify: promisify2 } = require("util");
|
|
10990
|
+
var isBinaryPath = require_is_binary_path();
|
|
10991
|
+
var {
|
|
10992
|
+
isWindows,
|
|
10993
|
+
isLinux,
|
|
10994
|
+
EMPTY_FN,
|
|
10995
|
+
EMPTY_STR,
|
|
10996
|
+
KEY_LISTENERS,
|
|
10997
|
+
KEY_ERR,
|
|
10998
|
+
KEY_RAW,
|
|
10999
|
+
HANDLER_KEYS,
|
|
11000
|
+
EV_CHANGE,
|
|
11001
|
+
EV_ADD,
|
|
11002
|
+
EV_ADD_DIR,
|
|
11003
|
+
EV_ERROR,
|
|
11004
|
+
STR_DATA,
|
|
11005
|
+
STR_END,
|
|
11006
|
+
BRACE_START,
|
|
11007
|
+
STAR
|
|
11008
|
+
} = require_constants3();
|
|
11009
|
+
var THROTTLE_MODE_WATCH = "watch";
|
|
11010
|
+
var open = promisify2(fs3.open);
|
|
11011
|
+
var stat = promisify2(fs3.stat);
|
|
11012
|
+
var lstat = promisify2(fs3.lstat);
|
|
11013
|
+
var close = promisify2(fs3.close);
|
|
11014
|
+
var fsrealpath = promisify2(fs3.realpath);
|
|
11015
|
+
var statMethods = { lstat, stat };
|
|
11016
|
+
var foreach = (val, fn) => {
|
|
11017
|
+
if (val instanceof Set) {
|
|
11018
|
+
val.forEach(fn);
|
|
11019
|
+
} else {
|
|
11020
|
+
fn(val);
|
|
11021
|
+
}
|
|
11022
|
+
};
|
|
11023
|
+
var addAndConvert = (main, prop, item) => {
|
|
11024
|
+
let container = main[prop];
|
|
11025
|
+
if (!(container instanceof Set)) {
|
|
11026
|
+
main[prop] = container = /* @__PURE__ */ new Set([container]);
|
|
11027
|
+
}
|
|
11028
|
+
container.add(item);
|
|
11029
|
+
};
|
|
11030
|
+
var clearItem = (cont) => (key) => {
|
|
11031
|
+
const set = cont[key];
|
|
11032
|
+
if (set instanceof Set) {
|
|
11033
|
+
set.clear();
|
|
11034
|
+
} else {
|
|
11035
|
+
delete cont[key];
|
|
11036
|
+
}
|
|
11037
|
+
};
|
|
11038
|
+
var delFromSet = (main, prop, item) => {
|
|
11039
|
+
const container = main[prop];
|
|
11040
|
+
if (container instanceof Set) {
|
|
11041
|
+
container.delete(item);
|
|
11042
|
+
} else if (container === item) {
|
|
11043
|
+
delete main[prop];
|
|
11044
|
+
}
|
|
11045
|
+
};
|
|
11046
|
+
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
11047
|
+
var FsWatchInstances = /* @__PURE__ */ new Map();
|
|
11048
|
+
function createFsWatchInstance(path3, options, listener, errHandler, emitRaw) {
|
|
11049
|
+
const handleEvent = (rawEvent, evPath) => {
|
|
11050
|
+
listener(path3);
|
|
11051
|
+
emitRaw(rawEvent, evPath, { watchedPath: path3 });
|
|
11052
|
+
if (evPath && path3 !== evPath) {
|
|
11053
|
+
fsWatchBroadcast(
|
|
11054
|
+
sysPath.resolve(path3, evPath),
|
|
11055
|
+
KEY_LISTENERS,
|
|
11056
|
+
sysPath.join(path3, evPath)
|
|
11057
|
+
);
|
|
11058
|
+
}
|
|
11059
|
+
};
|
|
11060
|
+
try {
|
|
11061
|
+
return fs3.watch(path3, options, handleEvent);
|
|
11062
|
+
} catch (error) {
|
|
11063
|
+
errHandler(error);
|
|
11064
|
+
}
|
|
11065
|
+
}
|
|
11066
|
+
var fsWatchBroadcast = (fullPath, type, val1, val2, val3) => {
|
|
11067
|
+
const cont = FsWatchInstances.get(fullPath);
|
|
11068
|
+
if (!cont)
|
|
11069
|
+
return;
|
|
11070
|
+
foreach(cont[type], (listener) => {
|
|
11071
|
+
listener(val1, val2, val3);
|
|
11072
|
+
});
|
|
11073
|
+
};
|
|
11074
|
+
var setFsWatchListener = (path3, fullPath, options, handlers) => {
|
|
11075
|
+
const { listener, errHandler, rawEmitter } = handlers;
|
|
11076
|
+
let cont = FsWatchInstances.get(fullPath);
|
|
11077
|
+
let watcher;
|
|
11078
|
+
if (!options.persistent) {
|
|
11079
|
+
watcher = createFsWatchInstance(
|
|
11080
|
+
path3,
|
|
11081
|
+
options,
|
|
11082
|
+
listener,
|
|
11083
|
+
errHandler,
|
|
11084
|
+
rawEmitter
|
|
11085
|
+
);
|
|
11086
|
+
return watcher.close.bind(watcher);
|
|
11087
|
+
}
|
|
11088
|
+
if (cont) {
|
|
11089
|
+
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
11090
|
+
addAndConvert(cont, KEY_ERR, errHandler);
|
|
11091
|
+
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
11092
|
+
} else {
|
|
11093
|
+
watcher = createFsWatchInstance(
|
|
11094
|
+
path3,
|
|
11095
|
+
options,
|
|
11096
|
+
fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
|
|
11097
|
+
errHandler,
|
|
11098
|
+
fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
|
|
11099
|
+
);
|
|
11100
|
+
if (!watcher)
|
|
11101
|
+
return;
|
|
11102
|
+
watcher.on(EV_ERROR, async (error) => {
|
|
11103
|
+
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
11104
|
+
cont.watcherUnusable = true;
|
|
11105
|
+
if (isWindows && error.code === "EPERM") {
|
|
11106
|
+
try {
|
|
11107
|
+
const fd = await open(path3, "r");
|
|
11108
|
+
await close(fd);
|
|
11109
|
+
broadcastErr(error);
|
|
11110
|
+
} catch (err) {
|
|
11111
|
+
}
|
|
11112
|
+
} else {
|
|
11113
|
+
broadcastErr(error);
|
|
11114
|
+
}
|
|
11115
|
+
});
|
|
11116
|
+
cont = {
|
|
11117
|
+
listeners: listener,
|
|
11118
|
+
errHandlers: errHandler,
|
|
11119
|
+
rawEmitters: rawEmitter,
|
|
11120
|
+
watcher
|
|
11121
|
+
};
|
|
11122
|
+
FsWatchInstances.set(fullPath, cont);
|
|
11123
|
+
}
|
|
11124
|
+
return () => {
|
|
11125
|
+
delFromSet(cont, KEY_LISTENERS, listener);
|
|
11126
|
+
delFromSet(cont, KEY_ERR, errHandler);
|
|
11127
|
+
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
11128
|
+
if (isEmptySet(cont.listeners)) {
|
|
11129
|
+
cont.watcher.close();
|
|
11130
|
+
FsWatchInstances.delete(fullPath);
|
|
11131
|
+
HANDLER_KEYS.forEach(clearItem(cont));
|
|
11132
|
+
cont.watcher = void 0;
|
|
11133
|
+
Object.freeze(cont);
|
|
11134
|
+
}
|
|
11135
|
+
};
|
|
11136
|
+
};
|
|
11137
|
+
var FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
11138
|
+
var setFsWatchFileListener = (path3, fullPath, options, handlers) => {
|
|
11139
|
+
const { listener, rawEmitter } = handlers;
|
|
11140
|
+
let cont = FsWatchFileInstances.get(fullPath);
|
|
11141
|
+
let listeners = /* @__PURE__ */ new Set();
|
|
11142
|
+
let rawEmitters = /* @__PURE__ */ new Set();
|
|
11143
|
+
const copts = cont && cont.options;
|
|
11144
|
+
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
11145
|
+
listeners = cont.listeners;
|
|
11146
|
+
rawEmitters = cont.rawEmitters;
|
|
11147
|
+
fs3.unwatchFile(fullPath);
|
|
11148
|
+
cont = void 0;
|
|
11149
|
+
}
|
|
11150
|
+
if (cont) {
|
|
11151
|
+
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
11152
|
+
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
11153
|
+
} else {
|
|
11154
|
+
cont = {
|
|
11155
|
+
listeners: listener,
|
|
11156
|
+
rawEmitters: rawEmitter,
|
|
11157
|
+
options,
|
|
11158
|
+
watcher: fs3.watchFile(fullPath, options, (curr, prev) => {
|
|
11159
|
+
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
11160
|
+
rawEmitter2(EV_CHANGE, fullPath, { curr, prev });
|
|
11161
|
+
});
|
|
11162
|
+
const currmtime = curr.mtimeMs;
|
|
11163
|
+
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
11164
|
+
foreach(cont.listeners, (listener2) => listener2(path3, curr));
|
|
11165
|
+
}
|
|
11166
|
+
})
|
|
11167
|
+
};
|
|
11168
|
+
FsWatchFileInstances.set(fullPath, cont);
|
|
11169
|
+
}
|
|
11170
|
+
return () => {
|
|
11171
|
+
delFromSet(cont, KEY_LISTENERS, listener);
|
|
11172
|
+
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
11173
|
+
if (isEmptySet(cont.listeners)) {
|
|
11174
|
+
FsWatchFileInstances.delete(fullPath);
|
|
11175
|
+
fs3.unwatchFile(fullPath);
|
|
11176
|
+
cont.options = cont.watcher = void 0;
|
|
11177
|
+
Object.freeze(cont);
|
|
11178
|
+
}
|
|
11179
|
+
};
|
|
11180
|
+
};
|
|
11181
|
+
var NodeFsHandler = class {
|
|
11182
|
+
constructor(fsW) {
|
|
11183
|
+
this.fsw = fsW;
|
|
11184
|
+
this._boundHandleError = (error) => fsW._handleError(error);
|
|
11185
|
+
}
|
|
11186
|
+
_watchWithNodeFs(path3, listener) {
|
|
11187
|
+
const opts = this.fsw.options;
|
|
11188
|
+
const directory = sysPath.dirname(path3);
|
|
11189
|
+
const basename = sysPath.basename(path3);
|
|
11190
|
+
const parent = this.fsw._getWatchedDir(directory);
|
|
11191
|
+
parent.add(basename);
|
|
11192
|
+
const absolutePath = sysPath.resolve(path3);
|
|
11193
|
+
const options = { persistent: opts.persistent };
|
|
11194
|
+
if (!listener)
|
|
11195
|
+
listener = EMPTY_FN;
|
|
11196
|
+
let closer;
|
|
11197
|
+
if (opts.usePolling) {
|
|
11198
|
+
options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
|
|
11199
|
+
closer = setFsWatchFileListener(path3, absolutePath, options, {
|
|
11200
|
+
listener,
|
|
11201
|
+
rawEmitter: this.fsw._emitRaw
|
|
11202
|
+
});
|
|
11203
|
+
} else {
|
|
11204
|
+
closer = setFsWatchListener(path3, absolutePath, options, {
|
|
11205
|
+
listener,
|
|
11206
|
+
errHandler: this._boundHandleError,
|
|
11207
|
+
rawEmitter: this.fsw._emitRaw
|
|
11208
|
+
});
|
|
11209
|
+
}
|
|
11210
|
+
return closer;
|
|
11211
|
+
}
|
|
11212
|
+
_handleFile(file, stats, initialAdd) {
|
|
11213
|
+
if (this.fsw.closed) {
|
|
11214
|
+
return;
|
|
11215
|
+
}
|
|
11216
|
+
const dirname = sysPath.dirname(file);
|
|
11217
|
+
const basename = sysPath.basename(file);
|
|
11218
|
+
const parent = this.fsw._getWatchedDir(dirname);
|
|
11219
|
+
let prevStats = stats;
|
|
11220
|
+
if (parent.has(basename))
|
|
11221
|
+
return;
|
|
11222
|
+
const listener = async (path3, newStats) => {
|
|
11223
|
+
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
|
|
11224
|
+
return;
|
|
11225
|
+
if (!newStats || newStats.mtimeMs === 0) {
|
|
11226
|
+
try {
|
|
11227
|
+
const newStats2 = await stat(file);
|
|
11228
|
+
if (this.fsw.closed)
|
|
11229
|
+
return;
|
|
11230
|
+
const at = newStats2.atimeMs;
|
|
11231
|
+
const mt = newStats2.mtimeMs;
|
|
11232
|
+
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
11233
|
+
this.fsw._emit(EV_CHANGE, file, newStats2);
|
|
11234
|
+
}
|
|
11235
|
+
if (isLinux && prevStats.ino !== newStats2.ino) {
|
|
11236
|
+
this.fsw._closeFile(path3);
|
|
11237
|
+
prevStats = newStats2;
|
|
11238
|
+
this.fsw._addPathCloser(path3, this._watchWithNodeFs(file, listener));
|
|
11239
|
+
} else {
|
|
11240
|
+
prevStats = newStats2;
|
|
11241
|
+
}
|
|
11242
|
+
} catch (error) {
|
|
11243
|
+
this.fsw._remove(dirname, basename);
|
|
11244
|
+
}
|
|
11245
|
+
} else if (parent.has(basename)) {
|
|
11246
|
+
const at = newStats.atimeMs;
|
|
11247
|
+
const mt = newStats.mtimeMs;
|
|
11248
|
+
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
|
|
11249
|
+
this.fsw._emit(EV_CHANGE, file, newStats);
|
|
11250
|
+
}
|
|
11251
|
+
prevStats = newStats;
|
|
11252
|
+
}
|
|
11253
|
+
};
|
|
11254
|
+
const closer = this._watchWithNodeFs(file, listener);
|
|
11255
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
|
|
11256
|
+
if (!this.fsw._throttle(EV_ADD, file, 0))
|
|
11257
|
+
return;
|
|
11258
|
+
this.fsw._emit(EV_ADD, file, stats);
|
|
11259
|
+
}
|
|
11260
|
+
return closer;
|
|
11261
|
+
}
|
|
11262
|
+
async _handleSymlink(entry, directory, path3, item) {
|
|
11263
|
+
if (this.fsw.closed) {
|
|
11264
|
+
return;
|
|
11265
|
+
}
|
|
11266
|
+
const full = entry.fullPath;
|
|
11267
|
+
const dir = this.fsw._getWatchedDir(directory);
|
|
11268
|
+
if (!this.fsw.options.followSymlinks) {
|
|
11269
|
+
this.fsw._incrReadyCount();
|
|
11270
|
+
let linkPath;
|
|
11271
|
+
try {
|
|
11272
|
+
linkPath = await fsrealpath(path3);
|
|
11273
|
+
} catch (e) {
|
|
11274
|
+
this.fsw._emitReady();
|
|
11275
|
+
return true;
|
|
11276
|
+
}
|
|
11277
|
+
if (this.fsw.closed)
|
|
11278
|
+
return;
|
|
11279
|
+
if (dir.has(item)) {
|
|
11280
|
+
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
11281
|
+
this.fsw._symlinkPaths.set(full, linkPath);
|
|
11282
|
+
this.fsw._emit(EV_CHANGE, path3, entry.stats);
|
|
11283
|
+
}
|
|
11284
|
+
} else {
|
|
11285
|
+
dir.add(item);
|
|
11286
|
+
this.fsw._symlinkPaths.set(full, linkPath);
|
|
11287
|
+
this.fsw._emit(EV_ADD, path3, entry.stats);
|
|
11288
|
+
}
|
|
11289
|
+
this.fsw._emitReady();
|
|
11290
|
+
return true;
|
|
11291
|
+
}
|
|
11292
|
+
if (this.fsw._symlinkPaths.has(full)) {
|
|
11293
|
+
return true;
|
|
11294
|
+
}
|
|
11295
|
+
this.fsw._symlinkPaths.set(full, true);
|
|
11296
|
+
}
|
|
11297
|
+
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
11298
|
+
directory = sysPath.join(directory, EMPTY_STR);
|
|
11299
|
+
if (!wh.hasGlob) {
|
|
11300
|
+
throttler = this.fsw._throttle("readdir", directory, 1e3);
|
|
11301
|
+
if (!throttler)
|
|
11302
|
+
return;
|
|
11303
|
+
}
|
|
11304
|
+
const previous = this.fsw._getWatchedDir(wh.path);
|
|
11305
|
+
const current = /* @__PURE__ */ new Set();
|
|
11306
|
+
let stream = this.fsw._readdirp(directory, {
|
|
11307
|
+
fileFilter: (entry) => wh.filterPath(entry),
|
|
11308
|
+
directoryFilter: (entry) => wh.filterDir(entry),
|
|
11309
|
+
depth: 0
|
|
11310
|
+
}).on(STR_DATA, async (entry) => {
|
|
11311
|
+
if (this.fsw.closed) {
|
|
11312
|
+
stream = void 0;
|
|
11313
|
+
return;
|
|
11314
|
+
}
|
|
11315
|
+
const item = entry.path;
|
|
11316
|
+
let path3 = sysPath.join(directory, item);
|
|
11317
|
+
current.add(item);
|
|
11318
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path3, item)) {
|
|
11319
|
+
return;
|
|
11320
|
+
}
|
|
11321
|
+
if (this.fsw.closed) {
|
|
11322
|
+
stream = void 0;
|
|
11323
|
+
return;
|
|
11324
|
+
}
|
|
11325
|
+
if (item === target || !target && !previous.has(item)) {
|
|
11326
|
+
this.fsw._incrReadyCount();
|
|
11327
|
+
path3 = sysPath.join(dir, sysPath.relative(dir, path3));
|
|
11328
|
+
this._addToNodeFs(path3, initialAdd, wh, depth + 1);
|
|
11329
|
+
}
|
|
11330
|
+
}).on(EV_ERROR, this._boundHandleError);
|
|
11331
|
+
return new Promise(
|
|
11332
|
+
(resolve) => stream.once(STR_END, () => {
|
|
11333
|
+
if (this.fsw.closed) {
|
|
11334
|
+
stream = void 0;
|
|
11335
|
+
return;
|
|
11336
|
+
}
|
|
11337
|
+
const wasThrottled = throttler ? throttler.clear() : false;
|
|
11338
|
+
resolve();
|
|
11339
|
+
previous.getChildren().filter((item) => {
|
|
11340
|
+
return item !== directory && !current.has(item) && (!wh.hasGlob || wh.filterPath({
|
|
11341
|
+
fullPath: sysPath.resolve(directory, item)
|
|
11342
|
+
}));
|
|
11343
|
+
}).forEach((item) => {
|
|
11344
|
+
this.fsw._remove(directory, item);
|
|
11345
|
+
});
|
|
11346
|
+
stream = void 0;
|
|
11347
|
+
if (wasThrottled)
|
|
11348
|
+
this._handleRead(directory, false, wh, target, dir, depth, throttler);
|
|
11349
|
+
})
|
|
11350
|
+
);
|
|
11351
|
+
}
|
|
11352
|
+
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
|
11353
|
+
const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
|
|
11354
|
+
const tracked = parentDir.has(sysPath.basename(dir));
|
|
11355
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
11356
|
+
if (!wh.hasGlob || wh.globFilter(dir))
|
|
11357
|
+
this.fsw._emit(EV_ADD_DIR, dir, stats);
|
|
11358
|
+
}
|
|
11359
|
+
parentDir.add(sysPath.basename(dir));
|
|
11360
|
+
this.fsw._getWatchedDir(dir);
|
|
11361
|
+
let throttler;
|
|
11362
|
+
let closer;
|
|
11363
|
+
const oDepth = this.fsw.options.depth;
|
|
11364
|
+
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
|
|
11365
|
+
if (!target) {
|
|
11366
|
+
await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
|
|
11367
|
+
if (this.fsw.closed)
|
|
11368
|
+
return;
|
|
11369
|
+
}
|
|
11370
|
+
closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
|
|
11371
|
+
if (stats2 && stats2.mtimeMs === 0)
|
|
11372
|
+
return;
|
|
11373
|
+
this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
|
|
11374
|
+
});
|
|
11375
|
+
}
|
|
11376
|
+
return closer;
|
|
11377
|
+
}
|
|
11378
|
+
async _addToNodeFs(path3, initialAdd, priorWh, depth, target) {
|
|
11379
|
+
const ready = this.fsw._emitReady;
|
|
11380
|
+
if (this.fsw._isIgnored(path3) || this.fsw.closed) {
|
|
11381
|
+
ready();
|
|
11382
|
+
return false;
|
|
11383
|
+
}
|
|
11384
|
+
const wh = this.fsw._getWatchHelpers(path3, depth);
|
|
11385
|
+
if (!wh.hasGlob && priorWh) {
|
|
11386
|
+
wh.hasGlob = priorWh.hasGlob;
|
|
11387
|
+
wh.globFilter = priorWh.globFilter;
|
|
11388
|
+
wh.filterPath = (entry) => priorWh.filterPath(entry);
|
|
11389
|
+
wh.filterDir = (entry) => priorWh.filterDir(entry);
|
|
11390
|
+
}
|
|
11391
|
+
try {
|
|
11392
|
+
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
11393
|
+
if (this.fsw.closed)
|
|
11394
|
+
return;
|
|
11395
|
+
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
|
11396
|
+
ready();
|
|
11397
|
+
return false;
|
|
11398
|
+
}
|
|
11399
|
+
const follow = this.fsw.options.followSymlinks && !path3.includes(STAR) && !path3.includes(BRACE_START);
|
|
11400
|
+
let closer;
|
|
11401
|
+
if (stats.isDirectory()) {
|
|
11402
|
+
const absPath = sysPath.resolve(path3);
|
|
11403
|
+
const targetPath = follow ? await fsrealpath(path3) : path3;
|
|
11404
|
+
if (this.fsw.closed)
|
|
11405
|
+
return;
|
|
11406
|
+
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
11407
|
+
if (this.fsw.closed)
|
|
11408
|
+
return;
|
|
11409
|
+
if (absPath !== targetPath && targetPath !== void 0) {
|
|
11410
|
+
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
11411
|
+
}
|
|
11412
|
+
} else if (stats.isSymbolicLink()) {
|
|
11413
|
+
const targetPath = follow ? await fsrealpath(path3) : path3;
|
|
11414
|
+
if (this.fsw.closed)
|
|
11415
|
+
return;
|
|
11416
|
+
const parent = sysPath.dirname(wh.watchPath);
|
|
11417
|
+
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
11418
|
+
this.fsw._emit(EV_ADD, wh.watchPath, stats);
|
|
11419
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path3, wh, targetPath);
|
|
11420
|
+
if (this.fsw.closed)
|
|
11421
|
+
return;
|
|
11422
|
+
if (targetPath !== void 0) {
|
|
11423
|
+
this.fsw._symlinkPaths.set(sysPath.resolve(path3), targetPath);
|
|
11424
|
+
}
|
|
11425
|
+
} else {
|
|
11426
|
+
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
11427
|
+
}
|
|
11428
|
+
ready();
|
|
11429
|
+
this.fsw._addPathCloser(path3, closer);
|
|
11430
|
+
return false;
|
|
11431
|
+
} catch (error) {
|
|
11432
|
+
if (this.fsw._handleError(error)) {
|
|
11433
|
+
ready();
|
|
11434
|
+
return path3;
|
|
11435
|
+
}
|
|
11436
|
+
}
|
|
11437
|
+
}
|
|
11438
|
+
};
|
|
11439
|
+
module2.exports = NodeFsHandler;
|
|
11440
|
+
}
|
|
11441
|
+
});
|
|
11442
|
+
|
|
11443
|
+
// ../../node_modules/chokidar/lib/fsevents-handler.js
|
|
11444
|
+
var require_fsevents_handler = __commonJS({
|
|
11445
|
+
"../../node_modules/chokidar/lib/fsevents-handler.js"(exports, module2) {
|
|
11446
|
+
"use strict";
|
|
11447
|
+
var fs3 = require("fs");
|
|
11448
|
+
var sysPath = require("path");
|
|
11449
|
+
var { promisify: promisify2 } = require("util");
|
|
11450
|
+
var fsevents;
|
|
11451
|
+
try {
|
|
11452
|
+
fsevents = require("fsevents");
|
|
11453
|
+
} catch (error) {
|
|
11454
|
+
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR)
|
|
11455
|
+
console.error(error);
|
|
11456
|
+
}
|
|
11457
|
+
if (fsevents) {
|
|
11458
|
+
const mtch = process.version.match(/v(\d+)\.(\d+)/);
|
|
11459
|
+
if (mtch && mtch[1] && mtch[2]) {
|
|
11460
|
+
const maj = Number.parseInt(mtch[1], 10);
|
|
11461
|
+
const min = Number.parseInt(mtch[2], 10);
|
|
11462
|
+
if (maj === 8 && min < 16) {
|
|
11463
|
+
fsevents = void 0;
|
|
11464
|
+
}
|
|
11465
|
+
}
|
|
11466
|
+
}
|
|
11467
|
+
var {
|
|
11468
|
+
EV_ADD,
|
|
11469
|
+
EV_CHANGE,
|
|
11470
|
+
EV_ADD_DIR,
|
|
11471
|
+
EV_UNLINK,
|
|
11472
|
+
EV_ERROR,
|
|
11473
|
+
STR_DATA,
|
|
11474
|
+
STR_END,
|
|
11475
|
+
FSEVENT_CREATED,
|
|
11476
|
+
FSEVENT_MODIFIED,
|
|
11477
|
+
FSEVENT_DELETED,
|
|
11478
|
+
FSEVENT_MOVED,
|
|
11479
|
+
FSEVENT_UNKNOWN,
|
|
11480
|
+
FSEVENT_TYPE_FILE,
|
|
11481
|
+
FSEVENT_TYPE_DIRECTORY,
|
|
11482
|
+
FSEVENT_TYPE_SYMLINK,
|
|
11483
|
+
ROOT_GLOBSTAR,
|
|
11484
|
+
DIR_SUFFIX,
|
|
11485
|
+
DOT_SLASH,
|
|
11486
|
+
FUNCTION_TYPE,
|
|
11487
|
+
EMPTY_FN,
|
|
11488
|
+
IDENTITY_FN
|
|
11489
|
+
} = require_constants3();
|
|
11490
|
+
var Depth = (value) => isNaN(value) ? {} : { depth: value };
|
|
11491
|
+
var stat = promisify2(fs3.stat);
|
|
11492
|
+
var lstat = promisify2(fs3.lstat);
|
|
11493
|
+
var realpath = promisify2(fs3.realpath);
|
|
11494
|
+
var statMethods = { stat, lstat };
|
|
11495
|
+
var FSEventsWatchers = /* @__PURE__ */ new Map();
|
|
11496
|
+
var consolidateThreshhold = 10;
|
|
11497
|
+
var wrongEventFlags = /* @__PURE__ */ new Set([
|
|
11498
|
+
69888,
|
|
11499
|
+
70400,
|
|
11500
|
+
71424,
|
|
11501
|
+
72704,
|
|
11502
|
+
73472,
|
|
11503
|
+
131328,
|
|
11504
|
+
131840,
|
|
11505
|
+
262912
|
|
11506
|
+
]);
|
|
11507
|
+
var createFSEventsInstance = (path3, callback) => {
|
|
11508
|
+
const stop = fsevents.watch(path3, callback);
|
|
11509
|
+
return { stop };
|
|
11510
|
+
};
|
|
11511
|
+
function setFSEventsListener(path3, realPath, listener, rawEmitter) {
|
|
11512
|
+
let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
|
|
11513
|
+
const parentPath = sysPath.dirname(watchPath);
|
|
11514
|
+
let cont = FSEventsWatchers.get(watchPath);
|
|
11515
|
+
if (couldConsolidate(parentPath)) {
|
|
11516
|
+
watchPath = parentPath;
|
|
11517
|
+
}
|
|
11518
|
+
const resolvedPath = sysPath.resolve(path3);
|
|
11519
|
+
const hasSymlink = resolvedPath !== realPath;
|
|
11520
|
+
const filteredListener = (fullPath, flags, info) => {
|
|
11521
|
+
if (hasSymlink)
|
|
11522
|
+
fullPath = fullPath.replace(realPath, resolvedPath);
|
|
11523
|
+
if (fullPath === resolvedPath || !fullPath.indexOf(resolvedPath + sysPath.sep))
|
|
11524
|
+
listener(fullPath, flags, info);
|
|
11525
|
+
};
|
|
11526
|
+
let watchedParent = false;
|
|
11527
|
+
for (const watchedPath of FSEventsWatchers.keys()) {
|
|
11528
|
+
if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) {
|
|
11529
|
+
watchPath = watchedPath;
|
|
11530
|
+
cont = FSEventsWatchers.get(watchPath);
|
|
11531
|
+
watchedParent = true;
|
|
11532
|
+
break;
|
|
11533
|
+
}
|
|
11534
|
+
}
|
|
11535
|
+
if (cont || watchedParent) {
|
|
11536
|
+
cont.listeners.add(filteredListener);
|
|
11537
|
+
} else {
|
|
11538
|
+
cont = {
|
|
11539
|
+
listeners: /* @__PURE__ */ new Set([filteredListener]),
|
|
11540
|
+
rawEmitter,
|
|
11541
|
+
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
|
|
11542
|
+
if (!cont.listeners.size)
|
|
11543
|
+
return;
|
|
11544
|
+
const info = fsevents.getInfo(fullPath, flags);
|
|
11545
|
+
cont.listeners.forEach((list) => {
|
|
11546
|
+
list(fullPath, flags, info);
|
|
11547
|
+
});
|
|
11548
|
+
cont.rawEmitter(info.event, fullPath, info);
|
|
11549
|
+
})
|
|
11550
|
+
};
|
|
11551
|
+
FSEventsWatchers.set(watchPath, cont);
|
|
11552
|
+
}
|
|
11553
|
+
return () => {
|
|
11554
|
+
const lst = cont.listeners;
|
|
11555
|
+
lst.delete(filteredListener);
|
|
11556
|
+
if (!lst.size) {
|
|
11557
|
+
FSEventsWatchers.delete(watchPath);
|
|
11558
|
+
if (cont.watcher)
|
|
11559
|
+
return cont.watcher.stop().then(() => {
|
|
11560
|
+
cont.rawEmitter = cont.watcher = void 0;
|
|
11561
|
+
Object.freeze(cont);
|
|
11562
|
+
});
|
|
11563
|
+
}
|
|
11564
|
+
};
|
|
11565
|
+
}
|
|
11566
|
+
var couldConsolidate = (path3) => {
|
|
11567
|
+
let count = 0;
|
|
11568
|
+
for (const watchPath of FSEventsWatchers.keys()) {
|
|
11569
|
+
if (watchPath.indexOf(path3) === 0) {
|
|
11570
|
+
count++;
|
|
11571
|
+
if (count >= consolidateThreshhold) {
|
|
11572
|
+
return true;
|
|
11573
|
+
}
|
|
11574
|
+
}
|
|
11575
|
+
}
|
|
11576
|
+
return false;
|
|
11577
|
+
};
|
|
11578
|
+
var canUse = () => fsevents && FSEventsWatchers.size < 128;
|
|
11579
|
+
var calcDepth = (path3, root) => {
|
|
11580
|
+
let i = 0;
|
|
11581
|
+
while (!path3.indexOf(root) && (path3 = sysPath.dirname(path3)) !== root)
|
|
11582
|
+
i++;
|
|
11583
|
+
return i;
|
|
11584
|
+
};
|
|
11585
|
+
var sameTypes = (info, stats) => info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || info.type === FSEVENT_TYPE_FILE && stats.isFile();
|
|
11586
|
+
var FsEventsHandler = class {
|
|
11587
|
+
constructor(fsw) {
|
|
11588
|
+
this.fsw = fsw;
|
|
11589
|
+
}
|
|
11590
|
+
checkIgnored(path3, stats) {
|
|
11591
|
+
const ipaths = this.fsw._ignoredPaths;
|
|
11592
|
+
if (this.fsw._isIgnored(path3, stats)) {
|
|
11593
|
+
ipaths.add(path3);
|
|
11594
|
+
if (stats && stats.isDirectory()) {
|
|
11595
|
+
ipaths.add(path3 + ROOT_GLOBSTAR);
|
|
11596
|
+
}
|
|
11597
|
+
return true;
|
|
11598
|
+
}
|
|
11599
|
+
ipaths.delete(path3);
|
|
11600
|
+
ipaths.delete(path3 + ROOT_GLOBSTAR);
|
|
11601
|
+
}
|
|
11602
|
+
addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
11603
|
+
const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
|
|
11604
|
+
this.handleEvent(event, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11605
|
+
}
|
|
11606
|
+
async checkExists(path3, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
11607
|
+
try {
|
|
11608
|
+
const stats = await stat(path3);
|
|
11609
|
+
if (this.fsw.closed)
|
|
11610
|
+
return;
|
|
11611
|
+
if (sameTypes(info, stats)) {
|
|
11612
|
+
this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11613
|
+
} else {
|
|
11614
|
+
this.handleEvent(EV_UNLINK, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11615
|
+
}
|
|
11616
|
+
} catch (error) {
|
|
11617
|
+
if (error.code === "EACCES") {
|
|
11618
|
+
this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11619
|
+
} else {
|
|
11620
|
+
this.handleEvent(EV_UNLINK, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11621
|
+
}
|
|
11622
|
+
}
|
|
11623
|
+
}
|
|
11624
|
+
handleEvent(event, path3, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
11625
|
+
if (this.fsw.closed || this.checkIgnored(path3))
|
|
11626
|
+
return;
|
|
11627
|
+
if (event === EV_UNLINK) {
|
|
11628
|
+
const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY;
|
|
11629
|
+
if (isDirectory || watchedDir.has(item)) {
|
|
11630
|
+
this.fsw._remove(parent, item, isDirectory);
|
|
11631
|
+
}
|
|
11632
|
+
} else {
|
|
11633
|
+
if (event === EV_ADD) {
|
|
11634
|
+
if (info.type === FSEVENT_TYPE_DIRECTORY)
|
|
11635
|
+
this.fsw._getWatchedDir(path3);
|
|
11636
|
+
if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
|
|
11637
|
+
const curDepth = opts.depth === void 0 ? void 0 : calcDepth(fullPath, realPath) + 1;
|
|
11638
|
+
return this._addToFsEvents(path3, false, true, curDepth);
|
|
11639
|
+
}
|
|
11640
|
+
this.fsw._getWatchedDir(parent).add(item);
|
|
11641
|
+
}
|
|
11642
|
+
const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
|
|
11643
|
+
this.fsw._emit(eventName, path3);
|
|
11644
|
+
if (eventName === EV_ADD_DIR)
|
|
11645
|
+
this._addToFsEvents(path3, false, true);
|
|
11646
|
+
}
|
|
11647
|
+
}
|
|
11648
|
+
_watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
|
11649
|
+
if (this.fsw.closed || this.fsw._isIgnored(watchPath))
|
|
11650
|
+
return;
|
|
11651
|
+
const opts = this.fsw.options;
|
|
11652
|
+
const watchCallback = async (fullPath, flags, info) => {
|
|
11653
|
+
if (this.fsw.closed)
|
|
11654
|
+
return;
|
|
11655
|
+
if (opts.depth !== void 0 && calcDepth(fullPath, realPath) > opts.depth)
|
|
11656
|
+
return;
|
|
11657
|
+
const path3 = transform(sysPath.join(
|
|
11658
|
+
watchPath,
|
|
11659
|
+
sysPath.relative(watchPath, fullPath)
|
|
11660
|
+
));
|
|
11661
|
+
if (globFilter && !globFilter(path3))
|
|
11662
|
+
return;
|
|
11663
|
+
const parent = sysPath.dirname(path3);
|
|
11664
|
+
const item = sysPath.basename(path3);
|
|
11665
|
+
const watchedDir = this.fsw._getWatchedDir(
|
|
11666
|
+
info.type === FSEVENT_TYPE_DIRECTORY ? path3 : parent
|
|
11667
|
+
);
|
|
11668
|
+
if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
|
|
11669
|
+
if (typeof opts.ignored === FUNCTION_TYPE) {
|
|
11670
|
+
let stats;
|
|
11671
|
+
try {
|
|
11672
|
+
stats = await stat(path3);
|
|
11673
|
+
} catch (error) {
|
|
11674
|
+
}
|
|
11675
|
+
if (this.fsw.closed)
|
|
11676
|
+
return;
|
|
11677
|
+
if (this.checkIgnored(path3, stats))
|
|
11678
|
+
return;
|
|
11679
|
+
if (sameTypes(info, stats)) {
|
|
11680
|
+
this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11681
|
+
} else {
|
|
11682
|
+
this.handleEvent(EV_UNLINK, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11683
|
+
}
|
|
11684
|
+
} else {
|
|
11685
|
+
this.checkExists(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11686
|
+
}
|
|
11687
|
+
} else {
|
|
11688
|
+
switch (info.event) {
|
|
11689
|
+
case FSEVENT_CREATED:
|
|
11690
|
+
case FSEVENT_MODIFIED:
|
|
11691
|
+
return this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11692
|
+
case FSEVENT_DELETED:
|
|
11693
|
+
case FSEVENT_MOVED:
|
|
11694
|
+
return this.checkExists(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
11695
|
+
}
|
|
11696
|
+
}
|
|
11697
|
+
};
|
|
11698
|
+
const closer = setFSEventsListener(
|
|
11699
|
+
watchPath,
|
|
11700
|
+
realPath,
|
|
11701
|
+
watchCallback,
|
|
11702
|
+
this.fsw._emitRaw
|
|
11703
|
+
);
|
|
11704
|
+
this.fsw._emitReady();
|
|
11705
|
+
return closer;
|
|
11706
|
+
}
|
|
11707
|
+
async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
|
|
11708
|
+
if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath))
|
|
11709
|
+
return;
|
|
11710
|
+
this.fsw._symlinkPaths.set(fullPath, true);
|
|
11711
|
+
this.fsw._incrReadyCount();
|
|
11712
|
+
try {
|
|
11713
|
+
const linkTarget = await realpath(linkPath);
|
|
11714
|
+
if (this.fsw.closed)
|
|
11715
|
+
return;
|
|
11716
|
+
if (this.fsw._isIgnored(linkTarget)) {
|
|
11717
|
+
return this.fsw._emitReady();
|
|
11718
|
+
}
|
|
11719
|
+
this.fsw._incrReadyCount();
|
|
11720
|
+
this._addToFsEvents(linkTarget || linkPath, (path3) => {
|
|
11721
|
+
let aliasedPath = linkPath;
|
|
11722
|
+
if (linkTarget && linkTarget !== DOT_SLASH) {
|
|
11723
|
+
aliasedPath = path3.replace(linkTarget, linkPath);
|
|
11724
|
+
} else if (path3 !== DOT_SLASH) {
|
|
11725
|
+
aliasedPath = sysPath.join(linkPath, path3);
|
|
11726
|
+
}
|
|
11727
|
+
return transform(aliasedPath);
|
|
11728
|
+
}, false, curDepth);
|
|
11729
|
+
} catch (error) {
|
|
11730
|
+
if (this.fsw._handleError(error)) {
|
|
11731
|
+
return this.fsw._emitReady();
|
|
11732
|
+
}
|
|
11733
|
+
}
|
|
11734
|
+
}
|
|
11735
|
+
emitAdd(newPath, stats, processPath, opts, forceAdd) {
|
|
11736
|
+
const pp = processPath(newPath);
|
|
11737
|
+
const isDir = stats.isDirectory();
|
|
11738
|
+
const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
|
|
11739
|
+
const base = sysPath.basename(pp);
|
|
11740
|
+
if (isDir)
|
|
11741
|
+
this.fsw._getWatchedDir(pp);
|
|
11742
|
+
if (dirObj.has(base))
|
|
11743
|
+
return;
|
|
11744
|
+
dirObj.add(base);
|
|
11745
|
+
if (!opts.ignoreInitial || forceAdd === true) {
|
|
11746
|
+
this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
|
|
11747
|
+
}
|
|
11748
|
+
}
|
|
11749
|
+
initWatch(realPath, path3, wh, processPath) {
|
|
11750
|
+
if (this.fsw.closed)
|
|
11751
|
+
return;
|
|
11752
|
+
const closer = this._watchWithFsEvents(
|
|
11753
|
+
wh.watchPath,
|
|
11754
|
+
sysPath.resolve(realPath || wh.watchPath),
|
|
11755
|
+
processPath,
|
|
11756
|
+
wh.globFilter
|
|
11757
|
+
);
|
|
11758
|
+
this.fsw._addPathCloser(path3, closer);
|
|
11759
|
+
}
|
|
11760
|
+
async _addToFsEvents(path3, transform, forceAdd, priorDepth) {
|
|
11761
|
+
if (this.fsw.closed) {
|
|
11762
|
+
return;
|
|
11763
|
+
}
|
|
11764
|
+
const opts = this.fsw.options;
|
|
11765
|
+
const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
|
|
11766
|
+
const wh = this.fsw._getWatchHelpers(path3);
|
|
11767
|
+
try {
|
|
11768
|
+
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
11769
|
+
if (this.fsw.closed)
|
|
11770
|
+
return;
|
|
11771
|
+
if (this.fsw._isIgnored(wh.watchPath, stats)) {
|
|
11772
|
+
throw null;
|
|
11773
|
+
}
|
|
11774
|
+
if (stats.isDirectory()) {
|
|
11775
|
+
if (!wh.globFilter)
|
|
11776
|
+
this.emitAdd(processPath(path3), stats, processPath, opts, forceAdd);
|
|
11777
|
+
if (priorDepth && priorDepth > opts.depth)
|
|
11778
|
+
return;
|
|
11779
|
+
this.fsw._readdirp(wh.watchPath, {
|
|
11780
|
+
fileFilter: (entry) => wh.filterPath(entry),
|
|
11781
|
+
directoryFilter: (entry) => wh.filterDir(entry),
|
|
11782
|
+
...Depth(opts.depth - (priorDepth || 0))
|
|
11783
|
+
}).on(STR_DATA, (entry) => {
|
|
11784
|
+
if (this.fsw.closed) {
|
|
11785
|
+
return;
|
|
11786
|
+
}
|
|
11787
|
+
if (entry.stats.isDirectory() && !wh.filterPath(entry))
|
|
11788
|
+
return;
|
|
11789
|
+
const joinedPath = sysPath.join(wh.watchPath, entry.path);
|
|
11790
|
+
const { fullPath } = entry;
|
|
11791
|
+
if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
|
|
11792
|
+
const curDepth = opts.depth === void 0 ? void 0 : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
|
|
11793
|
+
this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
|
|
11794
|
+
} else {
|
|
11795
|
+
this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd);
|
|
11796
|
+
}
|
|
11797
|
+
}).on(EV_ERROR, EMPTY_FN).on(STR_END, () => {
|
|
11798
|
+
this.fsw._emitReady();
|
|
11799
|
+
});
|
|
11800
|
+
} else {
|
|
11801
|
+
this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd);
|
|
11802
|
+
this.fsw._emitReady();
|
|
11803
|
+
}
|
|
11804
|
+
} catch (error) {
|
|
11805
|
+
if (!error || this.fsw._handleError(error)) {
|
|
11806
|
+
this.fsw._emitReady();
|
|
11807
|
+
this.fsw._emitReady();
|
|
11808
|
+
}
|
|
11809
|
+
}
|
|
11810
|
+
if (opts.persistent && forceAdd !== true) {
|
|
11811
|
+
if (typeof transform === FUNCTION_TYPE) {
|
|
11812
|
+
this.initWatch(void 0, path3, wh, processPath);
|
|
11813
|
+
} else {
|
|
11814
|
+
let realPath;
|
|
11815
|
+
try {
|
|
11816
|
+
realPath = await realpath(wh.watchPath);
|
|
11817
|
+
} catch (e) {
|
|
11818
|
+
}
|
|
11819
|
+
this.initWatch(realPath, path3, wh, processPath);
|
|
11820
|
+
}
|
|
11821
|
+
}
|
|
11822
|
+
}
|
|
11823
|
+
};
|
|
11824
|
+
module2.exports = FsEventsHandler;
|
|
11825
|
+
module2.exports.canUse = canUse;
|
|
11826
|
+
}
|
|
11827
|
+
});
|
|
11828
|
+
|
|
11829
|
+
// ../../node_modules/chokidar/index.js
|
|
11830
|
+
var require_chokidar = __commonJS({
|
|
11831
|
+
"../../node_modules/chokidar/index.js"(exports) {
|
|
11832
|
+
"use strict";
|
|
11833
|
+
var { EventEmitter } = require("events");
|
|
11834
|
+
var fs3 = require("fs");
|
|
11835
|
+
var sysPath = require("path");
|
|
11836
|
+
var { promisify: promisify2 } = require("util");
|
|
11837
|
+
var readdirp = require_readdirp();
|
|
11838
|
+
var anymatch = require_anymatch().default;
|
|
11839
|
+
var globParent = require_glob_parent();
|
|
11840
|
+
var isGlob = require_is_glob();
|
|
11841
|
+
var braces = require_braces();
|
|
11842
|
+
var normalizePath = require_normalize_path();
|
|
11843
|
+
var NodeFsHandler = require_nodefs_handler();
|
|
11844
|
+
var FsEventsHandler = require_fsevents_handler();
|
|
11845
|
+
var {
|
|
11846
|
+
EV_ALL,
|
|
11847
|
+
EV_READY,
|
|
11848
|
+
EV_ADD,
|
|
11849
|
+
EV_CHANGE,
|
|
11850
|
+
EV_UNLINK,
|
|
11851
|
+
EV_ADD_DIR,
|
|
11852
|
+
EV_UNLINK_DIR,
|
|
11853
|
+
EV_RAW,
|
|
11854
|
+
EV_ERROR,
|
|
11855
|
+
STR_CLOSE,
|
|
11856
|
+
STR_END,
|
|
11857
|
+
BACK_SLASH_RE,
|
|
11858
|
+
DOUBLE_SLASH_RE,
|
|
11859
|
+
SLASH_OR_BACK_SLASH_RE,
|
|
11860
|
+
DOT_RE,
|
|
11861
|
+
REPLACER_RE,
|
|
11862
|
+
SLASH,
|
|
11863
|
+
SLASH_SLASH,
|
|
11864
|
+
BRACE_START,
|
|
11865
|
+
BANG,
|
|
11866
|
+
ONE_DOT,
|
|
11867
|
+
TWO_DOTS,
|
|
11868
|
+
GLOBSTAR,
|
|
11869
|
+
SLASH_GLOBSTAR,
|
|
11870
|
+
ANYMATCH_OPTS,
|
|
11871
|
+
STRING_TYPE,
|
|
11872
|
+
FUNCTION_TYPE,
|
|
11873
|
+
EMPTY_STR,
|
|
11874
|
+
EMPTY_FN,
|
|
11875
|
+
isWindows,
|
|
11876
|
+
isMacos,
|
|
11877
|
+
isIBMi
|
|
11878
|
+
} = require_constants3();
|
|
11879
|
+
var stat = promisify2(fs3.stat);
|
|
11880
|
+
var readdir = promisify2(fs3.readdir);
|
|
11881
|
+
var arrify = (value = []) => Array.isArray(value) ? value : [value];
|
|
11882
|
+
var flatten = (list, result = []) => {
|
|
11883
|
+
list.forEach((item) => {
|
|
11884
|
+
if (Array.isArray(item)) {
|
|
11885
|
+
flatten(item, result);
|
|
11886
|
+
} else {
|
|
11887
|
+
result.push(item);
|
|
11888
|
+
}
|
|
11889
|
+
});
|
|
11890
|
+
return result;
|
|
11891
|
+
};
|
|
11892
|
+
var unifyPaths = (paths_) => {
|
|
11893
|
+
const paths = flatten(arrify(paths_));
|
|
11894
|
+
if (!paths.every((p) => typeof p === STRING_TYPE)) {
|
|
11895
|
+
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
11896
|
+
}
|
|
11897
|
+
return paths.map(normalizePathToUnix);
|
|
11898
|
+
};
|
|
11899
|
+
var toUnix = (string) => {
|
|
11900
|
+
let str = string.replace(BACK_SLASH_RE, SLASH);
|
|
11901
|
+
let prepend = false;
|
|
11902
|
+
if (str.startsWith(SLASH_SLASH)) {
|
|
11903
|
+
prepend = true;
|
|
11904
|
+
}
|
|
11905
|
+
while (str.match(DOUBLE_SLASH_RE)) {
|
|
11906
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
11907
|
+
}
|
|
11908
|
+
if (prepend) {
|
|
11909
|
+
str = SLASH + str;
|
|
11910
|
+
}
|
|
11911
|
+
return str;
|
|
11912
|
+
};
|
|
11913
|
+
var normalizePathToUnix = (path3) => toUnix(sysPath.normalize(toUnix(path3)));
|
|
11914
|
+
var normalizeIgnored = (cwd = EMPTY_STR) => (path3) => {
|
|
11915
|
+
if (typeof path3 !== STRING_TYPE)
|
|
11916
|
+
return path3;
|
|
11917
|
+
return normalizePathToUnix(sysPath.isAbsolute(path3) ? path3 : sysPath.join(cwd, path3));
|
|
11918
|
+
};
|
|
11919
|
+
var getAbsolutePath = (path3, cwd) => {
|
|
11920
|
+
if (sysPath.isAbsolute(path3)) {
|
|
11921
|
+
return path3;
|
|
11922
|
+
}
|
|
11923
|
+
if (path3.startsWith(BANG)) {
|
|
11924
|
+
return BANG + sysPath.join(cwd, path3.slice(1));
|
|
11925
|
+
}
|
|
11926
|
+
return sysPath.join(cwd, path3);
|
|
11927
|
+
};
|
|
11928
|
+
var undef = (opts, key) => opts[key] === void 0;
|
|
11929
|
+
var DirEntry = class {
|
|
11930
|
+
constructor(dir, removeWatcher) {
|
|
11931
|
+
this.path = dir;
|
|
11932
|
+
this._removeWatcher = removeWatcher;
|
|
11933
|
+
this.items = /* @__PURE__ */ new Set();
|
|
11934
|
+
}
|
|
11935
|
+
add(item) {
|
|
11936
|
+
const { items } = this;
|
|
11937
|
+
if (!items)
|
|
11938
|
+
return;
|
|
11939
|
+
if (item !== ONE_DOT && item !== TWO_DOTS)
|
|
11940
|
+
items.add(item);
|
|
11941
|
+
}
|
|
11942
|
+
async remove(item) {
|
|
11943
|
+
const { items } = this;
|
|
11944
|
+
if (!items)
|
|
11945
|
+
return;
|
|
11946
|
+
items.delete(item);
|
|
11947
|
+
if (items.size > 0)
|
|
11948
|
+
return;
|
|
11949
|
+
const dir = this.path;
|
|
11950
|
+
try {
|
|
11951
|
+
await readdir(dir);
|
|
11952
|
+
} catch (err) {
|
|
11953
|
+
if (this._removeWatcher) {
|
|
11954
|
+
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
|
|
11955
|
+
}
|
|
11956
|
+
}
|
|
11957
|
+
}
|
|
11958
|
+
has(item) {
|
|
11959
|
+
const { items } = this;
|
|
11960
|
+
if (!items)
|
|
11961
|
+
return;
|
|
11962
|
+
return items.has(item);
|
|
11963
|
+
}
|
|
11964
|
+
getChildren() {
|
|
11965
|
+
const { items } = this;
|
|
11966
|
+
if (!items)
|
|
11967
|
+
return;
|
|
11968
|
+
return [...items.values()];
|
|
11969
|
+
}
|
|
11970
|
+
dispose() {
|
|
11971
|
+
this.items.clear();
|
|
11972
|
+
delete this.path;
|
|
11973
|
+
delete this._removeWatcher;
|
|
11974
|
+
delete this.items;
|
|
11975
|
+
Object.freeze(this);
|
|
11976
|
+
}
|
|
11977
|
+
};
|
|
11978
|
+
var STAT_METHOD_F = "stat";
|
|
11979
|
+
var STAT_METHOD_L = "lstat";
|
|
11980
|
+
var WatchHelper = class {
|
|
11981
|
+
constructor(path3, watchPath, follow, fsw) {
|
|
11982
|
+
this.fsw = fsw;
|
|
11983
|
+
this.path = path3 = path3.replace(REPLACER_RE, EMPTY_STR);
|
|
11984
|
+
this.watchPath = watchPath;
|
|
11985
|
+
this.fullWatchPath = sysPath.resolve(watchPath);
|
|
11986
|
+
this.hasGlob = watchPath !== path3;
|
|
11987
|
+
if (path3 === EMPTY_STR)
|
|
11988
|
+
this.hasGlob = false;
|
|
11989
|
+
this.globSymlink = this.hasGlob && follow ? void 0 : false;
|
|
11990
|
+
this.globFilter = this.hasGlob ? anymatch(path3, void 0, ANYMATCH_OPTS) : false;
|
|
11991
|
+
this.dirParts = this.getDirParts(path3);
|
|
11992
|
+
this.dirParts.forEach((parts) => {
|
|
11993
|
+
if (parts.length > 1)
|
|
11994
|
+
parts.pop();
|
|
11995
|
+
});
|
|
11996
|
+
this.followSymlinks = follow;
|
|
11997
|
+
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
11998
|
+
}
|
|
11999
|
+
checkGlobSymlink(entry) {
|
|
12000
|
+
if (this.globSymlink === void 0) {
|
|
12001
|
+
this.globSymlink = entry.fullParentDir === this.fullWatchPath ? false : { realPath: entry.fullParentDir, linkPath: this.fullWatchPath };
|
|
12002
|
+
}
|
|
12003
|
+
if (this.globSymlink) {
|
|
12004
|
+
return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
|
|
12005
|
+
}
|
|
12006
|
+
return entry.fullPath;
|
|
12007
|
+
}
|
|
12008
|
+
entryPath(entry) {
|
|
12009
|
+
return sysPath.join(
|
|
12010
|
+
this.watchPath,
|
|
12011
|
+
sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
|
|
12012
|
+
);
|
|
12013
|
+
}
|
|
12014
|
+
filterPath(entry) {
|
|
12015
|
+
const { stats } = entry;
|
|
12016
|
+
if (stats && stats.isSymbolicLink())
|
|
12017
|
+
return this.filterDir(entry);
|
|
12018
|
+
const resolvedPath = this.entryPath(entry);
|
|
12019
|
+
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true;
|
|
12020
|
+
return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
|
|
12021
|
+
}
|
|
12022
|
+
getDirParts(path3) {
|
|
12023
|
+
if (!this.hasGlob)
|
|
12024
|
+
return [];
|
|
12025
|
+
const parts = [];
|
|
12026
|
+
const expandedPath = path3.includes(BRACE_START) ? braces.expand(path3) : [path3];
|
|
12027
|
+
expandedPath.forEach((path4) => {
|
|
12028
|
+
parts.push(sysPath.relative(this.watchPath, path4).split(SLASH_OR_BACK_SLASH_RE));
|
|
12029
|
+
});
|
|
12030
|
+
return parts;
|
|
12031
|
+
}
|
|
12032
|
+
filterDir(entry) {
|
|
12033
|
+
if (this.hasGlob) {
|
|
12034
|
+
const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
|
|
12035
|
+
let globstar = false;
|
|
12036
|
+
this.unmatchedGlob = !this.dirParts.some((parts) => {
|
|
12037
|
+
return parts.every((part, i) => {
|
|
12038
|
+
if (part === GLOBSTAR)
|
|
12039
|
+
globstar = true;
|
|
12040
|
+
return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
|
|
12041
|
+
});
|
|
12042
|
+
});
|
|
12043
|
+
}
|
|
12044
|
+
return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
12045
|
+
}
|
|
12046
|
+
};
|
|
12047
|
+
var FSWatcher = class extends EventEmitter {
|
|
12048
|
+
constructor(_opts) {
|
|
12049
|
+
super();
|
|
12050
|
+
const opts = {};
|
|
12051
|
+
if (_opts)
|
|
12052
|
+
Object.assign(opts, _opts);
|
|
12053
|
+
this._watched = /* @__PURE__ */ new Map();
|
|
12054
|
+
this._closers = /* @__PURE__ */ new Map();
|
|
12055
|
+
this._ignoredPaths = /* @__PURE__ */ new Set();
|
|
12056
|
+
this._throttled = /* @__PURE__ */ new Map();
|
|
12057
|
+
this._symlinkPaths = /* @__PURE__ */ new Map();
|
|
12058
|
+
this._streams = /* @__PURE__ */ new Set();
|
|
12059
|
+
this.closed = false;
|
|
12060
|
+
if (undef(opts, "persistent"))
|
|
12061
|
+
opts.persistent = true;
|
|
12062
|
+
if (undef(opts, "ignoreInitial"))
|
|
12063
|
+
opts.ignoreInitial = false;
|
|
12064
|
+
if (undef(opts, "ignorePermissionErrors"))
|
|
12065
|
+
opts.ignorePermissionErrors = false;
|
|
12066
|
+
if (undef(opts, "interval"))
|
|
12067
|
+
opts.interval = 100;
|
|
12068
|
+
if (undef(opts, "binaryInterval"))
|
|
12069
|
+
opts.binaryInterval = 300;
|
|
12070
|
+
if (undef(opts, "disableGlobbing"))
|
|
12071
|
+
opts.disableGlobbing = false;
|
|
12072
|
+
opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
|
|
12073
|
+
if (undef(opts, "useFsEvents"))
|
|
12074
|
+
opts.useFsEvents = !opts.usePolling;
|
|
12075
|
+
const canUseFsEvents = FsEventsHandler.canUse();
|
|
12076
|
+
if (!canUseFsEvents)
|
|
12077
|
+
opts.useFsEvents = false;
|
|
12078
|
+
if (undef(opts, "usePolling") && !opts.useFsEvents) {
|
|
12079
|
+
opts.usePolling = isMacos;
|
|
12080
|
+
}
|
|
12081
|
+
if (isIBMi) {
|
|
12082
|
+
opts.usePolling = true;
|
|
12083
|
+
}
|
|
12084
|
+
const envPoll = process.env.CHOKIDAR_USEPOLLING;
|
|
12085
|
+
if (envPoll !== void 0) {
|
|
12086
|
+
const envLower = envPoll.toLowerCase();
|
|
12087
|
+
if (envLower === "false" || envLower === "0") {
|
|
12088
|
+
opts.usePolling = false;
|
|
12089
|
+
} else if (envLower === "true" || envLower === "1") {
|
|
12090
|
+
opts.usePolling = true;
|
|
12091
|
+
} else {
|
|
12092
|
+
opts.usePolling = !!envLower;
|
|
12093
|
+
}
|
|
12094
|
+
}
|
|
12095
|
+
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
|
12096
|
+
if (envInterval) {
|
|
12097
|
+
opts.interval = Number.parseInt(envInterval, 10);
|
|
12098
|
+
}
|
|
12099
|
+
if (undef(opts, "atomic"))
|
|
12100
|
+
opts.atomic = !opts.usePolling && !opts.useFsEvents;
|
|
12101
|
+
if (opts.atomic)
|
|
12102
|
+
this._pendingUnlinks = /* @__PURE__ */ new Map();
|
|
12103
|
+
if (undef(opts, "followSymlinks"))
|
|
12104
|
+
opts.followSymlinks = true;
|
|
12105
|
+
if (undef(opts, "awaitWriteFinish"))
|
|
12106
|
+
opts.awaitWriteFinish = false;
|
|
12107
|
+
if (opts.awaitWriteFinish === true)
|
|
12108
|
+
opts.awaitWriteFinish = {};
|
|
12109
|
+
const awf = opts.awaitWriteFinish;
|
|
12110
|
+
if (awf) {
|
|
12111
|
+
if (!awf.stabilityThreshold)
|
|
12112
|
+
awf.stabilityThreshold = 2e3;
|
|
12113
|
+
if (!awf.pollInterval)
|
|
12114
|
+
awf.pollInterval = 100;
|
|
12115
|
+
this._pendingWrites = /* @__PURE__ */ new Map();
|
|
12116
|
+
}
|
|
12117
|
+
if (opts.ignored)
|
|
12118
|
+
opts.ignored = arrify(opts.ignored);
|
|
12119
|
+
let readyCalls = 0;
|
|
12120
|
+
this._emitReady = () => {
|
|
12121
|
+
readyCalls++;
|
|
12122
|
+
if (readyCalls >= this._readyCount) {
|
|
12123
|
+
this._emitReady = EMPTY_FN;
|
|
12124
|
+
this._readyEmitted = true;
|
|
12125
|
+
process.nextTick(() => this.emit(EV_READY));
|
|
12126
|
+
}
|
|
12127
|
+
};
|
|
12128
|
+
this._emitRaw = (...args2) => this.emit(EV_RAW, ...args2);
|
|
12129
|
+
this._readyEmitted = false;
|
|
12130
|
+
this.options = opts;
|
|
12131
|
+
if (opts.useFsEvents) {
|
|
12132
|
+
this._fsEventsHandler = new FsEventsHandler(this);
|
|
12133
|
+
} else {
|
|
12134
|
+
this._nodeFsHandler = new NodeFsHandler(this);
|
|
12135
|
+
}
|
|
12136
|
+
Object.freeze(opts);
|
|
12137
|
+
}
|
|
12138
|
+
add(paths_, _origAdd, _internal) {
|
|
12139
|
+
const { cwd, disableGlobbing } = this.options;
|
|
12140
|
+
this.closed = false;
|
|
12141
|
+
let paths = unifyPaths(paths_);
|
|
12142
|
+
if (cwd) {
|
|
12143
|
+
paths = paths.map((path3) => {
|
|
12144
|
+
const absPath = getAbsolutePath(path3, cwd);
|
|
12145
|
+
if (disableGlobbing || !isGlob(path3)) {
|
|
12146
|
+
return absPath;
|
|
12147
|
+
}
|
|
12148
|
+
return normalizePath(absPath);
|
|
12149
|
+
});
|
|
12150
|
+
}
|
|
12151
|
+
paths = paths.filter((path3) => {
|
|
12152
|
+
if (path3.startsWith(BANG)) {
|
|
12153
|
+
this._ignoredPaths.add(path3.slice(1));
|
|
12154
|
+
return false;
|
|
12155
|
+
}
|
|
12156
|
+
this._ignoredPaths.delete(path3);
|
|
12157
|
+
this._ignoredPaths.delete(path3 + SLASH_GLOBSTAR);
|
|
12158
|
+
this._userIgnored = void 0;
|
|
12159
|
+
return true;
|
|
12160
|
+
});
|
|
12161
|
+
if (this.options.useFsEvents && this._fsEventsHandler) {
|
|
12162
|
+
if (!this._readyCount)
|
|
12163
|
+
this._readyCount = paths.length;
|
|
12164
|
+
if (this.options.persistent)
|
|
12165
|
+
this._readyCount *= 2;
|
|
12166
|
+
paths.forEach((path3) => this._fsEventsHandler._addToFsEvents(path3));
|
|
12167
|
+
} else {
|
|
12168
|
+
if (!this._readyCount)
|
|
12169
|
+
this._readyCount = 0;
|
|
12170
|
+
this._readyCount += paths.length;
|
|
12171
|
+
Promise.all(
|
|
12172
|
+
paths.map(async (path3) => {
|
|
12173
|
+
const res = await this._nodeFsHandler._addToNodeFs(path3, !_internal, 0, 0, _origAdd);
|
|
12174
|
+
if (res)
|
|
12175
|
+
this._emitReady();
|
|
12176
|
+
return res;
|
|
12177
|
+
})
|
|
12178
|
+
).then((results) => {
|
|
12179
|
+
if (this.closed)
|
|
12180
|
+
return;
|
|
12181
|
+
results.filter((item) => item).forEach((item) => {
|
|
12182
|
+
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
|
|
12183
|
+
});
|
|
12184
|
+
});
|
|
12185
|
+
}
|
|
12186
|
+
return this;
|
|
12187
|
+
}
|
|
12188
|
+
unwatch(paths_) {
|
|
12189
|
+
if (this.closed)
|
|
12190
|
+
return this;
|
|
12191
|
+
const paths = unifyPaths(paths_);
|
|
12192
|
+
const { cwd } = this.options;
|
|
12193
|
+
paths.forEach((path3) => {
|
|
12194
|
+
if (!sysPath.isAbsolute(path3) && !this._closers.has(path3)) {
|
|
12195
|
+
if (cwd)
|
|
12196
|
+
path3 = sysPath.join(cwd, path3);
|
|
12197
|
+
path3 = sysPath.resolve(path3);
|
|
12198
|
+
}
|
|
12199
|
+
this._closePath(path3);
|
|
12200
|
+
this._ignoredPaths.add(path3);
|
|
12201
|
+
if (this._watched.has(path3)) {
|
|
12202
|
+
this._ignoredPaths.add(path3 + SLASH_GLOBSTAR);
|
|
12203
|
+
}
|
|
12204
|
+
this._userIgnored = void 0;
|
|
12205
|
+
});
|
|
12206
|
+
return this;
|
|
12207
|
+
}
|
|
12208
|
+
close() {
|
|
12209
|
+
if (this.closed)
|
|
12210
|
+
return this._closePromise;
|
|
12211
|
+
this.closed = true;
|
|
12212
|
+
this.removeAllListeners();
|
|
12213
|
+
const closers = [];
|
|
12214
|
+
this._closers.forEach((closerList) => closerList.forEach((closer) => {
|
|
12215
|
+
const promise = closer();
|
|
12216
|
+
if (promise instanceof Promise)
|
|
12217
|
+
closers.push(promise);
|
|
12218
|
+
}));
|
|
12219
|
+
this._streams.forEach((stream) => stream.destroy());
|
|
12220
|
+
this._userIgnored = void 0;
|
|
12221
|
+
this._readyCount = 0;
|
|
12222
|
+
this._readyEmitted = false;
|
|
12223
|
+
this._watched.forEach((dirent) => dirent.dispose());
|
|
12224
|
+
["closers", "watched", "streams", "symlinkPaths", "throttled"].forEach((key) => {
|
|
12225
|
+
this[`_${key}`].clear();
|
|
12226
|
+
});
|
|
12227
|
+
this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve();
|
|
12228
|
+
return this._closePromise;
|
|
12229
|
+
}
|
|
12230
|
+
getWatched() {
|
|
12231
|
+
const watchList = {};
|
|
12232
|
+
this._watched.forEach((entry, dir) => {
|
|
12233
|
+
const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
|
|
12234
|
+
watchList[key || ONE_DOT] = entry.getChildren().sort();
|
|
12235
|
+
});
|
|
12236
|
+
return watchList;
|
|
12237
|
+
}
|
|
12238
|
+
emitWithAll(event, args2) {
|
|
12239
|
+
this.emit(...args2);
|
|
12240
|
+
if (event !== EV_ERROR)
|
|
12241
|
+
this.emit(EV_ALL, ...args2);
|
|
12242
|
+
}
|
|
12243
|
+
async _emit(event, path3, val1, val2, val3) {
|
|
12244
|
+
if (this.closed)
|
|
12245
|
+
return;
|
|
12246
|
+
const opts = this.options;
|
|
12247
|
+
if (isWindows)
|
|
12248
|
+
path3 = sysPath.normalize(path3);
|
|
12249
|
+
if (opts.cwd)
|
|
12250
|
+
path3 = sysPath.relative(opts.cwd, path3);
|
|
12251
|
+
const args2 = [event, path3];
|
|
12252
|
+
if (val3 !== void 0)
|
|
12253
|
+
args2.push(val1, val2, val3);
|
|
12254
|
+
else if (val2 !== void 0)
|
|
12255
|
+
args2.push(val1, val2);
|
|
12256
|
+
else if (val1 !== void 0)
|
|
12257
|
+
args2.push(val1);
|
|
12258
|
+
const awf = opts.awaitWriteFinish;
|
|
12259
|
+
let pw;
|
|
12260
|
+
if (awf && (pw = this._pendingWrites.get(path3))) {
|
|
12261
|
+
pw.lastChange = new Date();
|
|
12262
|
+
return this;
|
|
12263
|
+
}
|
|
12264
|
+
if (opts.atomic) {
|
|
12265
|
+
if (event === EV_UNLINK) {
|
|
12266
|
+
this._pendingUnlinks.set(path3, args2);
|
|
12267
|
+
setTimeout(() => {
|
|
12268
|
+
this._pendingUnlinks.forEach((entry, path4) => {
|
|
12269
|
+
this.emit(...entry);
|
|
12270
|
+
this.emit(EV_ALL, ...entry);
|
|
12271
|
+
this._pendingUnlinks.delete(path4);
|
|
12272
|
+
});
|
|
12273
|
+
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
12274
|
+
return this;
|
|
12275
|
+
}
|
|
12276
|
+
if (event === EV_ADD && this._pendingUnlinks.has(path3)) {
|
|
12277
|
+
event = args2[0] = EV_CHANGE;
|
|
12278
|
+
this._pendingUnlinks.delete(path3);
|
|
12279
|
+
}
|
|
12280
|
+
}
|
|
12281
|
+
if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
|
|
12282
|
+
const awfEmit = (err, stats) => {
|
|
12283
|
+
if (err) {
|
|
12284
|
+
event = args2[0] = EV_ERROR;
|
|
12285
|
+
args2[1] = err;
|
|
12286
|
+
this.emitWithAll(event, args2);
|
|
12287
|
+
} else if (stats) {
|
|
12288
|
+
if (args2.length > 2) {
|
|
12289
|
+
args2[2] = stats;
|
|
12290
|
+
} else {
|
|
12291
|
+
args2.push(stats);
|
|
12292
|
+
}
|
|
12293
|
+
this.emitWithAll(event, args2);
|
|
12294
|
+
}
|
|
12295
|
+
};
|
|
12296
|
+
this._awaitWriteFinish(path3, awf.stabilityThreshold, event, awfEmit);
|
|
12297
|
+
return this;
|
|
12298
|
+
}
|
|
12299
|
+
if (event === EV_CHANGE) {
|
|
12300
|
+
const isThrottled = !this._throttle(EV_CHANGE, path3, 50);
|
|
12301
|
+
if (isThrottled)
|
|
12302
|
+
return this;
|
|
12303
|
+
}
|
|
12304
|
+
if (opts.alwaysStat && val1 === void 0 && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)) {
|
|
12305
|
+
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path3) : path3;
|
|
12306
|
+
let stats;
|
|
12307
|
+
try {
|
|
12308
|
+
stats = await stat(fullPath);
|
|
12309
|
+
} catch (err) {
|
|
12310
|
+
}
|
|
12311
|
+
if (!stats || this.closed)
|
|
12312
|
+
return;
|
|
12313
|
+
args2.push(stats);
|
|
12314
|
+
}
|
|
12315
|
+
this.emitWithAll(event, args2);
|
|
12316
|
+
return this;
|
|
12317
|
+
}
|
|
12318
|
+
_handleError(error) {
|
|
12319
|
+
const code = error && error.code;
|
|
12320
|
+
if (error && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
|
|
12321
|
+
this.emit(EV_ERROR, error);
|
|
12322
|
+
}
|
|
12323
|
+
return error || this.closed;
|
|
12324
|
+
}
|
|
12325
|
+
_throttle(actionType, path3, timeout) {
|
|
12326
|
+
if (!this._throttled.has(actionType)) {
|
|
12327
|
+
this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
|
12328
|
+
}
|
|
12329
|
+
const action = this._throttled.get(actionType);
|
|
12330
|
+
const actionPath = action.get(path3);
|
|
12331
|
+
if (actionPath) {
|
|
12332
|
+
actionPath.count++;
|
|
12333
|
+
return false;
|
|
12334
|
+
}
|
|
12335
|
+
let timeoutObject;
|
|
12336
|
+
const clear = () => {
|
|
12337
|
+
const item = action.get(path3);
|
|
12338
|
+
const count = item ? item.count : 0;
|
|
12339
|
+
action.delete(path3);
|
|
12340
|
+
clearTimeout(timeoutObject);
|
|
12341
|
+
if (item)
|
|
12342
|
+
clearTimeout(item.timeoutObject);
|
|
12343
|
+
return count;
|
|
12344
|
+
};
|
|
12345
|
+
timeoutObject = setTimeout(clear, timeout);
|
|
12346
|
+
const thr = { timeoutObject, clear, count: 0 };
|
|
12347
|
+
action.set(path3, thr);
|
|
12348
|
+
return thr;
|
|
12349
|
+
}
|
|
12350
|
+
_incrReadyCount() {
|
|
12351
|
+
return this._readyCount++;
|
|
12352
|
+
}
|
|
12353
|
+
_awaitWriteFinish(path3, threshold, event, awfEmit) {
|
|
12354
|
+
let timeoutHandler;
|
|
12355
|
+
let fullPath = path3;
|
|
12356
|
+
if (this.options.cwd && !sysPath.isAbsolute(path3)) {
|
|
12357
|
+
fullPath = sysPath.join(this.options.cwd, path3);
|
|
12358
|
+
}
|
|
12359
|
+
const now = new Date();
|
|
12360
|
+
const awaitWriteFinish = (prevStat) => {
|
|
12361
|
+
fs3.stat(fullPath, (err, curStat) => {
|
|
12362
|
+
if (err || !this._pendingWrites.has(path3)) {
|
|
12363
|
+
if (err && err.code !== "ENOENT")
|
|
12364
|
+
awfEmit(err);
|
|
12365
|
+
return;
|
|
12366
|
+
}
|
|
12367
|
+
const now2 = Number(new Date());
|
|
12368
|
+
if (prevStat && curStat.size !== prevStat.size) {
|
|
12369
|
+
this._pendingWrites.get(path3).lastChange = now2;
|
|
12370
|
+
}
|
|
12371
|
+
const pw = this._pendingWrites.get(path3);
|
|
12372
|
+
const df = now2 - pw.lastChange;
|
|
12373
|
+
if (df >= threshold) {
|
|
12374
|
+
this._pendingWrites.delete(path3);
|
|
12375
|
+
awfEmit(void 0, curStat);
|
|
12376
|
+
} else {
|
|
12377
|
+
timeoutHandler = setTimeout(
|
|
12378
|
+
awaitWriteFinish,
|
|
12379
|
+
this.options.awaitWriteFinish.pollInterval,
|
|
12380
|
+
curStat
|
|
12381
|
+
);
|
|
12382
|
+
}
|
|
12383
|
+
});
|
|
12384
|
+
};
|
|
12385
|
+
if (!this._pendingWrites.has(path3)) {
|
|
12386
|
+
this._pendingWrites.set(path3, {
|
|
12387
|
+
lastChange: now,
|
|
12388
|
+
cancelWait: () => {
|
|
12389
|
+
this._pendingWrites.delete(path3);
|
|
12390
|
+
clearTimeout(timeoutHandler);
|
|
12391
|
+
return event;
|
|
12392
|
+
}
|
|
12393
|
+
});
|
|
12394
|
+
timeoutHandler = setTimeout(
|
|
12395
|
+
awaitWriteFinish,
|
|
12396
|
+
this.options.awaitWriteFinish.pollInterval
|
|
12397
|
+
);
|
|
12398
|
+
}
|
|
12399
|
+
}
|
|
12400
|
+
_getGlobIgnored() {
|
|
12401
|
+
return [...this._ignoredPaths.values()];
|
|
12402
|
+
}
|
|
12403
|
+
_isIgnored(path3, stats) {
|
|
12404
|
+
if (this.options.atomic && DOT_RE.test(path3))
|
|
12405
|
+
return true;
|
|
12406
|
+
if (!this._userIgnored) {
|
|
12407
|
+
const { cwd } = this.options;
|
|
12408
|
+
const ign = this.options.ignored;
|
|
12409
|
+
const ignored = ign && ign.map(normalizeIgnored(cwd));
|
|
12410
|
+
const paths = arrify(ignored).filter((path4) => typeof path4 === STRING_TYPE && !isGlob(path4)).map((path4) => path4 + SLASH_GLOBSTAR);
|
|
12411
|
+
const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
|
|
12412
|
+
this._userIgnored = anymatch(list, void 0, ANYMATCH_OPTS);
|
|
12413
|
+
}
|
|
12414
|
+
return this._userIgnored([path3, stats]);
|
|
12415
|
+
}
|
|
12416
|
+
_isntIgnored(path3, stat2) {
|
|
12417
|
+
return !this._isIgnored(path3, stat2);
|
|
12418
|
+
}
|
|
12419
|
+
_getWatchHelpers(path3, depth) {
|
|
12420
|
+
const watchPath = depth || this.options.disableGlobbing || !isGlob(path3) ? path3 : globParent(path3);
|
|
12421
|
+
const follow = this.options.followSymlinks;
|
|
12422
|
+
return new WatchHelper(path3, watchPath, follow, this);
|
|
12423
|
+
}
|
|
12424
|
+
_getWatchedDir(directory) {
|
|
12425
|
+
if (!this._boundRemove)
|
|
12426
|
+
this._boundRemove = this._remove.bind(this);
|
|
12427
|
+
const dir = sysPath.resolve(directory);
|
|
12428
|
+
if (!this._watched.has(dir))
|
|
12429
|
+
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
12430
|
+
return this._watched.get(dir);
|
|
12431
|
+
}
|
|
12432
|
+
_hasReadPermissions(stats) {
|
|
12433
|
+
if (this.options.ignorePermissionErrors)
|
|
12434
|
+
return true;
|
|
12435
|
+
const md = stats && Number.parseInt(stats.mode, 10);
|
|
12436
|
+
const st = md & 511;
|
|
12437
|
+
const it = Number.parseInt(st.toString(8)[0], 10);
|
|
12438
|
+
return Boolean(4 & it);
|
|
12439
|
+
}
|
|
12440
|
+
_remove(directory, item, isDirectory) {
|
|
12441
|
+
const path3 = sysPath.join(directory, item);
|
|
12442
|
+
const fullPath = sysPath.resolve(path3);
|
|
12443
|
+
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path3) || this._watched.has(fullPath);
|
|
12444
|
+
if (!this._throttle("remove", path3, 100))
|
|
12445
|
+
return;
|
|
12446
|
+
if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) {
|
|
12447
|
+
this.add(directory, item, true);
|
|
12448
|
+
}
|
|
12449
|
+
const wp = this._getWatchedDir(path3);
|
|
12450
|
+
const nestedDirectoryChildren = wp.getChildren();
|
|
12451
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path3, nested));
|
|
12452
|
+
const parent = this._getWatchedDir(directory);
|
|
12453
|
+
const wasTracked = parent.has(item);
|
|
12454
|
+
parent.remove(item);
|
|
12455
|
+
if (this._symlinkPaths.has(fullPath)) {
|
|
12456
|
+
this._symlinkPaths.delete(fullPath);
|
|
12457
|
+
}
|
|
12458
|
+
let relPath = path3;
|
|
12459
|
+
if (this.options.cwd)
|
|
12460
|
+
relPath = sysPath.relative(this.options.cwd, path3);
|
|
12461
|
+
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
12462
|
+
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
12463
|
+
if (event === EV_ADD)
|
|
12464
|
+
return;
|
|
12465
|
+
}
|
|
12466
|
+
this._watched.delete(path3);
|
|
12467
|
+
this._watched.delete(fullPath);
|
|
12468
|
+
const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
|
|
12469
|
+
if (wasTracked && !this._isIgnored(path3))
|
|
12470
|
+
this._emit(eventName, path3);
|
|
12471
|
+
if (!this.options.useFsEvents) {
|
|
12472
|
+
this._closePath(path3);
|
|
12473
|
+
}
|
|
12474
|
+
}
|
|
12475
|
+
_closePath(path3) {
|
|
12476
|
+
this._closeFile(path3);
|
|
12477
|
+
const dir = sysPath.dirname(path3);
|
|
12478
|
+
this._getWatchedDir(dir).remove(sysPath.basename(path3));
|
|
12479
|
+
}
|
|
12480
|
+
_closeFile(path3) {
|
|
12481
|
+
const closers = this._closers.get(path3);
|
|
12482
|
+
if (!closers)
|
|
12483
|
+
return;
|
|
12484
|
+
closers.forEach((closer) => closer());
|
|
12485
|
+
this._closers.delete(path3);
|
|
12486
|
+
}
|
|
12487
|
+
_addPathCloser(path3, closer) {
|
|
12488
|
+
if (!closer)
|
|
12489
|
+
return;
|
|
12490
|
+
let list = this._closers.get(path3);
|
|
12491
|
+
if (!list) {
|
|
12492
|
+
list = [];
|
|
12493
|
+
this._closers.set(path3, list);
|
|
12494
|
+
}
|
|
12495
|
+
list.push(closer);
|
|
12496
|
+
}
|
|
12497
|
+
_readdirp(root, opts) {
|
|
12498
|
+
if (this.closed)
|
|
12499
|
+
return;
|
|
12500
|
+
const options = { type: EV_ALL, alwaysStat: true, lstat: true, ...opts };
|
|
12501
|
+
let stream = readdirp(root, options);
|
|
12502
|
+
this._streams.add(stream);
|
|
12503
|
+
stream.once(STR_CLOSE, () => {
|
|
12504
|
+
stream = void 0;
|
|
12505
|
+
});
|
|
12506
|
+
stream.once(STR_END, () => {
|
|
12507
|
+
if (stream) {
|
|
12508
|
+
this._streams.delete(stream);
|
|
12509
|
+
stream = void 0;
|
|
12510
|
+
}
|
|
12511
|
+
});
|
|
12512
|
+
return stream;
|
|
12513
|
+
}
|
|
12514
|
+
};
|
|
12515
|
+
exports.FSWatcher = FSWatcher;
|
|
12516
|
+
var watch = (paths, options) => {
|
|
12517
|
+
const watcher = new FSWatcher(options);
|
|
12518
|
+
watcher.add(paths);
|
|
12519
|
+
return watcher;
|
|
12520
|
+
};
|
|
12521
|
+
exports.watch = watch;
|
|
12522
|
+
}
|
|
12523
|
+
});
|
|
12524
|
+
|
|
7624
12525
|
// ../../node_modules/nunjucks/src/node-loaders.js
|
|
7625
12526
|
var require_node_loaders = __commonJS({
|
|
7626
12527
|
"../../node_modules/nunjucks/src/node-loaders.js"(exports, module2) {
|
|
@@ -7662,7 +12563,7 @@ var require_node_loaders = __commonJS({
|
|
|
7662
12563
|
}
|
|
7663
12564
|
if (opts.watch) {
|
|
7664
12565
|
try {
|
|
7665
|
-
chokidar =
|
|
12566
|
+
chokidar = require_chokidar();
|
|
7666
12567
|
} catch (e) {
|
|
7667
12568
|
throw new Error("watch requires chokidar to be installed");
|
|
7668
12569
|
}
|
|
@@ -7716,7 +12617,7 @@ var require_node_loaders = __commonJS({
|
|
|
7716
12617
|
_this2.noCache = !!opts.noCache;
|
|
7717
12618
|
if (opts.watch) {
|
|
7718
12619
|
try {
|
|
7719
|
-
chokidar =
|
|
12620
|
+
chokidar = require_chokidar();
|
|
7720
12621
|
} catch (e) {
|
|
7721
12622
|
throw new Error("watch requires chokidar to be installed");
|
|
7722
12623
|
}
|
|
@@ -8970,7 +13871,7 @@ var require_package = __commonJS({
|
|
|
8970
13871
|
"package.json"(exports, module2) {
|
|
8971
13872
|
module2.exports = {
|
|
8972
13873
|
name: "@html-validate/eslint-config",
|
|
8973
|
-
version: "5.4.
|
|
13874
|
+
version: "5.4.21",
|
|
8974
13875
|
description: "Eslint sharable config used by the various HTML-validate packages",
|
|
8975
13876
|
keywords: [
|
|
8976
13877
|
"eslint"
|
|
@@ -9004,7 +13905,7 @@ var require_package = __commonJS({
|
|
|
9004
13905
|
},
|
|
9005
13906
|
dependencies: {
|
|
9006
13907
|
"@rushstack/eslint-patch": "1.1.4",
|
|
9007
|
-
eslint: "8.
|
|
13908
|
+
eslint: "8.23.0",
|
|
9008
13909
|
"eslint-config-prettier": "8.5.0",
|
|
9009
13910
|
"eslint-config-sidvind": "1.3.2",
|
|
9010
13911
|
"eslint-formatter-gitlab": "3.0.0",
|
|
@@ -9013,7 +13914,7 @@ var require_package = __commonJS({
|
|
|
9013
13914
|
"eslint-plugin-node": "11.1.0",
|
|
9014
13915
|
"eslint-plugin-prettier": "4.2.1",
|
|
9015
13916
|
"eslint-plugin-security": "1.5.0",
|
|
9016
|
-
"eslint-plugin-sonarjs": "0.
|
|
13917
|
+
"eslint-plugin-sonarjs": "0.15.0"
|
|
9017
13918
|
},
|
|
9018
13919
|
devDependencies: {
|
|
9019
13920
|
argparse: "2.0.1",
|
|
@@ -9371,4 +14272,40 @@ if (!args.mode) {
|
|
|
9371
14272
|
process.exit(1);
|
|
9372
14273
|
}
|
|
9373
14274
|
run(args);
|
|
14275
|
+
/*!
|
|
14276
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
14277
|
+
*
|
|
14278
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
14279
|
+
* Licensed under the MIT License.
|
|
14280
|
+
*/
|
|
14281
|
+
/*!
|
|
14282
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
14283
|
+
*
|
|
14284
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
14285
|
+
* Licensed under the MIT License.
|
|
14286
|
+
*/
|
|
14287
|
+
/*!
|
|
14288
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
14289
|
+
*
|
|
14290
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
14291
|
+
* Released under the MIT License.
|
|
14292
|
+
*/
|
|
14293
|
+
/*!
|
|
14294
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
14295
|
+
*
|
|
14296
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
14297
|
+
* Released under the MIT License.
|
|
14298
|
+
*/
|
|
14299
|
+
/*!
|
|
14300
|
+
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
14301
|
+
*
|
|
14302
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
14303
|
+
* Released under the MIT License.
|
|
14304
|
+
*/
|
|
14305
|
+
/*!
|
|
14306
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
14307
|
+
*
|
|
14308
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
14309
|
+
* Released under the MIT License.
|
|
14310
|
+
*/
|
|
9374
14311
|
//# sourceMappingURL=cli.js.map
|