@bleedingdev/modern-js-utils 3.9.3-ultramodern.1 → 3.9.3-ultramodern.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiled/address/provenance.json +1 -1
- package/dist/compiled/browserslist/index.js +7 -7
- package/dist/compiled/browserslist/provenance.json +1 -1
- package/dist/compiled/chalk/provenance.json +1 -1
- package/dist/compiled/chokidar/index.d.mts +18 -9
- package/dist/compiled/chokidar/index.d.ts +18 -9
- package/dist/compiled/chokidar/index.js +194 -171
- package/dist/compiled/chokidar/index.mjs +94 -71
- package/dist/compiled/chokidar/provenance.json +2 -2
- package/dist/compiled/commander/provenance.json +1 -1
- package/dist/compiled/debug/provenance.json +1 -1
- package/dist/compiled/dotenv-expand/LICENSE +11 -7
- package/dist/compiled/dotenv-expand/declaration-licenses/dotenv-expand/LICENSE +11 -7
- package/dist/compiled/dotenv-expand/index.js +5545 -61
- package/dist/compiled/dotenv-expand/licenses-cjs.txt +12 -7
- package/dist/compiled/dotenv-expand/package.json +1 -1
- package/dist/compiled/dotenv-expand/provenance.json +7 -7
- package/dist/compiled/execa/index.d.mts +67 -33
- package/dist/compiled/execa/index.d.ts +67 -33
- package/dist/compiled/execa/index.js +1848 -1369
- package/dist/compiled/execa/index.mjs +1851 -1372
- package/dist/compiled/execa/package.json +1 -1
- package/dist/compiled/execa/provenance.json +3 -3
- package/dist/compiled/filesize/index.js +26 -25
- package/dist/compiled/filesize/index.js.LICENSE.txt +1 -1
- package/dist/compiled/filesize/index.mjs +25 -24
- package/dist/compiled/filesize/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/filesize/package.json +1 -1
- package/dist/compiled/filesize/provenance.json +4 -4
- package/dist/compiled/fs-extra/provenance.json +1 -1
- package/dist/compiled/glob/provenance.json +3 -3
- package/dist/compiled/globby/index.js +431 -139
- package/dist/compiled/globby/index.mjs +576 -284
- package/dist/compiled/globby/provenance.json +1 -1
- package/dist/compiled/gzip-size/provenance.json +1 -1
- package/dist/compiled/import-lazy/provenance.json +1 -1
- package/dist/compiled/inquirer/index.d.mts +10 -0
- package/dist/compiled/inquirer/index.d.ts +10 -0
- package/dist/compiled/inquirer/index.js +112 -96
- package/dist/compiled/inquirer/index.mjs +98 -82
- package/dist/compiled/inquirer/licenses-cjs.txt +26 -0
- package/dist/compiled/inquirer/licenses-esm.txt +26 -0
- package/dist/compiled/inquirer/package.json +1 -1
- package/dist/compiled/inquirer/provenance.json +18 -18
- package/dist/compiled/js-yaml/index.js +258 -208
- package/dist/compiled/js-yaml/index.js.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/index.mjs +328 -278
- package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +1 -1
- package/dist/compiled/js-yaml/package.json +1 -1
- package/dist/compiled/js-yaml/provenance.json +4 -4
- package/dist/compiled/json5/provenance.json +1 -1
- package/dist/compiled/lodash/common/function.d.ts +2 -2
- package/dist/compiled/lodash/provenance.json +2 -2
- package/dist/compiled/mime-types/provenance.json +1 -1
- package/dist/compiled/minimist/provenance.json +1 -1
- package/dist/compiled/nanoid/index.d.mts +3 -3
- package/dist/compiled/nanoid/index.d.ts +3 -3
- package/dist/compiled/nanoid/index.js +10 -10
- package/dist/compiled/nanoid/index.mjs +10 -10
- package/dist/compiled/nanoid/package.json +1 -1
- package/dist/compiled/nanoid/provenance.json +4 -4
- package/dist/compiled/ora/index.js +310 -286
- package/dist/compiled/ora/index.mjs +651 -627
- package/dist/compiled/ora/provenance.json +1 -1
- package/dist/compiled/pkg-up/provenance.json +1 -1
- package/dist/compiled/semver/provenance.json +1 -1
- package/dist/compiled/signale/provenance.json +1 -1
- package/dist/compiled/slash/provenance.json +1 -1
- package/dist/compiled/strip-ansi/index.js +1 -1
- package/dist/compiled/strip-ansi/index.mjs +3 -3
- package/dist/compiled/strip-ansi/provenance.json +1 -1
- package/dist/compiled/tsconfig-paths/provenance.json +1 -1
- package/dist/compiled/upath/provenance.json +1 -1
- package/dist/compiled/url-join/index.js +56 -29
- package/dist/compiled/url-join/index.mjs +57 -30
- package/dist/compiled/url-join/package.json +1 -1
- package/dist/compiled/url-join/provenance.json +4 -4
- package/dist/types/cli/commands.d.ts +1 -1
- package/dist/types/cli/modulePath.d.ts +1 -1
- package/dist/types/compiled.d.ts +13 -13
- package/package.json +8 -8
|
@@ -208,7 +208,7 @@ var e = {
|
|
|
208
208
|
358: (t, e, n)=>{
|
|
209
209
|
const r = n(816);
|
|
210
210
|
const s = n(372);
|
|
211
|
-
const { MAX_LENGTH: o, CHAR_BACKSLASH: i, CHAR_BACKTICK: a, CHAR_COMMA: u, CHAR_DOT: c, CHAR_LEFT_PARENTHESES: l, CHAR_RIGHT_PARENTHESES: f, CHAR_LEFT_CURLY_BRACE: p, CHAR_RIGHT_CURLY_BRACE: d, CHAR_LEFT_SQUARE_BRACKET: h, CHAR_RIGHT_SQUARE_BRACKET: g, CHAR_DOUBLE_QUOTE: _, CHAR_SINGLE_QUOTE: A, CHAR_NO_BREAK_SPACE:
|
|
211
|
+
const { MAX_LENGTH: o, CHAR_BACKSLASH: i, CHAR_BACKTICK: a, CHAR_COMMA: u, CHAR_DOT: c, CHAR_LEFT_PARENTHESES: l, CHAR_RIGHT_PARENTHESES: f, CHAR_LEFT_CURLY_BRACE: p, CHAR_RIGHT_CURLY_BRACE: d, CHAR_LEFT_SQUARE_BRACKET: h, CHAR_RIGHT_SQUARE_BRACKET: g, CHAR_DOUBLE_QUOTE: _, CHAR_SINGLE_QUOTE: A, CHAR_NO_BREAK_SPACE: m, CHAR_ZERO_WIDTH_NOBREAK_SPACE: R } = n(872);
|
|
212
212
|
const parse = (t, e = {})=>{
|
|
213
213
|
if ("string" != typeof t) throw new TypeError("Expected a string");
|
|
214
214
|
const n = e || {};
|
|
@@ -248,7 +248,7 @@ var e = {
|
|
|
248
248
|
while(H < $){
|
|
249
249
|
C = w[w.length - 1];
|
|
250
250
|
O = advance();
|
|
251
|
-
if (O ===
|
|
251
|
+
if (O === R || O === m) continue;
|
|
252
252
|
if (O === i) {
|
|
253
253
|
push({
|
|
254
254
|
type: "text",
|
|
@@ -725,7 +725,7 @@ var e = {
|
|
|
725
725
|
};
|
|
726
726
|
t.exports = fill;
|
|
727
727
|
},
|
|
728
|
-
|
|
728
|
+
425: (t)=>{
|
|
729
729
|
function makeArray(t) {
|
|
730
730
|
return Array.isArray(t) ? t : [
|
|
731
731
|
t
|
|
@@ -735,45 +735,153 @@ var e = {
|
|
|
735
735
|
const n = "";
|
|
736
736
|
const r = " ";
|
|
737
737
|
const s = "\\";
|
|
738
|
-
const o =
|
|
739
|
-
const i =
|
|
740
|
-
const a =
|
|
741
|
-
const u =
|
|
742
|
-
const c =
|
|
743
|
-
const l =
|
|
744
|
-
const f =
|
|
745
|
-
const p =
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
738
|
+
const o = /[.*+?()[\]{}^$|\\/]/;
|
|
739
|
+
const i = "\ufeff";
|
|
740
|
+
const a = /(?:[^\\]|^)\\$/;
|
|
741
|
+
const u = /^\\!/;
|
|
742
|
+
const c = /^\\#/;
|
|
743
|
+
const l = /\r?\n/g;
|
|
744
|
+
const f = "//";
|
|
745
|
+
const p = 47;
|
|
746
|
+
const d = 46;
|
|
747
|
+
const h = "/";
|
|
748
|
+
let g = "node-ignore";
|
|
749
|
+
if ("u" > typeof Symbol) g = Symbol.for("node-ignore");
|
|
750
|
+
const _ = g;
|
|
749
751
|
const define = (t, e, n)=>{
|
|
750
752
|
Object.defineProperty(t, e, {
|
|
751
753
|
value: n
|
|
752
754
|
});
|
|
753
755
|
return n;
|
|
754
756
|
};
|
|
755
|
-
const g = /([0-z])-([0-z])/g;
|
|
756
757
|
const RETURN_FALSE = ()=>false;
|
|
757
|
-
const sanitizeRange = (t)=>t.replace(g, (t, e, r)=>e.charCodeAt(0) <= r.charCodeAt(0) ? t : n);
|
|
758
758
|
const cleanRangeBackSlash = (t)=>{
|
|
759
759
|
const { length: e } = t;
|
|
760
760
|
return t.slice(0, e - e % 2);
|
|
761
761
|
};
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
[
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
762
|
+
const A = {
|
|
763
|
+
alnum: "0-9A-Za-z",
|
|
764
|
+
alpha: "A-Za-z",
|
|
765
|
+
blank: " \\t",
|
|
766
|
+
cntrl: "\\x00-\\x1f\\x7f",
|
|
767
|
+
digit: "0-9",
|
|
768
|
+
graph: "!-.0-~",
|
|
769
|
+
lower: "a-z",
|
|
770
|
+
print: " -.0-~",
|
|
771
|
+
punct: "!-.:-@\\[-`{-~",
|
|
772
|
+
space: " \\t\\n\\r",
|
|
773
|
+
upper: "A-Z",
|
|
774
|
+
xdigit: "0-9A-Fa-f"
|
|
775
|
+
};
|
|
776
|
+
const m = "\\]^-[";
|
|
777
|
+
const escapeMember = (t)=>m.indexOf(t) < 0 ? t : s + t;
|
|
778
|
+
const R = "(?!\\/)";
|
|
779
|
+
const classSource = (t, e)=>{
|
|
780
|
+
if (t) return `[^\\/${e}]`;
|
|
781
|
+
const n = `[${e}]`;
|
|
782
|
+
return new RegExp(n).test("/") ? R + n : n;
|
|
783
|
+
};
|
|
784
|
+
const scanBracket = (t, r)=>{
|
|
785
|
+
const { length: o } = t;
|
|
786
|
+
let i = r + 1;
|
|
787
|
+
let a = n;
|
|
788
|
+
const u = t[i];
|
|
789
|
+
if ("!" === u || "^" === u) {
|
|
790
|
+
a = "^";
|
|
791
|
+
i++;
|
|
792
|
+
}
|
|
793
|
+
let c = n;
|
|
794
|
+
let l = n;
|
|
795
|
+
for(;;){
|
|
796
|
+
const r = t[i];
|
|
797
|
+
if (r === e) return null;
|
|
798
|
+
if (r === s) {
|
|
799
|
+
const n = t[i + 1];
|
|
800
|
+
if (n === e) return null;
|
|
801
|
+
c += escapeMember(n);
|
|
802
|
+
l = n;
|
|
803
|
+
i++;
|
|
804
|
+
} else if ("-" === r && l && i + 1 < o && "]" !== t[i + 1]) {
|
|
805
|
+
i++;
|
|
806
|
+
let e = t[i];
|
|
807
|
+
if (e === s) e = t[i += 1];
|
|
808
|
+
if (l <= e) c += `-${escapeMember(e)}`;
|
|
809
|
+
l = n;
|
|
810
|
+
} else if ("[" === r && ":" === t[i + 1]) {
|
|
811
|
+
const r = i + 2;
|
|
812
|
+
let s = r;
|
|
813
|
+
while(s < o && "]" !== t[s])s++;
|
|
814
|
+
if (s === o) return null;
|
|
815
|
+
if (s > r && ":" === t[s - 1]) {
|
|
816
|
+
const o = A[t.slice(r, s - 1)];
|
|
817
|
+
if (o === e) return null;
|
|
818
|
+
c += o;
|
|
819
|
+
l = n;
|
|
820
|
+
i = s;
|
|
821
|
+
} else {
|
|
822
|
+
c += escapeMember("[");
|
|
823
|
+
l = "[";
|
|
824
|
+
i = r - 2;
|
|
825
|
+
}
|
|
826
|
+
} else {
|
|
827
|
+
c += escapeMember(r);
|
|
828
|
+
l = r;
|
|
776
829
|
}
|
|
830
|
+
i++;
|
|
831
|
+
if ("]" === t[i]) return {
|
|
832
|
+
end: i,
|
|
833
|
+
source: classSource(a, c)
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
const E = "[]";
|
|
838
|
+
const b = "\0";
|
|
839
|
+
const w = new RegExp(`${b}(\\d+)${b}`, "g");
|
|
840
|
+
const C = "";
|
|
841
|
+
const v = "";
|
|
842
|
+
const extractBrackets = (t)=>{
|
|
843
|
+
const i = [];
|
|
844
|
+
const hold = (t)=>`${b}${i.push(t) - 1}${b}`;
|
|
845
|
+
const { length: a } = t;
|
|
846
|
+
let u = n;
|
|
847
|
+
let c = 0;
|
|
848
|
+
while(c < a){
|
|
849
|
+
const n = t[c];
|
|
850
|
+
if (n === s) {
|
|
851
|
+
const n = t[c + 1];
|
|
852
|
+
if (n === e || n === h && c + 2 === a) u += hold(E);
|
|
853
|
+
else if ("*" === n || "[" === n || n === r || n === s) u += t.slice(c, c + 2);
|
|
854
|
+
else u += hold(o.test(n) ? s + n : n);
|
|
855
|
+
c += 2;
|
|
856
|
+
} else if (n === b) {
|
|
857
|
+
u += hold(`[${b}]`);
|
|
858
|
+
c++;
|
|
859
|
+
} else if ("[" === n) {
|
|
860
|
+
const e = scanBracket(t, c);
|
|
861
|
+
if (null === e) {
|
|
862
|
+
u += hold(E);
|
|
863
|
+
c = a;
|
|
864
|
+
} else {
|
|
865
|
+
u += hold(e.source);
|
|
866
|
+
c = e.end + 1;
|
|
867
|
+
}
|
|
868
|
+
} else {
|
|
869
|
+
u += n;
|
|
870
|
+
c++;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
return {
|
|
874
|
+
source: u,
|
|
875
|
+
sources: i
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
const S = null;
|
|
879
|
+
const $ = /\/(?!$)/;
|
|
880
|
+
const H = [
|
|
881
|
+
[
|
|
882
|
+
/(\\+)( ?)/g,
|
|
883
|
+
(t, e, n)=>n ? e.slice(0, e.length - e.length % 2) + r : e,
|
|
884
|
+
s + r
|
|
777
885
|
],
|
|
778
886
|
[
|
|
779
887
|
/[\\$.|*+(){^]/g,
|
|
@@ -781,72 +889,204 @@ var e = {
|
|
|
781
889
|
],
|
|
782
890
|
[
|
|
783
891
|
/(?!\\)\?/g,
|
|
784
|
-
()=>"[^/]"
|
|
892
|
+
()=>"[^/]",
|
|
893
|
+
"?"
|
|
785
894
|
],
|
|
786
895
|
[
|
|
787
896
|
/^\//,
|
|
788
|
-
()=>"^"
|
|
897
|
+
()=>"^",
|
|
898
|
+
h
|
|
789
899
|
],
|
|
790
900
|
[
|
|
791
901
|
/\//g,
|
|
792
|
-
()=>"\\/"
|
|
902
|
+
()=>"\\/",
|
|
903
|
+
h
|
|
793
904
|
],
|
|
794
905
|
[
|
|
795
|
-
|
|
796
|
-
()=>"^(?:.*\\/)?"
|
|
906
|
+
/^\^*(?:\\\*\\\*\\\/)+/,
|
|
907
|
+
()=>"^(?:.*\\/)?",
|
|
908
|
+
"*"
|
|
797
909
|
],
|
|
798
910
|
[
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
911
|
+
S,
|
|
912
|
+
(t, e)=>{
|
|
913
|
+
if (!t || "^" === t[0]) return t;
|
|
914
|
+
const n = $.test(e) ? "^" : "(?:^|\\/)";
|
|
915
|
+
return n + t;
|
|
802
916
|
}
|
|
803
917
|
],
|
|
804
918
|
[
|
|
805
919
|
/\\\/\\\*\\\*(?=\\\/|$)/g,
|
|
806
|
-
(t, e, n)=>e + 6 < n.length ? "(?:\\/[^\\/]+)
|
|
920
|
+
(t, e, n)=>e + 6 < n.length ? "\\/" === n.slice(e + 6) ? "(?:\\/[^\\/]+)+" : "(?:\\/[^\\/]+)*" : `\\/${v}`,
|
|
921
|
+
"*"
|
|
807
922
|
],
|
|
808
923
|
[
|
|
809
924
|
/(^|[^\\]+)(\\\*)+(?=.+)/g,
|
|
810
925
|
(t, e, n)=>{
|
|
811
926
|
const r = n.replace(/\\\*/g, "[^\\/]*");
|
|
812
927
|
return e + r;
|
|
813
|
-
}
|
|
928
|
+
},
|
|
929
|
+
"*"
|
|
930
|
+
],
|
|
931
|
+
[
|
|
932
|
+
/(^|[^\\])((?:\\\\)*)\\\*$/,
|
|
933
|
+
(t, e, n)=>n.length / 2 % 2 === 0 ? e + n + C : t,
|
|
934
|
+
"*"
|
|
814
935
|
],
|
|
815
936
|
[
|
|
816
937
|
/\\\\\\(?=[$.|*+(){^])/g,
|
|
817
|
-
()=>s
|
|
938
|
+
()=>s,
|
|
939
|
+
s + s
|
|
818
940
|
],
|
|
819
941
|
[
|
|
820
942
|
/\\\\/g,
|
|
821
|
-
()=>s
|
|
943
|
+
()=>s,
|
|
944
|
+
s + s
|
|
822
945
|
],
|
|
823
946
|
[
|
|
824
|
-
|
|
825
|
-
(t, e, n, r
|
|
947
|
+
/\\\[([^\]/]*?)(\\*)($|\])/g,
|
|
948
|
+
(t, e, n, r)=>`\\[${e}${cleanRangeBackSlash(n)}${r}`,
|
|
949
|
+
"["
|
|
826
950
|
],
|
|
827
951
|
[
|
|
828
|
-
|
|
829
|
-
(t)
|
|
952
|
+
S,
|
|
953
|
+
(t)=>{
|
|
954
|
+
const e = t[t.length - 1];
|
|
955
|
+
if (!e || e === C || e === v) return t;
|
|
956
|
+
return e === h ? `${t}$` : `${t}(?=$|\\/$)`;
|
|
957
|
+
}
|
|
830
958
|
]
|
|
831
959
|
];
|
|
832
|
-
const
|
|
833
|
-
const
|
|
834
|
-
const
|
|
835
|
-
const
|
|
836
|
-
const
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
960
|
+
const T = /(^|\\\/)?\uE000$/;
|
|
961
|
+
const O = "regex";
|
|
962
|
+
const L = "checkRegex";
|
|
963
|
+
const k = "_";
|
|
964
|
+
const replaceTrailingWildcard = (t, e)=>{
|
|
965
|
+
const n = e ? `${e}[^/]+` : "[^/]*";
|
|
966
|
+
return `${n}(?=$|\\/$)`;
|
|
967
|
+
};
|
|
968
|
+
const P = /\uE001$/;
|
|
969
|
+
const replaceTrailingDoublestar = ()=>".+(?=$|\\/$)";
|
|
970
|
+
const I = "[^\\/]*";
|
|
971
|
+
const separatorAfter = (t, e)=>{
|
|
972
|
+
let r = n;
|
|
973
|
+
for(let n = e + 1; n < t.length && !t[n].wildcard; n++)r += t[n].single;
|
|
974
|
+
return r;
|
|
975
|
+
};
|
|
976
|
+
const pinWildcards = (t)=>{
|
|
977
|
+
if (t.indexOf(I) < 0) return t;
|
|
978
|
+
const e = [];
|
|
979
|
+
const { length: r } = t;
|
|
980
|
+
let o = 0;
|
|
981
|
+
while(o < r){
|
|
982
|
+
const n = t[o];
|
|
983
|
+
if (t.startsWith(I, o)) {
|
|
984
|
+
e.push({
|
|
985
|
+
wildcard: true
|
|
986
|
+
});
|
|
987
|
+
o += I.length;
|
|
988
|
+
} else if ("[" === n) {
|
|
989
|
+
let n = o + 1;
|
|
990
|
+
if ("^" === t[n]) n++;
|
|
991
|
+
if ("]" === t[n]) n++;
|
|
992
|
+
while(n < r && "]" !== t[n])n += t[n] === s ? 2 : 1;
|
|
993
|
+
n++;
|
|
994
|
+
e.push({
|
|
995
|
+
single: t.slice(o, n)
|
|
996
|
+
});
|
|
997
|
+
o = n;
|
|
998
|
+
} else if (n === s) {
|
|
999
|
+
e.push({
|
|
1000
|
+
single: t.slice(o, o + 2)
|
|
1001
|
+
});
|
|
1002
|
+
o += 2;
|
|
1003
|
+
} else if ("(" === n) {
|
|
1004
|
+
let n = 0;
|
|
1005
|
+
let i = o;
|
|
1006
|
+
do {
|
|
1007
|
+
if (t[i] === s) i++;
|
|
1008
|
+
else if ("(" === t[i]) n++;
|
|
1009
|
+
else if (")" === t[i]) n--;
|
|
1010
|
+
i++;
|
|
1011
|
+
}while (i < r && n > 0);
|
|
1012
|
+
if ("*+?".indexOf(t[i]) >= 0) i++;
|
|
1013
|
+
e.push({
|
|
1014
|
+
boundary: t.slice(o, i)
|
|
1015
|
+
});
|
|
1016
|
+
o = i;
|
|
1017
|
+
} else if ("^" === n || "$" === n) {
|
|
1018
|
+
e.push({
|
|
1019
|
+
boundary: n
|
|
1020
|
+
});
|
|
1021
|
+
o++;
|
|
1022
|
+
} else {
|
|
1023
|
+
e.push({
|
|
1024
|
+
single: n
|
|
1025
|
+
});
|
|
1026
|
+
o++;
|
|
1027
|
+
}
|
|
844
1028
|
}
|
|
1029
|
+
let i = n;
|
|
1030
|
+
let a = [];
|
|
1031
|
+
const flush = ()=>{
|
|
1032
|
+
let t;
|
|
1033
|
+
a.forEach((e, n)=>{
|
|
1034
|
+
if (e.wildcard) t = n;
|
|
1035
|
+
});
|
|
1036
|
+
a.forEach((e, n)=>{
|
|
1037
|
+
if (!e.wildcard) {
|
|
1038
|
+
i += e.single;
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
i += n === t ? I : `(?:(?!${separatorAfter(a, n)})[^\\/])*`;
|
|
1042
|
+
});
|
|
1043
|
+
a = [];
|
|
1044
|
+
};
|
|
1045
|
+
e.forEach((t)=>{
|
|
1046
|
+
if (void 0 === t.boundary) return void a.push(t);
|
|
1047
|
+
flush();
|
|
1048
|
+
i += t.boundary;
|
|
1049
|
+
});
|
|
1050
|
+
flush();
|
|
1051
|
+
return i;
|
|
1052
|
+
};
|
|
1053
|
+
const makeRegexPrefix = (t)=>{
|
|
1054
|
+
const { source: n, sources: r } = extractBrackets(t);
|
|
1055
|
+
const s = H.reduce((n, [r, s, o])=>{
|
|
1056
|
+
if (r === S) return s(n, t);
|
|
1057
|
+
if (o !== e && n.indexOf(o) < 0) return n;
|
|
1058
|
+
return r.test(n) ? n.replace(r, s.bind(t)) : n;
|
|
1059
|
+
}, n);
|
|
1060
|
+
return r.length ? s.replace(w, (t, e)=>r[e]) : s;
|
|
1061
|
+
};
|
|
1062
|
+
const checkSourceOf = (t, e)=>{
|
|
1063
|
+
if (t[t.length - 1] === h) e = makeRegexPrefix(t.slice(0, -1));
|
|
1064
|
+
const n = e.slice(0, -1);
|
|
1065
|
+
const r = e[e.length - 1];
|
|
1066
|
+
return r === C ? `${n}$` : r === v ? `${n}.*$` : E;
|
|
1067
|
+
};
|
|
1068
|
+
const matchesBasename = (t)=>{
|
|
1069
|
+
const e = t.indexOf(h);
|
|
1070
|
+
return e < 0 || e === t.length - 1;
|
|
1071
|
+
};
|
|
1072
|
+
const basenameOf = (t)=>{
|
|
1073
|
+
const e = t.length - 1;
|
|
1074
|
+
const n = t.lastIndexOf(h, t[e] === h ? e - 1 : e);
|
|
1075
|
+
return n < 0 ? t : t.slice(n + 1);
|
|
1076
|
+
};
|
|
1077
|
+
const parentOf = (t)=>{
|
|
1078
|
+
if (t.charCodeAt(0) === p || t.indexOf(f) >= 0) {
|
|
1079
|
+
const e = t.split(h).filter(Boolean);
|
|
1080
|
+
e.pop();
|
|
1081
|
+
return e.length ? e.join(h) + h : n;
|
|
1082
|
+
}
|
|
1083
|
+
const e = t.length - 1;
|
|
1084
|
+
const r = t.lastIndexOf(h, t.charCodeAt(e) === p ? e - 1 : e);
|
|
1085
|
+
return r < 0 ? n : t.slice(0, r + 1);
|
|
845
1086
|
};
|
|
846
|
-
const makeRegexPrefix = (t)=>_.reduce((e, [n, r])=>e.replace(n, r.bind(t)), t);
|
|
847
1087
|
const isString = (t)=>"string" == typeof t;
|
|
848
|
-
const checkPattern = (t)=>t && isString(t) && !
|
|
849
|
-
const splitPattern = (t)=>t.split(
|
|
1088
|
+
const checkPattern = (t)=>t && isString(t) && !a.test(t);
|
|
1089
|
+
const splitPattern = (t)=>t.split(l).filter(Boolean);
|
|
850
1090
|
class IgnoreRule {
|
|
851
1091
|
constructor(t, e, n, r, s, o){
|
|
852
1092
|
this.pattern = t;
|
|
@@ -856,77 +1096,125 @@ var e = {
|
|
|
856
1096
|
define(this, "ignoreCase", r);
|
|
857
1097
|
define(this, "regexPrefix", o);
|
|
858
1098
|
}
|
|
1099
|
+
get _basenameOnly() {
|
|
1100
|
+
return define(this, "_basenameOnly", matchesBasename(this.body));
|
|
1101
|
+
}
|
|
859
1102
|
get regex() {
|
|
860
|
-
const t =
|
|
1103
|
+
const t = k + O;
|
|
861
1104
|
if (this[t]) return this[t];
|
|
862
|
-
return this._make(
|
|
1105
|
+
return this._make(O, t);
|
|
863
1106
|
}
|
|
864
1107
|
get checkRegex() {
|
|
865
|
-
const t =
|
|
1108
|
+
const t = k + L;
|
|
866
1109
|
if (this[t]) return this[t];
|
|
867
|
-
return this._make(
|
|
1110
|
+
return this._make(L, t);
|
|
868
1111
|
}
|
|
869
1112
|
_make(t, e) {
|
|
870
|
-
const n = this.regexPrefix.replace(
|
|
1113
|
+
const n = pinWildcards(t === O ? this.regexPrefix.replace(T, replaceTrailingWildcard).replace(P, replaceTrailingDoublestar) : checkSourceOf(this.body, this.regexPrefix));
|
|
871
1114
|
const r = this.ignoreCase ? new RegExp(n, "i") : new RegExp(n);
|
|
872
1115
|
return define(this, e, r);
|
|
873
1116
|
}
|
|
874
1117
|
}
|
|
1118
|
+
const isLineEnd = (t)=>"\r" === t || "\n" === t;
|
|
1119
|
+
const trimEnd = (t)=>{
|
|
1120
|
+
let e = t.length;
|
|
1121
|
+
while(e && isLineEnd(t[e - 1]))e--;
|
|
1122
|
+
const n = e;
|
|
1123
|
+
while(e && t[e - 1] === r)e--;
|
|
1124
|
+
if (e === n) return t.slice(0, e);
|
|
1125
|
+
let o = 0;
|
|
1126
|
+
while(o < e && t[e - o - 1] === s)o++;
|
|
1127
|
+
return o % 2 ? t.slice(0, e - 1) + r : t.slice(0, e);
|
|
1128
|
+
};
|
|
875
1129
|
const createRule = ({ pattern: t, mark: e }, n)=>{
|
|
876
|
-
let
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1130
|
+
let s = t[0] === i ? t.slice(1) : t;
|
|
1131
|
+
if ("#" === s[0]) return;
|
|
1132
|
+
let o = false;
|
|
1133
|
+
if ("!" === s[0]) {
|
|
1134
|
+
o = true;
|
|
1135
|
+
s = s.slice(1);
|
|
881
1136
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1137
|
+
const a = s[s.length - 1];
|
|
1138
|
+
if (a === r || "\r" === a || "\n" === a) s = trimEnd(s);
|
|
1139
|
+
if (!s) return;
|
|
1140
|
+
s = s.replace(u, "!").replace(c, "#");
|
|
1141
|
+
const l = makeRegexPrefix(s);
|
|
1142
|
+
return new IgnoreRule(t, e, s, n, o, l);
|
|
885
1143
|
};
|
|
886
1144
|
class RuleManager {
|
|
887
1145
|
constructor(t){
|
|
888
1146
|
this._ignoreCase = t;
|
|
889
1147
|
this._rules = [];
|
|
1148
|
+
this._basenameCount = 0;
|
|
890
1149
|
}
|
|
891
1150
|
_add(t) {
|
|
892
|
-
if (t && t[
|
|
1151
|
+
if (t && t[_]) {
|
|
893
1152
|
this._rules = this._rules.concat(t._rules._rules);
|
|
1153
|
+
this._basenameCount += t._rules._basenameCount;
|
|
894
1154
|
this._added = true;
|
|
895
1155
|
return;
|
|
896
1156
|
}
|
|
897
1157
|
if (isString(t)) t = {
|
|
898
1158
|
pattern: t
|
|
899
1159
|
};
|
|
900
|
-
|
|
901
|
-
|
|
1160
|
+
const e = checkPattern(t.pattern) && createRule(t, this._ignoreCase);
|
|
1161
|
+
if (e) {
|
|
902
1162
|
this._added = true;
|
|
903
1163
|
this._rules.push(e);
|
|
1164
|
+
if (matchesBasename(e.body)) this._basenameCount++;
|
|
904
1165
|
}
|
|
905
1166
|
}
|
|
906
1167
|
add(t) {
|
|
907
1168
|
this._added = false;
|
|
908
1169
|
makeArray(isString(t) ? splitPattern(t) : t).forEach(this._add, this);
|
|
1170
|
+
if (this._added) this._literalRules = e;
|
|
909
1171
|
return this._added;
|
|
910
1172
|
}
|
|
1173
|
+
testLiteral(t) {
|
|
1174
|
+
const n = this._literalRules || (this._literalRules = this._rules.filter(({ body: t })=>"*" === t[t.length - (t[t.length - 1] === h ? 2 : 1)]));
|
|
1175
|
+
let r = false;
|
|
1176
|
+
let s = false;
|
|
1177
|
+
let o;
|
|
1178
|
+
for(let i = n.length - 1; i >= 0; i--){
|
|
1179
|
+
const a = n[i];
|
|
1180
|
+
if (a.checkRegex.test(t)) {
|
|
1181
|
+
r = !a.negative;
|
|
1182
|
+
s = a.negative;
|
|
1183
|
+
o = a.negative ? e : a;
|
|
1184
|
+
break;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
const i = {
|
|
1188
|
+
ignored: r,
|
|
1189
|
+
unignored: s
|
|
1190
|
+
};
|
|
1191
|
+
if (o) i.rule = o;
|
|
1192
|
+
return i;
|
|
1193
|
+
}
|
|
911
1194
|
test(t, n, r) {
|
|
912
1195
|
let s = false;
|
|
913
1196
|
let o = false;
|
|
914
1197
|
let i;
|
|
915
|
-
this._rules
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1198
|
+
const a = this._rules;
|
|
1199
|
+
const { length: u } = a;
|
|
1200
|
+
const c = 2 * this._basenameCount >= u;
|
|
1201
|
+
const l = c ? basenameOf(t) : t;
|
|
1202
|
+
for(let f = 0; f < u; f++){
|
|
1203
|
+
const u = a[f];
|
|
1204
|
+
const { negative: p } = u;
|
|
1205
|
+
const d = o === p && s !== o || p && !s && !o && !n;
|
|
1206
|
+
if (!d && u[r].test(c && u._basenameOnly ? l : t)) {
|
|
1207
|
+
s = !p;
|
|
1208
|
+
o = p;
|
|
1209
|
+
i = p ? e : u;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
const f = {
|
|
925
1213
|
ignored: s,
|
|
926
1214
|
unignored: o
|
|
927
1215
|
};
|
|
928
|
-
if (i)
|
|
929
|
-
return
|
|
1216
|
+
if (i) f.rule = i;
|
|
1217
|
+
return f;
|
|
930
1218
|
}
|
|
931
1219
|
}
|
|
932
1220
|
const throwError = (t, e)=>{
|
|
@@ -941,12 +1229,21 @@ var e = {
|
|
|
941
1229
|
}
|
|
942
1230
|
return true;
|
|
943
1231
|
};
|
|
944
|
-
const isNotRelative = (t)=>
|
|
1232
|
+
const isNotRelative = (t)=>{
|
|
1233
|
+
const e = t.charCodeAt(0);
|
|
1234
|
+
if (e === p) return true;
|
|
1235
|
+
if (e !== d) return false;
|
|
1236
|
+
if (1 === t.length) return true;
|
|
1237
|
+
const n = t.charCodeAt(1);
|
|
1238
|
+
if (n === p) return true;
|
|
1239
|
+
if (n !== d) return false;
|
|
1240
|
+
return 2 === t.length || t.charCodeAt(2) === p;
|
|
1241
|
+
};
|
|
945
1242
|
checkPath.isNotRelative = isNotRelative;
|
|
946
1243
|
checkPath.convert = (t)=>t;
|
|
947
1244
|
class Ignore {
|
|
948
1245
|
constructor({ ignorecase: t = true, ignoreCase: e = t, allowRelativePaths: n = false } = {}){
|
|
949
|
-
define(this,
|
|
1246
|
+
define(this, _, true);
|
|
950
1247
|
this._rules = new RuleManager(e);
|
|
951
1248
|
this._strictPathCheck = !n;
|
|
952
1249
|
this._initCache();
|
|
@@ -962,28 +1259,23 @@ var e = {
|
|
|
962
1259
|
addPattern(t) {
|
|
963
1260
|
return this.add(t);
|
|
964
1261
|
}
|
|
965
|
-
_test(t, e, n
|
|
966
|
-
const
|
|
967
|
-
checkPath(
|
|
968
|
-
return this._t(
|
|
1262
|
+
_test(t, e, n) {
|
|
1263
|
+
const r = t && checkPath.convert(t);
|
|
1264
|
+
checkPath(r, t, this._strictPathCheck ? throwError : RETURN_FALSE);
|
|
1265
|
+
return this._t(r, e, n);
|
|
969
1266
|
}
|
|
970
1267
|
checkIgnore(t) {
|
|
971
|
-
if (
|
|
972
|
-
const e =
|
|
973
|
-
e.
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
if (t.ignored) return t;
|
|
977
|
-
}
|
|
978
|
-
return this._rules.test(t, false, m);
|
|
1268
|
+
if (t.charCodeAt(t.length - 1) !== p) return this.test(t);
|
|
1269
|
+
const e = this._t(t, this._testCache, true);
|
|
1270
|
+
if (e.ignored) return e;
|
|
1271
|
+
const n = this._rules.testLiteral(t);
|
|
1272
|
+
return n.ignored || n.unignored ? n : e;
|
|
979
1273
|
}
|
|
980
|
-
_t(t,
|
|
981
|
-
if (t in
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
const s = this._t(r.join(p) + p, e, n, r);
|
|
986
|
-
return e[t] = s.ignored ? s : this._rules.test(t, n, R);
|
|
1274
|
+
_t(t, n, r) {
|
|
1275
|
+
if (t in n) return n[t];
|
|
1276
|
+
const s = parentOf(t);
|
|
1277
|
+
const o = s ? this._t(s, n, r) : e;
|
|
1278
|
+
return n[t] = o && o.ignored ? o : this._rules.test(t, r, O);
|
|
987
1279
|
}
|
|
988
1280
|
ignores(t) {
|
|
989
1281
|
return this._test(t, this._ignoreCache, false).ignored;
|
|
@@ -1186,8 +1478,8 @@ var e = {
|
|
|
1186
1478
|
const g = `${a}{1,2}${d}`;
|
|
1187
1479
|
const _ = `(?!${a})`;
|
|
1188
1480
|
const A = `(?!${h}${g})`;
|
|
1189
|
-
const
|
|
1190
|
-
const
|
|
1481
|
+
const m = `(?!${a}{0,1}${d})`;
|
|
1482
|
+
const R = `(?!${g})`;
|
|
1191
1483
|
const E = `[^.${l}]`;
|
|
1192
1484
|
const b = `${p}*?`;
|
|
1193
1485
|
const w = {
|
|
@@ -1201,8 +1493,8 @@ var e = {
|
|
|
1201
1493
|
DOTS_SLASH: g,
|
|
1202
1494
|
NO_DOT: _,
|
|
1203
1495
|
NO_DOTS: A,
|
|
1204
|
-
NO_DOT_SLASH:
|
|
1205
|
-
NO_DOTS_SLASH:
|
|
1496
|
+
NO_DOT_SLASH: m,
|
|
1497
|
+
NO_DOTS_SLASH: R,
|
|
1206
1498
|
QMARK_NO_DOT: E,
|
|
1207
1499
|
STAR: b,
|
|
1208
1500
|
START_ANCHOR: h
|
|
@@ -1552,12 +1844,12 @@ var e = {
|
|
|
1552
1844
|
const g = s.isWindows(e);
|
|
1553
1845
|
const _ = r.globChars(g);
|
|
1554
1846
|
const A = r.extglobChars(_);
|
|
1555
|
-
const { DOT_LITERAL:
|
|
1556
|
-
const globstar = (t)=>`(${h}(?:(?!${O}${t.dot ? w :
|
|
1847
|
+
const { DOT_LITERAL: m, PLUS_LITERAL: R, SLASH_LITERAL: E, ONE_CHAR: b, DOTS_SLASH: w, NO_DOT: C, NO_DOT_SLASH: v, NO_DOTS_SLASH: S, QMARK: $, QMARK_NO_DOT: H, STAR: T, START_ANCHOR: O } = _;
|
|
1848
|
+
const globstar = (t)=>`(${h}(?:(?!${O}${t.dot ? w : m}).)*?)`;
|
|
1557
1849
|
const L = n.dot ? "" : C;
|
|
1558
|
-
const
|
|
1559
|
-
let
|
|
1560
|
-
if (n.capture)
|
|
1850
|
+
const k = n.dot ? $ : H;
|
|
1851
|
+
let P = true === n.bash ? globstar(n) : T;
|
|
1852
|
+
if (n.capture) P = `(${P})`;
|
|
1561
1853
|
if ("boolean" == typeof n.noext) n.noextglob = n.noext;
|
|
1562
1854
|
const I = {
|
|
1563
1855
|
input: t,
|
|
@@ -1582,9 +1874,9 @@ var e = {
|
|
|
1582
1874
|
const M = [];
|
|
1583
1875
|
const B = [];
|
|
1584
1876
|
let D = p;
|
|
1585
|
-
let
|
|
1877
|
+
let G;
|
|
1586
1878
|
const eos = ()=>I.index === f - 1;
|
|
1587
|
-
const
|
|
1879
|
+
const F = I.peek = (e = 1)=>t[I.index + e];
|
|
1588
1880
|
const U = I.advance = ()=>t[++I.index] || "";
|
|
1589
1881
|
const remaining = ()=>t.slice(I.index + 1);
|
|
1590
1882
|
const consume = (t = "", e = 0)=>{
|
|
@@ -1597,7 +1889,7 @@ var e = {
|
|
|
1597
1889
|
};
|
|
1598
1890
|
const negate = ()=>{
|
|
1599
1891
|
let t = 1;
|
|
1600
|
-
while("!" ===
|
|
1892
|
+
while("!" === F() && ("(" !== F(2) || "?" === F(3))){
|
|
1601
1893
|
U();
|
|
1602
1894
|
I.start++;
|
|
1603
1895
|
t++;
|
|
@@ -1623,7 +1915,7 @@ var e = {
|
|
|
1623
1915
|
I.output = I.output.slice(0, -D.output.length);
|
|
1624
1916
|
D.type = "star";
|
|
1625
1917
|
D.value = "*";
|
|
1626
|
-
D.output =
|
|
1918
|
+
D.output = P;
|
|
1627
1919
|
I.output += D.output;
|
|
1628
1920
|
}
|
|
1629
1921
|
}
|
|
@@ -1684,7 +1976,7 @@ var e = {
|
|
|
1684
1976
|
push({
|
|
1685
1977
|
type: "paren",
|
|
1686
1978
|
extglob: true,
|
|
1687
|
-
value:
|
|
1979
|
+
value: G,
|
|
1688
1980
|
output: ""
|
|
1689
1981
|
});
|
|
1690
1982
|
decrement("parens");
|
|
@@ -1693,9 +1985,9 @@ var e = {
|
|
|
1693
1985
|
let u = r.close + (n.capture ? ")" : "");
|
|
1694
1986
|
let c;
|
|
1695
1987
|
if ("negate" === r.type) {
|
|
1696
|
-
let t =
|
|
1988
|
+
let t = P;
|
|
1697
1989
|
if (r.inner && r.inner.length > 1 && r.inner.includes("/")) t = globstar(n);
|
|
1698
|
-
if (t !==
|
|
1990
|
+
if (t !== P || eos() || /^\)+$/.test(remaining())) u = r.close = `)$))${t}`;
|
|
1699
1991
|
if (r.inner.includes("*") && (c = remaining()) && /^\.[^\\/.]+$/.test(c)) {
|
|
1700
1992
|
const n = parse(c, {
|
|
1701
1993
|
...e,
|
|
@@ -1708,7 +2000,7 @@ var e = {
|
|
|
1708
2000
|
push({
|
|
1709
2001
|
type: "paren",
|
|
1710
2002
|
extglob: true,
|
|
1711
|
-
value:
|
|
2003
|
+
value: G,
|
|
1712
2004
|
output: u
|
|
1713
2005
|
});
|
|
1714
2006
|
decrement("parens");
|
|
@@ -1722,13 +2014,13 @@ var e = {
|
|
|
1722
2014
|
}
|
|
1723
2015
|
if ("?" === s) {
|
|
1724
2016
|
if (e) return e + s + (o ? $.repeat(o.length) : "");
|
|
1725
|
-
if (0 === i) return
|
|
2017
|
+
if (0 === i) return k + (o ? $.repeat(o.length) : "");
|
|
1726
2018
|
return $.repeat(n.length);
|
|
1727
2019
|
}
|
|
1728
|
-
if ("." === s) return
|
|
2020
|
+
if ("." === s) return m.repeat(n.length);
|
|
1729
2021
|
if ("*" === s) {
|
|
1730
|
-
if (e) return e + s + (o ?
|
|
1731
|
-
return
|
|
2022
|
+
if (e) return e + s + (o ? P : "");
|
|
2023
|
+
return P;
|
|
1732
2024
|
}
|
|
1733
2025
|
return e ? t : `\\${t}`;
|
|
1734
2026
|
});
|
|
@@ -1741,17 +2033,17 @@ var e = {
|
|
|
1741
2033
|
return I;
|
|
1742
2034
|
}
|
|
1743
2035
|
while(!eos()){
|
|
1744
|
-
|
|
1745
|
-
if ("\0" ===
|
|
1746
|
-
if ("\\" ===
|
|
1747
|
-
const t =
|
|
2036
|
+
G = U();
|
|
2037
|
+
if ("\0" === G) continue;
|
|
2038
|
+
if ("\\" === G) {
|
|
2039
|
+
const t = F();
|
|
1748
2040
|
if ("/" === t && true !== n.bash) continue;
|
|
1749
2041
|
if ("." === t || ";" === t) continue;
|
|
1750
2042
|
if (!t) {
|
|
1751
|
-
|
|
2043
|
+
G += "\\";
|
|
1752
2044
|
push({
|
|
1753
2045
|
type: "text",
|
|
1754
|
-
value:
|
|
2046
|
+
value: G
|
|
1755
2047
|
});
|
|
1756
2048
|
continue;
|
|
1757
2049
|
}
|
|
@@ -1760,20 +2052,20 @@ var e = {
|
|
|
1760
2052
|
if (e && e[0].length > 2) {
|
|
1761
2053
|
r = e[0].length;
|
|
1762
2054
|
I.index += r;
|
|
1763
|
-
if (r % 2 !== 0)
|
|
2055
|
+
if (r % 2 !== 0) G += "\\";
|
|
1764
2056
|
}
|
|
1765
|
-
if (true === n.unescape)
|
|
1766
|
-
else
|
|
2057
|
+
if (true === n.unescape) G = U();
|
|
2058
|
+
else G += U();
|
|
1767
2059
|
if (0 === I.brackets) {
|
|
1768
2060
|
push({
|
|
1769
2061
|
type: "text",
|
|
1770
|
-
value:
|
|
2062
|
+
value: G
|
|
1771
2063
|
});
|
|
1772
2064
|
continue;
|
|
1773
2065
|
}
|
|
1774
2066
|
}
|
|
1775
|
-
if (I.brackets > 0 && ("]" !==
|
|
1776
|
-
if (false !== n.posix && ":" ===
|
|
2067
|
+
if (I.brackets > 0 && ("]" !== G || "[" === D.value || "[^" === D.value)) {
|
|
2068
|
+
if (false !== n.posix && ":" === G) {
|
|
1777
2069
|
const t = D.value.slice(1);
|
|
1778
2070
|
if (t.includes("[")) {
|
|
1779
2071
|
D.posix = true;
|
|
@@ -1792,40 +2084,40 @@ var e = {
|
|
|
1792
2084
|
}
|
|
1793
2085
|
}
|
|
1794
2086
|
}
|
|
1795
|
-
if ("[" ===
|
|
1796
|
-
if ("]" ===
|
|
1797
|
-
if (true === n.posix && "!" ===
|
|
1798
|
-
D.value +=
|
|
2087
|
+
if ("[" === G && ":" !== F() || "-" === G && "]" === F()) G = `\\${G}`;
|
|
2088
|
+
if ("]" === G && ("[" === D.value || "[^" === D.value)) G = `\\${G}`;
|
|
2089
|
+
if (true === n.posix && "!" === G && "[" === D.value) G = "^";
|
|
2090
|
+
D.value += G;
|
|
1799
2091
|
append({
|
|
1800
|
-
value:
|
|
2092
|
+
value: G
|
|
1801
2093
|
});
|
|
1802
2094
|
continue;
|
|
1803
2095
|
}
|
|
1804
|
-
if (1 === I.quotes && '"' !==
|
|
1805
|
-
|
|
1806
|
-
D.value +=
|
|
2096
|
+
if (1 === I.quotes && '"' !== G) {
|
|
2097
|
+
G = s.escapeRegex(G);
|
|
2098
|
+
D.value += G;
|
|
1807
2099
|
append({
|
|
1808
|
-
value:
|
|
2100
|
+
value: G
|
|
1809
2101
|
});
|
|
1810
2102
|
continue;
|
|
1811
2103
|
}
|
|
1812
|
-
if ('"' ===
|
|
2104
|
+
if ('"' === G) {
|
|
1813
2105
|
I.quotes = 1 === I.quotes ? 0 : 1;
|
|
1814
2106
|
if (true === n.keepQuotes) push({
|
|
1815
2107
|
type: "text",
|
|
1816
|
-
value:
|
|
2108
|
+
value: G
|
|
1817
2109
|
});
|
|
1818
2110
|
continue;
|
|
1819
2111
|
}
|
|
1820
|
-
if ("(" ===
|
|
2112
|
+
if ("(" === G) {
|
|
1821
2113
|
increment("parens");
|
|
1822
2114
|
push({
|
|
1823
2115
|
type: "paren",
|
|
1824
|
-
value:
|
|
2116
|
+
value: G
|
|
1825
2117
|
});
|
|
1826
2118
|
continue;
|
|
1827
2119
|
}
|
|
1828
|
-
if (")" ===
|
|
2120
|
+
if (")" === G) {
|
|
1829
2121
|
if (0 === I.parens && true === n.strictBrackets) throw new SyntaxError(syntaxError("opening", "("));
|
|
1830
2122
|
const t = N[N.length - 1];
|
|
1831
2123
|
if (t && I.parens === t.parens + 1) {
|
|
@@ -1834,30 +2126,30 @@ var e = {
|
|
|
1834
2126
|
}
|
|
1835
2127
|
push({
|
|
1836
2128
|
type: "paren",
|
|
1837
|
-
value:
|
|
2129
|
+
value: G,
|
|
1838
2130
|
output: I.parens ? ")" : "\\)"
|
|
1839
2131
|
});
|
|
1840
2132
|
decrement("parens");
|
|
1841
2133
|
continue;
|
|
1842
2134
|
}
|
|
1843
|
-
if ("[" ===
|
|
2135
|
+
if ("[" === G) {
|
|
1844
2136
|
if (true !== n.nobracket && remaining().includes("]")) increment("brackets");
|
|
1845
2137
|
else {
|
|
1846
2138
|
if (true !== n.nobracket && true === n.strictBrackets) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1847
|
-
|
|
2139
|
+
G = `\\${G}`;
|
|
1848
2140
|
}
|
|
1849
2141
|
push({
|
|
1850
2142
|
type: "bracket",
|
|
1851
|
-
value:
|
|
2143
|
+
value: G
|
|
1852
2144
|
});
|
|
1853
2145
|
continue;
|
|
1854
2146
|
}
|
|
1855
|
-
if ("]" ===
|
|
2147
|
+
if ("]" === G) {
|
|
1856
2148
|
if (true === n.nobracket || D && "bracket" === D.type && 1 === D.value.length) {
|
|
1857
2149
|
push({
|
|
1858
2150
|
type: "text",
|
|
1859
|
-
value:
|
|
1860
|
-
output: `\\${
|
|
2151
|
+
value: G,
|
|
2152
|
+
output: `\\${G}`
|
|
1861
2153
|
});
|
|
1862
2154
|
continue;
|
|
1863
2155
|
}
|
|
@@ -1865,17 +2157,17 @@ var e = {
|
|
|
1865
2157
|
if (true === n.strictBrackets) throw new SyntaxError(syntaxError("opening", "["));
|
|
1866
2158
|
push({
|
|
1867
2159
|
type: "text",
|
|
1868
|
-
value:
|
|
1869
|
-
output: `\\${
|
|
2160
|
+
value: G,
|
|
2161
|
+
output: `\\${G}`
|
|
1870
2162
|
});
|
|
1871
2163
|
continue;
|
|
1872
2164
|
}
|
|
1873
2165
|
decrement("brackets");
|
|
1874
2166
|
const t = D.value.slice(1);
|
|
1875
|
-
if (true !== D.posix && "^" === t[0] && !t.includes("/"))
|
|
1876
|
-
D.value +=
|
|
2167
|
+
if (true !== D.posix && "^" === t[0] && !t.includes("/")) G = `/${G}`;
|
|
2168
|
+
D.value += G;
|
|
1877
2169
|
append({
|
|
1878
|
-
value:
|
|
2170
|
+
value: G
|
|
1879
2171
|
});
|
|
1880
2172
|
if (false === n.literalBrackets || s.hasRegexChars(t)) continue;
|
|
1881
2173
|
const e = s.escapeRegex(D.value);
|
|
@@ -1889,11 +2181,11 @@ var e = {
|
|
|
1889
2181
|
I.output += D.value;
|
|
1890
2182
|
continue;
|
|
1891
2183
|
}
|
|
1892
|
-
if ("{" ===
|
|
2184
|
+
if ("{" === G && true !== n.nobrace) {
|
|
1893
2185
|
increment("braces");
|
|
1894
2186
|
const t = {
|
|
1895
2187
|
type: "brace",
|
|
1896
|
-
value:
|
|
2188
|
+
value: G,
|
|
1897
2189
|
output: "(",
|
|
1898
2190
|
outputIndex: I.output.length,
|
|
1899
2191
|
tokensIndex: I.tokens.length
|
|
@@ -1902,13 +2194,13 @@ var e = {
|
|
|
1902
2194
|
push(t);
|
|
1903
2195
|
continue;
|
|
1904
2196
|
}
|
|
1905
|
-
if ("}" ===
|
|
2197
|
+
if ("}" === G) {
|
|
1906
2198
|
const t = M[M.length - 1];
|
|
1907
2199
|
if (true === n.nobrace || !t) {
|
|
1908
2200
|
push({
|
|
1909
2201
|
type: "text",
|
|
1910
|
-
value:
|
|
1911
|
-
output:
|
|
2202
|
+
value: G,
|
|
2203
|
+
output: G
|
|
1912
2204
|
});
|
|
1913
2205
|
continue;
|
|
1914
2206
|
}
|
|
@@ -1928,29 +2220,29 @@ var e = {
|
|
|
1928
2220
|
const n = I.output.slice(0, t.outputIndex);
|
|
1929
2221
|
const r = I.tokens.slice(t.tokensIndex);
|
|
1930
2222
|
t.value = t.output = "\\{";
|
|
1931
|
-
|
|
2223
|
+
G = e = "\\}";
|
|
1932
2224
|
I.output = n;
|
|
1933
2225
|
for (const t of r)I.output += t.output || t.value;
|
|
1934
2226
|
}
|
|
1935
2227
|
push({
|
|
1936
2228
|
type: "brace",
|
|
1937
|
-
value:
|
|
2229
|
+
value: G,
|
|
1938
2230
|
output: e
|
|
1939
2231
|
});
|
|
1940
2232
|
decrement("braces");
|
|
1941
2233
|
M.pop();
|
|
1942
2234
|
continue;
|
|
1943
2235
|
}
|
|
1944
|
-
if ("|" ===
|
|
2236
|
+
if ("|" === G) {
|
|
1945
2237
|
if (N.length > 0) N[N.length - 1].conditions++;
|
|
1946
2238
|
push({
|
|
1947
2239
|
type: "text",
|
|
1948
|
-
value:
|
|
2240
|
+
value: G
|
|
1949
2241
|
});
|
|
1950
2242
|
continue;
|
|
1951
2243
|
}
|
|
1952
|
-
if ("," ===
|
|
1953
|
-
let t =
|
|
2244
|
+
if ("," === G) {
|
|
2245
|
+
let t = G;
|
|
1954
2246
|
const e = M[M.length - 1];
|
|
1955
2247
|
if (e && "braces" === B[B.length - 1]) {
|
|
1956
2248
|
e.comma = true;
|
|
@@ -1958,12 +2250,12 @@ var e = {
|
|
|
1958
2250
|
}
|
|
1959
2251
|
push({
|
|
1960
2252
|
type: "comma",
|
|
1961
|
-
value:
|
|
2253
|
+
value: G,
|
|
1962
2254
|
output: t
|
|
1963
2255
|
});
|
|
1964
2256
|
continue;
|
|
1965
2257
|
}
|
|
1966
|
-
if ("/" ===
|
|
2258
|
+
if ("/" === G) {
|
|
1967
2259
|
if ("dot" === D.type && I.index === I.start + 1) {
|
|
1968
2260
|
I.start = I.index + 1;
|
|
1969
2261
|
I.consumed = "";
|
|
@@ -1974,50 +2266,50 @@ var e = {
|
|
|
1974
2266
|
}
|
|
1975
2267
|
push({
|
|
1976
2268
|
type: "slash",
|
|
1977
|
-
value:
|
|
2269
|
+
value: G,
|
|
1978
2270
|
output: E
|
|
1979
2271
|
});
|
|
1980
2272
|
continue;
|
|
1981
2273
|
}
|
|
1982
|
-
if ("." ===
|
|
2274
|
+
if ("." === G) {
|
|
1983
2275
|
if (I.braces > 0 && "dot" === D.type) {
|
|
1984
|
-
if ("." === D.value) D.output =
|
|
2276
|
+
if ("." === D.value) D.output = m;
|
|
1985
2277
|
const t = M[M.length - 1];
|
|
1986
2278
|
D.type = "dots";
|
|
1987
|
-
D.output +=
|
|
1988
|
-
D.value +=
|
|
2279
|
+
D.output += G;
|
|
2280
|
+
D.value += G;
|
|
1989
2281
|
t.dots = true;
|
|
1990
2282
|
continue;
|
|
1991
2283
|
}
|
|
1992
2284
|
if (I.braces + I.parens === 0 && "bos" !== D.type && "slash" !== D.type) {
|
|
1993
2285
|
push({
|
|
1994
2286
|
type: "text",
|
|
1995
|
-
value:
|
|
1996
|
-
output:
|
|
2287
|
+
value: G,
|
|
2288
|
+
output: m
|
|
1997
2289
|
});
|
|
1998
2290
|
continue;
|
|
1999
2291
|
}
|
|
2000
2292
|
push({
|
|
2001
2293
|
type: "dot",
|
|
2002
|
-
value:
|
|
2003
|
-
output:
|
|
2294
|
+
value: G,
|
|
2295
|
+
output: m
|
|
2004
2296
|
});
|
|
2005
2297
|
continue;
|
|
2006
2298
|
}
|
|
2007
|
-
if ("?" ===
|
|
2299
|
+
if ("?" === G) {
|
|
2008
2300
|
const t = D && "(" === D.value;
|
|
2009
|
-
if (!t && true !== n.noextglob && "(" ===
|
|
2010
|
-
extglobOpen("qmark",
|
|
2301
|
+
if (!t && true !== n.noextglob && "(" === F() && "?" !== F(2)) {
|
|
2302
|
+
extglobOpen("qmark", G);
|
|
2011
2303
|
continue;
|
|
2012
2304
|
}
|
|
2013
2305
|
if (D && "paren" === D.type) {
|
|
2014
|
-
const t =
|
|
2015
|
-
let e =
|
|
2306
|
+
const t = F();
|
|
2307
|
+
let e = G;
|
|
2016
2308
|
if ("<" === t && !s.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
2017
|
-
if ("(" === D.value && !/[!=<:]/.test(t) || "<" === t && !/<([!=]|\w+>)/.test(remaining())) e = `\\${
|
|
2309
|
+
if ("(" === D.value && !/[!=<:]/.test(t) || "<" === t && !/<([!=]|\w+>)/.test(remaining())) e = `\\${G}`;
|
|
2018
2310
|
push({
|
|
2019
2311
|
type: "text",
|
|
2020
|
-
value:
|
|
2312
|
+
value: G,
|
|
2021
2313
|
output: e
|
|
2022
2314
|
});
|
|
2023
2315
|
continue;
|
|
@@ -2025,22 +2317,22 @@ var e = {
|
|
|
2025
2317
|
if (true !== n.dot && ("slash" === D.type || "bos" === D.type)) {
|
|
2026
2318
|
push({
|
|
2027
2319
|
type: "qmark",
|
|
2028
|
-
value:
|
|
2320
|
+
value: G,
|
|
2029
2321
|
output: H
|
|
2030
2322
|
});
|
|
2031
2323
|
continue;
|
|
2032
2324
|
}
|
|
2033
2325
|
push({
|
|
2034
2326
|
type: "qmark",
|
|
2035
|
-
value:
|
|
2327
|
+
value: G,
|
|
2036
2328
|
output: $
|
|
2037
2329
|
});
|
|
2038
2330
|
continue;
|
|
2039
2331
|
}
|
|
2040
|
-
if ("!" ===
|
|
2041
|
-
if (true !== n.noextglob && "(" ===
|
|
2042
|
-
if ("?" !==
|
|
2043
|
-
extglobOpen("negate",
|
|
2332
|
+
if ("!" === G) {
|
|
2333
|
+
if (true !== n.noextglob && "(" === F()) {
|
|
2334
|
+
if ("?" !== F(2) || !/[!=<:]/.test(F(3))) {
|
|
2335
|
+
extglobOpen("negate", G);
|
|
2044
2336
|
continue;
|
|
2045
2337
|
}
|
|
2046
2338
|
}
|
|
@@ -2049,79 +2341,79 @@ var e = {
|
|
|
2049
2341
|
continue;
|
|
2050
2342
|
}
|
|
2051
2343
|
}
|
|
2052
|
-
if ("+" ===
|
|
2053
|
-
if (true !== n.noextglob && "(" ===
|
|
2054
|
-
extglobOpen("plus",
|
|
2344
|
+
if ("+" === G) {
|
|
2345
|
+
if (true !== n.noextglob && "(" === F() && "?" !== F(2)) {
|
|
2346
|
+
extglobOpen("plus", G);
|
|
2055
2347
|
continue;
|
|
2056
2348
|
}
|
|
2057
2349
|
if (D && "(" === D.value || false === n.regex) {
|
|
2058
2350
|
push({
|
|
2059
2351
|
type: "plus",
|
|
2060
|
-
value:
|
|
2061
|
-
output:
|
|
2352
|
+
value: G,
|
|
2353
|
+
output: R
|
|
2062
2354
|
});
|
|
2063
2355
|
continue;
|
|
2064
2356
|
}
|
|
2065
2357
|
if (D && ("bracket" === D.type || "paren" === D.type || "brace" === D.type) || I.parens > 0) {
|
|
2066
2358
|
push({
|
|
2067
2359
|
type: "plus",
|
|
2068
|
-
value:
|
|
2360
|
+
value: G
|
|
2069
2361
|
});
|
|
2070
2362
|
continue;
|
|
2071
2363
|
}
|
|
2072
2364
|
push({
|
|
2073
2365
|
type: "plus",
|
|
2074
|
-
value:
|
|
2366
|
+
value: R
|
|
2075
2367
|
});
|
|
2076
2368
|
continue;
|
|
2077
2369
|
}
|
|
2078
|
-
if ("@" ===
|
|
2079
|
-
if (true !== n.noextglob && "(" ===
|
|
2370
|
+
if ("@" === G) {
|
|
2371
|
+
if (true !== n.noextglob && "(" === F() && "?" !== F(2)) {
|
|
2080
2372
|
push({
|
|
2081
2373
|
type: "at",
|
|
2082
2374
|
extglob: true,
|
|
2083
|
-
value:
|
|
2375
|
+
value: G,
|
|
2084
2376
|
output: ""
|
|
2085
2377
|
});
|
|
2086
2378
|
continue;
|
|
2087
2379
|
}
|
|
2088
2380
|
push({
|
|
2089
2381
|
type: "text",
|
|
2090
|
-
value:
|
|
2382
|
+
value: G
|
|
2091
2383
|
});
|
|
2092
2384
|
continue;
|
|
2093
2385
|
}
|
|
2094
|
-
if ("*" !==
|
|
2095
|
-
if ("$" ===
|
|
2386
|
+
if ("*" !== G) {
|
|
2387
|
+
if ("$" === G || "^" === G) G = `\\${G}`;
|
|
2096
2388
|
const t = a.exec(remaining());
|
|
2097
2389
|
if (t) {
|
|
2098
|
-
|
|
2390
|
+
G += t[0];
|
|
2099
2391
|
I.index += t[0].length;
|
|
2100
2392
|
}
|
|
2101
2393
|
push({
|
|
2102
2394
|
type: "text",
|
|
2103
|
-
value:
|
|
2395
|
+
value: G
|
|
2104
2396
|
});
|
|
2105
2397
|
continue;
|
|
2106
2398
|
}
|
|
2107
2399
|
if (D && ("globstar" === D.type || true === D.star)) {
|
|
2108
2400
|
D.type = "star";
|
|
2109
2401
|
D.star = true;
|
|
2110
|
-
D.value +=
|
|
2111
|
-
D.output =
|
|
2402
|
+
D.value += G;
|
|
2403
|
+
D.output = P;
|
|
2112
2404
|
I.backtrack = true;
|
|
2113
2405
|
I.globstar = true;
|
|
2114
|
-
consume(
|
|
2406
|
+
consume(G);
|
|
2115
2407
|
continue;
|
|
2116
2408
|
}
|
|
2117
2409
|
let e = remaining();
|
|
2118
2410
|
if (true !== n.noextglob && /^\([^?]/.test(e)) {
|
|
2119
|
-
extglobOpen("star",
|
|
2411
|
+
extglobOpen("star", G);
|
|
2120
2412
|
continue;
|
|
2121
2413
|
}
|
|
2122
2414
|
if ("star" === D.type) {
|
|
2123
2415
|
if (true === n.noglobstar) {
|
|
2124
|
-
consume(
|
|
2416
|
+
consume(G);
|
|
2125
2417
|
continue;
|
|
2126
2418
|
}
|
|
2127
2419
|
const r = D.prev;
|
|
@@ -2131,7 +2423,7 @@ var e = {
|
|
|
2131
2423
|
if (true === n.bash && (!o || e[0] && "/" !== e[0])) {
|
|
2132
2424
|
push({
|
|
2133
2425
|
type: "star",
|
|
2134
|
-
value:
|
|
2426
|
+
value: G,
|
|
2135
2427
|
output: ""
|
|
2136
2428
|
});
|
|
2137
2429
|
continue;
|
|
@@ -2141,7 +2433,7 @@ var e = {
|
|
|
2141
2433
|
if (!o && "paren" !== r.type && !a && !u) {
|
|
2142
2434
|
push({
|
|
2143
2435
|
type: "star",
|
|
2144
|
-
value:
|
|
2436
|
+
value: G,
|
|
2145
2437
|
output: ""
|
|
2146
2438
|
});
|
|
2147
2439
|
continue;
|
|
@@ -2154,11 +2446,11 @@ var e = {
|
|
|
2154
2446
|
}
|
|
2155
2447
|
if ("bos" === r.type && eos()) {
|
|
2156
2448
|
D.type = "globstar";
|
|
2157
|
-
D.value +=
|
|
2449
|
+
D.value += G;
|
|
2158
2450
|
D.output = globstar(n);
|
|
2159
2451
|
I.output = D.output;
|
|
2160
2452
|
I.globstar = true;
|
|
2161
|
-
consume(
|
|
2453
|
+
consume(G);
|
|
2162
2454
|
continue;
|
|
2163
2455
|
}
|
|
2164
2456
|
if ("slash" === r.type && "bos" !== r.prev.type && !i && eos()) {
|
|
@@ -2166,10 +2458,10 @@ var e = {
|
|
|
2166
2458
|
r.output = `(?:${r.output}`;
|
|
2167
2459
|
D.type = "globstar";
|
|
2168
2460
|
D.output = globstar(n) + (n.strictSlashes ? ")" : "|$)");
|
|
2169
|
-
D.value +=
|
|
2461
|
+
D.value += G;
|
|
2170
2462
|
I.globstar = true;
|
|
2171
2463
|
I.output += r.output + D.output;
|
|
2172
|
-
consume(
|
|
2464
|
+
consume(G);
|
|
2173
2465
|
continue;
|
|
2174
2466
|
}
|
|
2175
2467
|
if ("slash" === r.type && "bos" !== r.prev.type && "/" === e[0]) {
|
|
@@ -2178,10 +2470,10 @@ var e = {
|
|
|
2178
2470
|
r.output = `(?:${r.output}`;
|
|
2179
2471
|
D.type = "globstar";
|
|
2180
2472
|
D.output = `${globstar(n)}${E}|${E}${t})`;
|
|
2181
|
-
D.value +=
|
|
2473
|
+
D.value += G;
|
|
2182
2474
|
I.output += r.output + D.output;
|
|
2183
2475
|
I.globstar = true;
|
|
2184
|
-
consume(
|
|
2476
|
+
consume(G + U());
|
|
2185
2477
|
push({
|
|
2186
2478
|
type: "slash",
|
|
2187
2479
|
value: "/",
|
|
@@ -2191,11 +2483,11 @@ var e = {
|
|
|
2191
2483
|
}
|
|
2192
2484
|
if ("bos" === r.type && "/" === e[0]) {
|
|
2193
2485
|
D.type = "globstar";
|
|
2194
|
-
D.value +=
|
|
2486
|
+
D.value += G;
|
|
2195
2487
|
D.output = `(?:^|${E}|${globstar(n)}${E})`;
|
|
2196
2488
|
I.output = D.output;
|
|
2197
2489
|
I.globstar = true;
|
|
2198
|
-
consume(
|
|
2490
|
+
consume(G + U());
|
|
2199
2491
|
push({
|
|
2200
2492
|
type: "slash",
|
|
2201
2493
|
value: "/",
|
|
@@ -2206,16 +2498,16 @@ var e = {
|
|
|
2206
2498
|
I.output = I.output.slice(0, -D.output.length);
|
|
2207
2499
|
D.type = "globstar";
|
|
2208
2500
|
D.output = globstar(n);
|
|
2209
|
-
D.value +=
|
|
2501
|
+
D.value += G;
|
|
2210
2502
|
I.output += D.output;
|
|
2211
2503
|
I.globstar = true;
|
|
2212
|
-
consume(
|
|
2504
|
+
consume(G);
|
|
2213
2505
|
continue;
|
|
2214
2506
|
}
|
|
2215
2507
|
const r = {
|
|
2216
2508
|
type: "star",
|
|
2217
|
-
value:
|
|
2218
|
-
output:
|
|
2509
|
+
value: G,
|
|
2510
|
+
output: P
|
|
2219
2511
|
};
|
|
2220
2512
|
if (true === n.bash) {
|
|
2221
2513
|
r.output = ".*?";
|
|
@@ -2224,7 +2516,7 @@ var e = {
|
|
|
2224
2516
|
continue;
|
|
2225
2517
|
}
|
|
2226
2518
|
if (D && ("bracket" === D.type || "paren" === D.type) && true === n.regex) {
|
|
2227
|
-
r.output =
|
|
2519
|
+
r.output = G;
|
|
2228
2520
|
push(r);
|
|
2229
2521
|
continue;
|
|
2230
2522
|
}
|
|
@@ -2239,7 +2531,7 @@ var e = {
|
|
|
2239
2531
|
I.output += L;
|
|
2240
2532
|
D.output += L;
|
|
2241
2533
|
}
|
|
2242
|
-
if ("*" !==
|
|
2534
|
+
if ("*" !== F()) {
|
|
2243
2535
|
I.output += b;
|
|
2244
2536
|
D.output += b;
|
|
2245
2537
|
}
|
|
@@ -2284,8 +2576,8 @@ var e = {
|
|
|
2284
2576
|
if (a > i) throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);
|
|
2285
2577
|
t = c[t] || t;
|
|
2286
2578
|
const u = s.isWindows(e);
|
|
2287
|
-
const { DOT_LITERAL: l, SLASH_LITERAL: f, ONE_CHAR: p, DOTS_SLASH: d, NO_DOT: h, NO_DOTS: g, NO_DOTS_SLASH: _, STAR: A, START_ANCHOR:
|
|
2288
|
-
const
|
|
2579
|
+
const { DOT_LITERAL: l, SLASH_LITERAL: f, ONE_CHAR: p, DOTS_SLASH: d, NO_DOT: h, NO_DOTS: g, NO_DOTS_SLASH: _, STAR: A, START_ANCHOR: m } = r.globChars(u);
|
|
2580
|
+
const R = n.dot ? g : h;
|
|
2289
2581
|
const E = n.dot ? _ : h;
|
|
2290
2582
|
const b = n.capture ? "" : "?:";
|
|
2291
2583
|
const w = {
|
|
@@ -2296,26 +2588,26 @@ var e = {
|
|
|
2296
2588
|
if (n.capture) C = `(${C})`;
|
|
2297
2589
|
const globstar = (t)=>{
|
|
2298
2590
|
if (true === t.noglobstar) return C;
|
|
2299
|
-
return `(${b}(?:(?!${
|
|
2591
|
+
return `(${b}(?:(?!${m}${t.dot ? d : l}).)*?)`;
|
|
2300
2592
|
};
|
|
2301
2593
|
const create = (t)=>{
|
|
2302
2594
|
switch(t){
|
|
2303
2595
|
case "*":
|
|
2304
|
-
return `${
|
|
2596
|
+
return `${R}${p}${C}`;
|
|
2305
2597
|
case ".*":
|
|
2306
2598
|
return `${l}${p}${C}`;
|
|
2307
2599
|
case "*.*":
|
|
2308
|
-
return `${
|
|
2600
|
+
return `${R}${C}${l}${p}${C}`;
|
|
2309
2601
|
case "*/*":
|
|
2310
|
-
return `${
|
|
2602
|
+
return `${R}${C}${f}${p}${E}${C}`;
|
|
2311
2603
|
case "**":
|
|
2312
|
-
return
|
|
2604
|
+
return R + globstar(n);
|
|
2313
2605
|
case "**/*":
|
|
2314
|
-
return `(?:${
|
|
2606
|
+
return `(?:${R}${globstar(n)}${f})?${E}${p}${C}`;
|
|
2315
2607
|
case "**/*.*":
|
|
2316
|
-
return `(?:${
|
|
2608
|
+
return `(?:${R}${globstar(n)}${f})?${E}${C}${l}${p}${C}`;
|
|
2317
2609
|
case "**/.*":
|
|
2318
|
-
return `(?:${
|
|
2610
|
+
return `(?:${R}${globstar(n)}${f})?${l}${p}${C}`;
|
|
2319
2611
|
default:
|
|
2320
2612
|
{
|
|
2321
2613
|
const e = /^(.*?)\.(\w+)$/.exec(t);
|
|
@@ -2469,14 +2761,14 @@ var e = {
|
|
|
2469
2761
|
},
|
|
2470
2762
|
779: (t, e, n)=>{
|
|
2471
2763
|
const r = n(445);
|
|
2472
|
-
const { CHAR_ASTERISK: s, CHAR_AT: o, CHAR_BACKWARD_SLASH: i, CHAR_COMMA: a, CHAR_DOT: u, CHAR_EXCLAMATION_MARK: c, CHAR_FORWARD_SLASH: l, CHAR_LEFT_CURLY_BRACE: f, CHAR_LEFT_PARENTHESES: p, CHAR_LEFT_SQUARE_BRACKET: d, CHAR_PLUS: h, CHAR_QUESTION_MARK: g, CHAR_RIGHT_CURLY_BRACE: _, CHAR_RIGHT_PARENTHESES: A, CHAR_RIGHT_SQUARE_BRACKET:
|
|
2764
|
+
const { CHAR_ASTERISK: s, CHAR_AT: o, CHAR_BACKWARD_SLASH: i, CHAR_COMMA: a, CHAR_DOT: u, CHAR_EXCLAMATION_MARK: c, CHAR_FORWARD_SLASH: l, CHAR_LEFT_CURLY_BRACE: f, CHAR_LEFT_PARENTHESES: p, CHAR_LEFT_SQUARE_BRACKET: d, CHAR_PLUS: h, CHAR_QUESTION_MARK: g, CHAR_RIGHT_CURLY_BRACE: _, CHAR_RIGHT_PARENTHESES: A, CHAR_RIGHT_SQUARE_BRACKET: m } = n(193);
|
|
2473
2765
|
const isPathSeparator = (t)=>t === l || t === i;
|
|
2474
2766
|
const depth = (t)=>{
|
|
2475
2767
|
if (true !== t.isPrefix) t.depth = t.isGlobstar ? 1 / 0 : 1;
|
|
2476
2768
|
};
|
|
2477
2769
|
const scan = (t, e)=>{
|
|
2478
2770
|
const n = e || {};
|
|
2479
|
-
const
|
|
2771
|
+
const R = t.length - 1;
|
|
2480
2772
|
const E = true === n.parts || true === n.scanToEnd;
|
|
2481
2773
|
const b = [];
|
|
2482
2774
|
const w = [];
|
|
@@ -2488,28 +2780,28 @@ var e = {
|
|
|
2488
2780
|
let T = false;
|
|
2489
2781
|
let O = false;
|
|
2490
2782
|
let L = false;
|
|
2491
|
-
let P = false;
|
|
2492
2783
|
let k = false;
|
|
2784
|
+
let P = false;
|
|
2493
2785
|
let I = false;
|
|
2494
2786
|
let N = false;
|
|
2495
2787
|
let M = false;
|
|
2496
2788
|
let B = false;
|
|
2497
2789
|
let D = false;
|
|
2498
|
-
let
|
|
2499
|
-
let
|
|
2790
|
+
let G = 0;
|
|
2791
|
+
let F;
|
|
2500
2792
|
let U;
|
|
2501
2793
|
let W = {
|
|
2502
2794
|
value: "",
|
|
2503
2795
|
depth: 0,
|
|
2504
2796
|
isGlob: false
|
|
2505
2797
|
};
|
|
2506
|
-
const eos = ()=>S >=
|
|
2798
|
+
const eos = ()=>S >= R;
|
|
2507
2799
|
const peek = ()=>v.charCodeAt(S + 1);
|
|
2508
2800
|
const advance = ()=>{
|
|
2509
|
-
|
|
2801
|
+
F = U;
|
|
2510
2802
|
return v.charCodeAt(++S);
|
|
2511
2803
|
};
|
|
2512
|
-
while(S <
|
|
2804
|
+
while(S < R){
|
|
2513
2805
|
U = advance();
|
|
2514
2806
|
let t;
|
|
2515
2807
|
if (U === i) {
|
|
@@ -2519,7 +2811,7 @@ var e = {
|
|
|
2519
2811
|
continue;
|
|
2520
2812
|
}
|
|
2521
2813
|
if (true === I || U === f) {
|
|
2522
|
-
|
|
2814
|
+
G++;
|
|
2523
2815
|
while(true !== eos() && (U = advance())){
|
|
2524
2816
|
if (U === i) {
|
|
2525
2817
|
N = W.backslashes = true;
|
|
@@ -2527,7 +2819,7 @@ var e = {
|
|
|
2527
2819
|
continue;
|
|
2528
2820
|
}
|
|
2529
2821
|
if (U === f) {
|
|
2530
|
-
|
|
2822
|
+
G++;
|
|
2531
2823
|
continue;
|
|
2532
2824
|
}
|
|
2533
2825
|
if (true !== I && U === u && (U = advance()) === u) {
|
|
@@ -2545,8 +2837,8 @@ var e = {
|
|
|
2545
2837
|
break;
|
|
2546
2838
|
}
|
|
2547
2839
|
if (U === _) {
|
|
2548
|
-
|
|
2549
|
-
if (0 ===
|
|
2840
|
+
G--;
|
|
2841
|
+
if (0 === G) {
|
|
2550
2842
|
I = false;
|
|
2551
2843
|
T = W.isBrace = true;
|
|
2552
2844
|
D = true;
|
|
@@ -2566,7 +2858,7 @@ var e = {
|
|
|
2566
2858
|
isGlob: false
|
|
2567
2859
|
};
|
|
2568
2860
|
if (true === D) continue;
|
|
2569
|
-
if (
|
|
2861
|
+
if (F === u && S === $ + 1) {
|
|
2570
2862
|
$ += 2;
|
|
2571
2863
|
continue;
|
|
2572
2864
|
}
|
|
@@ -2577,7 +2869,7 @@ var e = {
|
|
|
2577
2869
|
const t = U === h || U === o || U === s || U === g || U === c;
|
|
2578
2870
|
if (true === t && peek() === p) {
|
|
2579
2871
|
L = W.isGlob = true;
|
|
2580
|
-
|
|
2872
|
+
k = W.isExtglob = true;
|
|
2581
2873
|
D = true;
|
|
2582
2874
|
if (U === c && S === $) B = true;
|
|
2583
2875
|
if (true === E) {
|
|
@@ -2599,7 +2891,7 @@ var e = {
|
|
|
2599
2891
|
}
|
|
2600
2892
|
}
|
|
2601
2893
|
if (U === s) {
|
|
2602
|
-
if (
|
|
2894
|
+
if (F === s) P = W.isGlobstar = true;
|
|
2603
2895
|
L = W.isGlob = true;
|
|
2604
2896
|
D = true;
|
|
2605
2897
|
if (true === E) continue;
|
|
@@ -2618,7 +2910,7 @@ var e = {
|
|
|
2618
2910
|
advance();
|
|
2619
2911
|
continue;
|
|
2620
2912
|
}
|
|
2621
|
-
if (t ===
|
|
2913
|
+
if (t === m) {
|
|
2622
2914
|
O = W.isBracket = true;
|
|
2623
2915
|
L = W.isGlob = true;
|
|
2624
2916
|
D = true;
|
|
@@ -2658,7 +2950,7 @@ var e = {
|
|
|
2658
2950
|
}
|
|
2659
2951
|
}
|
|
2660
2952
|
if (true === n.noext) {
|
|
2661
|
-
|
|
2953
|
+
k = false;
|
|
2662
2954
|
L = false;
|
|
2663
2955
|
}
|
|
2664
2956
|
let K = v;
|
|
@@ -2692,8 +2984,8 @@ var e = {
|
|
|
2692
2984
|
isBrace: T,
|
|
2693
2985
|
isBracket: O,
|
|
2694
2986
|
isGlob: L,
|
|
2695
|
-
isExtglob:
|
|
2696
|
-
isGlobstar:
|
|
2987
|
+
isExtglob: k,
|
|
2988
|
+
isGlobstar: P,
|
|
2697
2989
|
negated: M,
|
|
2698
2990
|
negatedExtglob: B
|
|
2699
2991
|
};
|
|
@@ -3013,8 +3305,8 @@ __nccwpck_require__.d(r, {
|
|
|
3013
3305
|
Kd: ()=>N,
|
|
3014
3306
|
li: ()=>M,
|
|
3015
3307
|
IK: ()=>L,
|
|
3016
|
-
AG: ()=>
|
|
3017
|
-
Hz: ()=>
|
|
3308
|
+
AG: ()=>P,
|
|
3309
|
+
Hz: ()=>k,
|
|
3018
3310
|
ey: ()=>I,
|
|
3019
3311
|
Zh: ()=>isGitIgnored,
|
|
3020
3312
|
kD: ()=>isGitIgnoredSync,
|
|
@@ -3217,9 +3509,9 @@ const g = require("node:url");
|
|
|
3217
3509
|
function toPath(t) {
|
|
3218
3510
|
return t instanceof URL ? (0, g.fileURLToPath)(t) : t;
|
|
3219
3511
|
}
|
|
3220
|
-
const
|
|
3221
|
-
const
|
|
3222
|
-
var E = __nccwpck_require__(
|
|
3512
|
+
const m = require("node:fs/promises");
|
|
3513
|
+
const R = require("node:os");
|
|
3514
|
+
var E = __nccwpck_require__(425);
|
|
3223
3515
|
function isPathInside(t, e) {
|
|
3224
3516
|
const n = i.relative(e, t);
|
|
3225
3517
|
return Boolean(n && ".." !== n && !n.startsWith(`..${i.sep}`) && n !== i.resolve(t));
|
|
@@ -3507,7 +3799,7 @@ const S = {
|
|
|
3507
3799
|
};
|
|
3508
3800
|
const $ = "**/.gitignore";
|
|
3509
3801
|
const H = 10;
|
|
3510
|
-
const getReadFileMethod = (t)=>bindFsMethod(t?.promises, "readFile") ?? bindFsMethod(
|
|
3802
|
+
const getReadFileMethod = (t)=>bindFsMethod(t?.promises, "readFile") ?? bindFsMethod(m, "readFile") ?? promisifyFsMethod(t, "readFile");
|
|
3511
3803
|
const getReadFileSyncMethod = (t)=>bindFsMethod(t, "readFileSync") ?? bindFsMethod(o, "readFileSync");
|
|
3512
3804
|
const shouldSkipIgnoreFileError = (t, e)=>{
|
|
3513
3805
|
if (!t) return Boolean(e);
|
|
@@ -3684,7 +3976,7 @@ const parseGitConfigValue = (t)=>{
|
|
|
3684
3976
|
};
|
|
3685
3977
|
const resolveConfigPath = (t, e)=>{
|
|
3686
3978
|
if (e.startsWith("~/")) {
|
|
3687
|
-
const t =
|
|
3979
|
+
const t = R.homedir();
|
|
3688
3980
|
const n = i.join(t, e.slice(2));
|
|
3689
3981
|
if (!isPathInside(n, t)) return i.join(t, ".globby-invalid-path-traversal");
|
|
3690
3982
|
return n;
|
|
@@ -3731,7 +4023,7 @@ const parseIncludeIfCondition = (t)=>{
|
|
|
3731
4023
|
return e ? e[1] : void 0;
|
|
3732
4024
|
};
|
|
3733
4025
|
const normalizeGitConfigConditionPattern = (t, e)=>{
|
|
3734
|
-
if (t.startsWith("~/")) t = i.join(
|
|
4026
|
+
if (t.startsWith("~/")) t = i.join(R.homedir(), t.slice(2));
|
|
3735
4027
|
else if (t.startsWith("./")) t = i.resolve(i.dirname(e), t.slice(2));
|
|
3736
4028
|
else if (!i.isAbsolute(t)) t = `**/${t}`;
|
|
3737
4029
|
if (t.endsWith("/")) t += "**";
|
|
@@ -3903,7 +4195,7 @@ const getGitDirectoryAsync = async (t, e)=>{
|
|
|
3903
4195
|
return n;
|
|
3904
4196
|
}
|
|
3905
4197
|
};
|
|
3906
|
-
const getXdgConfigHome = ()=>s.env.XDG_CONFIG_HOME || i.join(
|
|
4198
|
+
const getXdgConfigHome = ()=>s.env.XDG_CONFIG_HOME || i.join(R.homedir(), ".config");
|
|
3907
4199
|
const getGitConfigPaths = ()=>{
|
|
3908
4200
|
if ("GIT_CONFIG_GLOBAL" in s.env) {
|
|
3909
4201
|
const t = s.env.GIT_CONFIG_GLOBAL;
|
|
@@ -3913,7 +4205,7 @@ const getGitConfigPaths = ()=>{
|
|
|
3913
4205
|
}
|
|
3914
4206
|
return [
|
|
3915
4207
|
i.join(getXdgConfigHome(), "git", "config"),
|
|
3916
|
-
i.join(
|
|
4208
|
+
i.join(R.homedir(), ".gitconfig")
|
|
3917
4209
|
];
|
|
3918
4210
|
};
|
|
3919
4211
|
const getDefaultGlobalGitignorePath = ()=>i.join(getXdgConfigHome(), "git", "ignore");
|
|
@@ -4529,14 +4821,14 @@ const L = normalizeArguments(async (t, e)=>{
|
|
|
4529
4821
|
const i = await Promise.all(o.map((t)=>(0, p["default"])(t.patterns, t.options)));
|
|
4530
4822
|
return unionFastGlobResultsAsync(i, s);
|
|
4531
4823
|
});
|
|
4532
|
-
const
|
|
4824
|
+
const k = normalizeArgumentsSync((t, e)=>{
|
|
4533
4825
|
assertGlobalGitignoreSyncSupport(e);
|
|
4534
4826
|
const { options: n, pruneIgnorePatterns: r, filter: s } = applyIgnoreFilesAndGetFilterSync(e);
|
|
4535
4827
|
const o = generateTasksSync(t, n, r);
|
|
4536
4828
|
const i = o.map((t)=>p["default"].sync(t.patterns, t.options));
|
|
4537
4829
|
return unionFastGlobResults(i, s);
|
|
4538
4830
|
});
|
|
4539
|
-
const
|
|
4831
|
+
const P = normalizeArgumentsSync((t, e)=>{
|
|
4540
4832
|
assertGlobalGitignoreAsyncSupport(e);
|
|
4541
4833
|
const n = new Set;
|
|
4542
4834
|
const r = a.Readable.from(async function*() {
|
|
@@ -4559,8 +4851,8 @@ const N = normalizeArguments(generateTasks);
|
|
|
4559
4851
|
const M = normalizeArgumentsSync(generateTasksSync);
|
|
4560
4852
|
const { convertPathToPattern: B } = p["default"];
|
|
4561
4853
|
var D = r.a;
|
|
4562
|
-
var
|
|
4563
|
-
var
|
|
4854
|
+
var G = r.Kd;
|
|
4855
|
+
var F = r.li;
|
|
4564
4856
|
var U = r.IK;
|
|
4565
4857
|
var W = r.AG;
|
|
4566
4858
|
var K = r.Hz;
|
|
@@ -4569,4 +4861,4 @@ var q = r.Zh;
|
|
|
4569
4861
|
var z = r.kD;
|
|
4570
4862
|
var Q = r.dK;
|
|
4571
4863
|
var X = r.Sb;
|
|
4572
|
-
export { D as convertPathToPattern,
|
|
4864
|
+
export { D as convertPathToPattern, G as generateGlobTasks, F as generateGlobTasksSync, U as globby, W as globbyStream, K as globbySync, j as isDynamicPattern, q as isGitIgnored, z as isGitIgnoredSync, Q as isIgnoredByIgnoreFiles, X as isIgnoredByIgnoreFilesSync };
|