@bleedingdev/modern-js-utils 3.9.3-ultramodern.1 → 3.9.3-ultramodern.10

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.
Files changed (81) hide show
  1. package/dist/compiled/address/provenance.json +1 -1
  2. package/dist/compiled/browserslist/index.js +7 -7
  3. package/dist/compiled/browserslist/provenance.json +1 -1
  4. package/dist/compiled/chalk/provenance.json +1 -1
  5. package/dist/compiled/chokidar/index.d.mts +18 -9
  6. package/dist/compiled/chokidar/index.d.ts +18 -9
  7. package/dist/compiled/chokidar/index.js +194 -171
  8. package/dist/compiled/chokidar/index.mjs +94 -71
  9. package/dist/compiled/chokidar/provenance.json +2 -2
  10. package/dist/compiled/commander/provenance.json +1 -1
  11. package/dist/compiled/debug/provenance.json +1 -1
  12. package/dist/compiled/dotenv-expand/LICENSE +11 -7
  13. package/dist/compiled/dotenv-expand/declaration-licenses/dotenv-expand/LICENSE +11 -7
  14. package/dist/compiled/dotenv-expand/index.js +5545 -61
  15. package/dist/compiled/dotenv-expand/licenses-cjs.txt +12 -7
  16. package/dist/compiled/dotenv-expand/package.json +1 -1
  17. package/dist/compiled/dotenv-expand/provenance.json +7 -7
  18. package/dist/compiled/execa/index.d.mts +67 -33
  19. package/dist/compiled/execa/index.d.ts +67 -33
  20. package/dist/compiled/execa/index.js +1848 -1369
  21. package/dist/compiled/execa/index.mjs +1851 -1372
  22. package/dist/compiled/execa/package.json +1 -1
  23. package/dist/compiled/execa/provenance.json +3 -3
  24. package/dist/compiled/filesize/index.js +26 -25
  25. package/dist/compiled/filesize/index.js.LICENSE.txt +1 -1
  26. package/dist/compiled/filesize/index.mjs +25 -24
  27. package/dist/compiled/filesize/index.mjs.LICENSE.txt +1 -1
  28. package/dist/compiled/filesize/package.json +1 -1
  29. package/dist/compiled/filesize/provenance.json +4 -4
  30. package/dist/compiled/fs-extra/provenance.json +1 -1
  31. package/dist/compiled/glob/provenance.json +3 -3
  32. package/dist/compiled/globby/index.js +431 -139
  33. package/dist/compiled/globby/index.mjs +576 -284
  34. package/dist/compiled/globby/provenance.json +1 -1
  35. package/dist/compiled/gzip-size/provenance.json +1 -1
  36. package/dist/compiled/import-lazy/provenance.json +1 -1
  37. package/dist/compiled/inquirer/index.d.mts +10 -0
  38. package/dist/compiled/inquirer/index.d.ts +10 -0
  39. package/dist/compiled/inquirer/index.js +112 -96
  40. package/dist/compiled/inquirer/index.mjs +98 -82
  41. package/dist/compiled/inquirer/licenses-cjs.txt +26 -0
  42. package/dist/compiled/inquirer/licenses-esm.txt +26 -0
  43. package/dist/compiled/inquirer/package.json +1 -1
  44. package/dist/compiled/inquirer/provenance.json +18 -18
  45. package/dist/compiled/js-yaml/index.js +258 -208
  46. package/dist/compiled/js-yaml/index.js.LICENSE.txt +1 -1
  47. package/dist/compiled/js-yaml/index.mjs +328 -278
  48. package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +1 -1
  49. package/dist/compiled/js-yaml/package.json +1 -1
  50. package/dist/compiled/js-yaml/provenance.json +4 -4
  51. package/dist/compiled/json5/provenance.json +1 -1
  52. package/dist/compiled/lodash/common/function.d.ts +2 -2
  53. package/dist/compiled/lodash/provenance.json +2 -2
  54. package/dist/compiled/mime-types/provenance.json +1 -1
  55. package/dist/compiled/minimist/provenance.json +1 -1
  56. package/dist/compiled/nanoid/index.d.mts +3 -3
  57. package/dist/compiled/nanoid/index.d.ts +3 -3
  58. package/dist/compiled/nanoid/index.js +10 -10
  59. package/dist/compiled/nanoid/index.mjs +10 -10
  60. package/dist/compiled/nanoid/package.json +1 -1
  61. package/dist/compiled/nanoid/provenance.json +4 -4
  62. package/dist/compiled/ora/index.js +310 -286
  63. package/dist/compiled/ora/index.mjs +651 -627
  64. package/dist/compiled/ora/provenance.json +1 -1
  65. package/dist/compiled/pkg-up/provenance.json +1 -1
  66. package/dist/compiled/semver/provenance.json +1 -1
  67. package/dist/compiled/signale/provenance.json +1 -1
  68. package/dist/compiled/slash/provenance.json +1 -1
  69. package/dist/compiled/strip-ansi/index.js +1 -1
  70. package/dist/compiled/strip-ansi/index.mjs +3 -3
  71. package/dist/compiled/strip-ansi/provenance.json +1 -1
  72. package/dist/compiled/tsconfig-paths/provenance.json +1 -1
  73. package/dist/compiled/upath/provenance.json +1 -1
  74. package/dist/compiled/url-join/index.js +56 -29
  75. package/dist/compiled/url-join/index.mjs +57 -30
  76. package/dist/compiled/url-join/package.json +1 -1
  77. package/dist/compiled/url-join/provenance.json +4 -4
  78. package/dist/types/cli/commands.d.ts +1 -1
  79. package/dist/types/cli/modulePath.d.ts +1 -1
  80. package/dist/types/compiled.d.ts +13 -13
  81. package/package.json +8 -8
@@ -229,10 +229,10 @@
229
229
  let x = E;
230
230
  let C = 0;
231
231
  const S = t.length;
232
- let v = 0;
233
232
  let $ = 0;
233
+ let v = 0;
234
234
  let T;
235
- const advance = ()=>t[v++];
235
+ const advance = ()=>t[$++];
236
236
  const push = (t)=>{
237
237
  if ("text" === t.type && "dot" === x.type) x.type = "text";
238
238
  if (x && "text" === x.type && "text" === t.type) {
@@ -248,7 +248,7 @@
248
248
  push({
249
249
  type: "bos"
250
250
  });
251
- while(v < S){
251
+ while($ < S){
252
252
  w = b[b.length - 1];
253
253
  T = advance();
254
254
  if (T === R || T === A) continue;
@@ -269,7 +269,7 @@
269
269
  if (T === h) {
270
270
  C++;
271
271
  let t;
272
- while(v < S && (t = advance())){
272
+ while($ < S && (t = advance())){
273
273
  T += t;
274
274
  if (t === h) {
275
275
  C++;
@@ -323,7 +323,7 @@
323
323
  const t = T;
324
324
  let n;
325
325
  if (true !== e.keepQuotes) T = "";
326
- while(v < S && (n = advance())){
326
+ while($ < S && (n = advance())){
327
327
  if (n === i) {
328
328
  T += n + advance();
329
329
  continue;
@@ -342,14 +342,14 @@
342
342
  }
343
343
  if (T === p) {
344
344
  s.assertDepth(b.length);
345
- $++;
345
+ v++;
346
346
  const t = x.value && "$" === x.value.slice(-1) || true === w.dollar;
347
347
  const e = {
348
348
  type: "brace",
349
349
  open: true,
350
350
  close: false,
351
351
  dollar: t,
352
- depth: $,
352
+ depth: v,
353
353
  commas: 0,
354
354
  ranges: 0,
355
355
  nodes: []
@@ -377,11 +377,11 @@
377
377
  type: t,
378
378
  value: T
379
379
  });
380
- $--;
380
+ v--;
381
381
  w = b[b.length - 1];
382
382
  continue;
383
383
  }
384
- if (T === a && $ > 0) {
384
+ if (T === a && v > 0) {
385
385
  if (w.ranges > 0) {
386
386
  w.ranges = 0;
387
387
  const t = w.nodes.shift();
@@ -400,9 +400,9 @@
400
400
  w.commas++;
401
401
  continue;
402
402
  }
403
- if (T === c && $ > 0 && 0 === w.commas) {
403
+ if (T === c && v > 0 && 0 === w.commas) {
404
404
  const t = w.nodes;
405
- if (0 === $ || 0 === t.length) {
405
+ if (0 === v || 0 === t.length) {
406
406
  push({
407
407
  type: "text",
408
408
  value: T
@@ -731,7 +731,7 @@
731
731
  };
732
732
  t.exports = fill;
733
733
  },
734
- 869: (t)=>{
734
+ 425: (t)=>{
735
735
  function makeArray(t) {
736
736
  return Array.isArray(t) ? t : [
737
737
  t
@@ -741,45 +741,153 @@
741
741
  const n = "";
742
742
  const r = " ";
743
743
  const s = "\\";
744
- const o = /^\s+$/;
745
- const i = /(?:[^\\]|^)\\$/;
746
- const u = /^\\!/;
747
- const a = /^\\#/;
748
- const c = /\r?\n/g;
749
- const l = /^\.{0,2}\/|^\.{1,2}$/;
750
- const f = /\/$/;
751
- const p = "/";
752
- let d = "node-ignore";
753
- if ("u" > typeof Symbol) d = Symbol.for("node-ignore");
754
- const h = d;
744
+ const o = /[.*+?()[\]{}^$|\\/]/;
745
+ const i = "\ufeff";
746
+ const u = /(?:[^\\]|^)\\$/;
747
+ const a = /^\\!/;
748
+ const c = /^\\#/;
749
+ const l = /\r?\n/g;
750
+ const f = "//";
751
+ const p = 47;
752
+ const d = 46;
753
+ const h = "/";
754
+ let g = "node-ignore";
755
+ if ("u" > typeof Symbol) g = Symbol.for("node-ignore");
756
+ const y = g;
755
757
  const define = (t, e, n)=>{
756
758
  Object.defineProperty(t, e, {
757
759
  value: n
758
760
  });
759
761
  return n;
760
762
  };
761
- const g = /([0-z])-([0-z])/g;
762
763
  const RETURN_FALSE = ()=>false;
763
- const sanitizeRange = (t)=>t.replace(g, (t, e, r)=>e.charCodeAt(0) <= r.charCodeAt(0) ? t : n);
764
764
  const cleanRangeBackSlash = (t)=>{
765
765
  const { length: e } = t;
766
766
  return t.slice(0, e - e % 2);
767
767
  };
768
- const y = [
769
- [
770
- /^\uFEFF/,
771
- ()=>n
772
- ],
773
- [
774
- /((?:\\\\)*?)(\\?\s+)$/,
775
- (t, e, s)=>e + (0 === s.indexOf("\\") ? r : n)
776
- ],
777
- [
778
- /(\\+?)\s/g,
779
- (t, e)=>{
780
- const { length: n } = e;
781
- return e.slice(0, n - n % 2) + r;
768
+ const _ = {
769
+ alnum: "0-9A-Za-z",
770
+ alpha: "A-Za-z",
771
+ blank: " \\t",
772
+ cntrl: "\\x00-\\x1f\\x7f",
773
+ digit: "0-9",
774
+ graph: "!-.0-~",
775
+ lower: "a-z",
776
+ print: " -.0-~",
777
+ punct: "!-.:-@\\[-`{-~",
778
+ space: " \\t\\n\\r",
779
+ upper: "A-Z",
780
+ xdigit: "0-9A-Fa-f"
781
+ };
782
+ const A = "\\]^-[";
783
+ const escapeMember = (t)=>A.indexOf(t) < 0 ? t : s + t;
784
+ const R = "(?!\\/)";
785
+ const classSource = (t, e)=>{
786
+ if (t) return `[^\\/${e}]`;
787
+ const n = `[${e}]`;
788
+ return new RegExp(n).test("/") ? R + n : n;
789
+ };
790
+ const scanBracket = (t, r)=>{
791
+ const { length: o } = t;
792
+ let i = r + 1;
793
+ let u = n;
794
+ const a = t[i];
795
+ if ("!" === a || "^" === a) {
796
+ u = "^";
797
+ i++;
798
+ }
799
+ let c = n;
800
+ let l = n;
801
+ for(;;){
802
+ const r = t[i];
803
+ if (r === e) return null;
804
+ if (r === s) {
805
+ const n = t[i + 1];
806
+ if (n === e) return null;
807
+ c += escapeMember(n);
808
+ l = n;
809
+ i++;
810
+ } else if ("-" === r && l && i + 1 < o && "]" !== t[i + 1]) {
811
+ i++;
812
+ let e = t[i];
813
+ if (e === s) e = t[i += 1];
814
+ if (l <= e) c += `-${escapeMember(e)}`;
815
+ l = n;
816
+ } else if ("[" === r && ":" === t[i + 1]) {
817
+ const r = i + 2;
818
+ let s = r;
819
+ while(s < o && "]" !== t[s])s++;
820
+ if (s === o) return null;
821
+ if (s > r && ":" === t[s - 1]) {
822
+ const o = _[t.slice(r, s - 1)];
823
+ if (o === e) return null;
824
+ c += o;
825
+ l = n;
826
+ i = s;
827
+ } else {
828
+ c += escapeMember("[");
829
+ l = "[";
830
+ i = r - 2;
831
+ }
832
+ } else {
833
+ c += escapeMember(r);
834
+ l = r;
782
835
  }
836
+ i++;
837
+ if ("]" === t[i]) return {
838
+ end: i,
839
+ source: classSource(u, c)
840
+ };
841
+ }
842
+ };
843
+ const m = "[]";
844
+ const E = "\0";
845
+ const b = new RegExp(`${E}(\\d+)${E}`, "g");
846
+ const w = "";
847
+ const x = "";
848
+ const extractBrackets = (t)=>{
849
+ const i = [];
850
+ const hold = (t)=>`${E}${i.push(t) - 1}${E}`;
851
+ const { length: u } = t;
852
+ let a = n;
853
+ let c = 0;
854
+ while(c < u){
855
+ const n = t[c];
856
+ if (n === s) {
857
+ const n = t[c + 1];
858
+ if (n === e || n === h && c + 2 === u) a += hold(m);
859
+ else if ("*" === n || "[" === n || n === r || n === s) a += t.slice(c, c + 2);
860
+ else a += hold(o.test(n) ? s + n : n);
861
+ c += 2;
862
+ } else if (n === E) {
863
+ a += hold(`[${E}]`);
864
+ c++;
865
+ } else if ("[" === n) {
866
+ const e = scanBracket(t, c);
867
+ if (null === e) {
868
+ a += hold(m);
869
+ c = u;
870
+ } else {
871
+ a += hold(e.source);
872
+ c = e.end + 1;
873
+ }
874
+ } else {
875
+ a += n;
876
+ c++;
877
+ }
878
+ }
879
+ return {
880
+ source: a,
881
+ sources: i
882
+ };
883
+ };
884
+ const C = null;
885
+ const S = /\/(?!$)/;
886
+ const $ = [
887
+ [
888
+ /(\\+)( ?)/g,
889
+ (t, e, n)=>n ? e.slice(0, e.length - e.length % 2) + r : e,
890
+ s + r
783
891
  ],
784
892
  [
785
893
  /[\\$.|*+(){^]/g,
@@ -787,72 +895,204 @@
787
895
  ],
788
896
  [
789
897
  /(?!\\)\?/g,
790
- ()=>"[^/]"
898
+ ()=>"[^/]",
899
+ "?"
791
900
  ],
792
901
  [
793
902
  /^\//,
794
- ()=>"^"
903
+ ()=>"^",
904
+ h
795
905
  ],
796
906
  [
797
907
  /\//g,
798
- ()=>"\\/"
908
+ ()=>"\\/",
909
+ h
799
910
  ],
800
911
  [
801
- /^\^*\\\*\\\*\\\//,
802
- ()=>"^(?:.*\\/)?"
912
+ /^\^*(?:\\\*\\\*\\\/)+/,
913
+ ()=>"^(?:.*\\/)?",
914
+ "*"
803
915
  ],
804
916
  [
805
- /^(?=[^^])/,
806
- function() {
807
- return /\/(?!$)/.test(this) ? "^" : "(?:^|\\/)";
917
+ C,
918
+ (t, e)=>{
919
+ if (!t || "^" === t[0]) return t;
920
+ const n = S.test(e) ? "^" : "(?:^|\\/)";
921
+ return n + t;
808
922
  }
809
923
  ],
810
924
  [
811
925
  /\\\/\\\*\\\*(?=\\\/|$)/g,
812
- (t, e, n)=>e + 6 < n.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
926
+ (t, e, n)=>e + 6 < n.length ? "\\/" === n.slice(e + 6) ? "(?:\\/[^\\/]+)+" : "(?:\\/[^\\/]+)*" : `\\/${x}`,
927
+ "*"
813
928
  ],
814
929
  [
815
930
  /(^|[^\\]+)(\\\*)+(?=.+)/g,
816
931
  (t, e, n)=>{
817
932
  const r = n.replace(/\\\*/g, "[^\\/]*");
818
933
  return e + r;
819
- }
934
+ },
935
+ "*"
936
+ ],
937
+ [
938
+ /(^|[^\\])((?:\\\\)*)\\\*$/,
939
+ (t, e, n)=>n.length / 2 % 2 === 0 ? e + n + w : t,
940
+ "*"
820
941
  ],
821
942
  [
822
943
  /\\\\\\(?=[$.|*+(){^])/g,
823
- ()=>s
944
+ ()=>s,
945
+ s + s
824
946
  ],
825
947
  [
826
948
  /\\\\/g,
827
- ()=>s
949
+ ()=>s,
950
+ s + s
828
951
  ],
829
952
  [
830
- /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
831
- (t, e, n, r, o)=>e === s ? `\\[${n}${cleanRangeBackSlash(r)}${o}` : "]" === o ? r.length % 2 === 0 ? `[${sanitizeRange(n)}${r}]` : "[]" : "[]"
953
+ /\\\[([^\]/]*?)(\\*)($|\])/g,
954
+ (t, e, n, r)=>`\\[${e}${cleanRangeBackSlash(n)}${r}`,
955
+ "["
832
956
  ],
833
957
  [
834
- /(?:[^*])$/,
835
- (t)=>/\/$/.test(t) ? `${t}$` : `${t}(?=$|\\/$)`
958
+ C,
959
+ (t)=>{
960
+ const e = t[t.length - 1];
961
+ if (!e || e === w || e === x) return t;
962
+ return e === h ? `${t}$` : `${t}(?=$|\\/$)`;
963
+ }
836
964
  ]
837
965
  ];
838
- const _ = /(^|\\\/)?\\\*$/;
839
- const A = "regex";
840
- const R = "checkRegex";
841
- const m = "_";
842
- const E = {
843
- [A] (t, e) {
844
- const n = e ? `${e}[^/]+` : "[^/]*";
845
- return `${n}(?=$|\\/$)`;
846
- },
847
- [R] (t, e) {
848
- const n = e ? `${e}[^/]*` : "[^/]*";
849
- return `${n}(?=$|\\/$)`;
966
+ const v = /(^|\\\/)?\uE000$/;
967
+ const T = "regex";
968
+ const H = "checkRegex";
969
+ const O = "_";
970
+ const replaceTrailingWildcard = (t, e)=>{
971
+ const n = e ? `${e}[^/]+` : "[^/]*";
972
+ return `${n}(?=$|\\/$)`;
973
+ };
974
+ const L = /\uE001$/;
975
+ const replaceTrailingDoublestar = ()=>".+(?=$|\\/$)";
976
+ const P = "[^\\/]*";
977
+ const separatorAfter = (t, e)=>{
978
+ let r = n;
979
+ for(let n = e + 1; n < t.length && !t[n].wildcard; n++)r += t[n].single;
980
+ return r;
981
+ };
982
+ const pinWildcards = (t)=>{
983
+ if (t.indexOf(P) < 0) return t;
984
+ const e = [];
985
+ const { length: r } = t;
986
+ let o = 0;
987
+ while(o < r){
988
+ const n = t[o];
989
+ if (t.startsWith(P, o)) {
990
+ e.push({
991
+ wildcard: true
992
+ });
993
+ o += P.length;
994
+ } else if ("[" === n) {
995
+ let n = o + 1;
996
+ if ("^" === t[n]) n++;
997
+ if ("]" === t[n]) n++;
998
+ while(n < r && "]" !== t[n])n += t[n] === s ? 2 : 1;
999
+ n++;
1000
+ e.push({
1001
+ single: t.slice(o, n)
1002
+ });
1003
+ o = n;
1004
+ } else if (n === s) {
1005
+ e.push({
1006
+ single: t.slice(o, o + 2)
1007
+ });
1008
+ o += 2;
1009
+ } else if ("(" === n) {
1010
+ let n = 0;
1011
+ let i = o;
1012
+ do {
1013
+ if (t[i] === s) i++;
1014
+ else if ("(" === t[i]) n++;
1015
+ else if (")" === t[i]) n--;
1016
+ i++;
1017
+ }while (i < r && n > 0);
1018
+ if ("*+?".indexOf(t[i]) >= 0) i++;
1019
+ e.push({
1020
+ boundary: t.slice(o, i)
1021
+ });
1022
+ o = i;
1023
+ } else if ("^" === n || "$" === n) {
1024
+ e.push({
1025
+ boundary: n
1026
+ });
1027
+ o++;
1028
+ } else {
1029
+ e.push({
1030
+ single: n
1031
+ });
1032
+ o++;
1033
+ }
1034
+ }
1035
+ let i = n;
1036
+ let u = [];
1037
+ const flush = ()=>{
1038
+ let t;
1039
+ u.forEach((e, n)=>{
1040
+ if (e.wildcard) t = n;
1041
+ });
1042
+ u.forEach((e, n)=>{
1043
+ if (!e.wildcard) {
1044
+ i += e.single;
1045
+ return;
1046
+ }
1047
+ i += n === t ? P : `(?:(?!${separatorAfter(u, n)})[^\\/])*`;
1048
+ });
1049
+ u = [];
1050
+ };
1051
+ e.forEach((t)=>{
1052
+ if (void 0 === t.boundary) return void u.push(t);
1053
+ flush();
1054
+ i += t.boundary;
1055
+ });
1056
+ flush();
1057
+ return i;
1058
+ };
1059
+ const makeRegexPrefix = (t)=>{
1060
+ const { source: n, sources: r } = extractBrackets(t);
1061
+ const s = $.reduce((n, [r, s, o])=>{
1062
+ if (r === C) return s(n, t);
1063
+ if (o !== e && n.indexOf(o) < 0) return n;
1064
+ return r.test(n) ? n.replace(r, s.bind(t)) : n;
1065
+ }, n);
1066
+ return r.length ? s.replace(b, (t, e)=>r[e]) : s;
1067
+ };
1068
+ const checkSourceOf = (t, e)=>{
1069
+ if (t[t.length - 1] === h) e = makeRegexPrefix(t.slice(0, -1));
1070
+ const n = e.slice(0, -1);
1071
+ const r = e[e.length - 1];
1072
+ return r === w ? `${n}$` : r === x ? `${n}.*$` : m;
1073
+ };
1074
+ const matchesBasename = (t)=>{
1075
+ const e = t.indexOf(h);
1076
+ return e < 0 || e === t.length - 1;
1077
+ };
1078
+ const basenameOf = (t)=>{
1079
+ const e = t.length - 1;
1080
+ const n = t.lastIndexOf(h, t[e] === h ? e - 1 : e);
1081
+ return n < 0 ? t : t.slice(n + 1);
1082
+ };
1083
+ const parentOf = (t)=>{
1084
+ if (t.charCodeAt(0) === p || t.indexOf(f) >= 0) {
1085
+ const e = t.split(h).filter(Boolean);
1086
+ e.pop();
1087
+ return e.length ? e.join(h) + h : n;
850
1088
  }
1089
+ const e = t.length - 1;
1090
+ const r = t.lastIndexOf(h, t.charCodeAt(e) === p ? e - 1 : e);
1091
+ return r < 0 ? n : t.slice(0, r + 1);
851
1092
  };
852
- const makeRegexPrefix = (t)=>y.reduce((e, [n, r])=>e.replace(n, r.bind(t)), t);
853
1093
  const isString = (t)=>"string" == typeof t;
854
- const checkPattern = (t)=>t && isString(t) && !o.test(t) && !i.test(t) && 0 !== t.indexOf("#");
855
- const splitPattern = (t)=>t.split(c).filter(Boolean);
1094
+ const checkPattern = (t)=>t && isString(t) && !u.test(t);
1095
+ const splitPattern = (t)=>t.split(l).filter(Boolean);
856
1096
  class IgnoreRule {
857
1097
  constructor(t, e, n, r, s, o){
858
1098
  this.pattern = t;
@@ -862,77 +1102,125 @@
862
1102
  define(this, "ignoreCase", r);
863
1103
  define(this, "regexPrefix", o);
864
1104
  }
1105
+ get _basenameOnly() {
1106
+ return define(this, "_basenameOnly", matchesBasename(this.body));
1107
+ }
865
1108
  get regex() {
866
- const t = m + A;
1109
+ const t = O + T;
867
1110
  if (this[t]) return this[t];
868
- return this._make(A, t);
1111
+ return this._make(T, t);
869
1112
  }
870
1113
  get checkRegex() {
871
- const t = m + R;
1114
+ const t = O + H;
872
1115
  if (this[t]) return this[t];
873
- return this._make(R, t);
1116
+ return this._make(H, t);
874
1117
  }
875
1118
  _make(t, e) {
876
- const n = this.regexPrefix.replace(_, E[t]);
1119
+ const n = pinWildcards(t === T ? this.regexPrefix.replace(v, replaceTrailingWildcard).replace(L, replaceTrailingDoublestar) : checkSourceOf(this.body, this.regexPrefix));
877
1120
  const r = this.ignoreCase ? new RegExp(n, "i") : new RegExp(n);
878
1121
  return define(this, e, r);
879
1122
  }
880
1123
  }
1124
+ const isLineEnd = (t)=>"\r" === t || "\n" === t;
1125
+ const trimEnd = (t)=>{
1126
+ let e = t.length;
1127
+ while(e && isLineEnd(t[e - 1]))e--;
1128
+ const n = e;
1129
+ while(e && t[e - 1] === r)e--;
1130
+ if (e === n) return t.slice(0, e);
1131
+ let o = 0;
1132
+ while(o < e && t[e - o - 1] === s)o++;
1133
+ return o % 2 ? t.slice(0, e - 1) + r : t.slice(0, e);
1134
+ };
881
1135
  const createRule = ({ pattern: t, mark: e }, n)=>{
882
- let r = false;
883
- let s = t;
884
- if (0 === s.indexOf("!")) {
885
- r = true;
886
- s = s.substr(1);
1136
+ let s = t[0] === i ? t.slice(1) : t;
1137
+ if ("#" === s[0]) return;
1138
+ let o = false;
1139
+ if ("!" === s[0]) {
1140
+ o = true;
1141
+ s = s.slice(1);
887
1142
  }
888
- s = s.replace(u, "!").replace(a, "#");
889
- const o = makeRegexPrefix(s);
890
- return new IgnoreRule(t, e, s, n, r, o);
1143
+ const u = s[s.length - 1];
1144
+ if (u === r || "\r" === u || "\n" === u) s = trimEnd(s);
1145
+ if (!s) return;
1146
+ s = s.replace(a, "!").replace(c, "#");
1147
+ const l = makeRegexPrefix(s);
1148
+ return new IgnoreRule(t, e, s, n, o, l);
891
1149
  };
892
1150
  class RuleManager {
893
1151
  constructor(t){
894
1152
  this._ignoreCase = t;
895
1153
  this._rules = [];
1154
+ this._basenameCount = 0;
896
1155
  }
897
1156
  _add(t) {
898
- if (t && t[h]) {
1157
+ if (t && t[y]) {
899
1158
  this._rules = this._rules.concat(t._rules._rules);
1159
+ this._basenameCount += t._rules._basenameCount;
900
1160
  this._added = true;
901
1161
  return;
902
1162
  }
903
1163
  if (isString(t)) t = {
904
1164
  pattern: t
905
1165
  };
906
- if (checkPattern(t.pattern)) {
907
- const e = createRule(t, this._ignoreCase);
1166
+ const e = checkPattern(t.pattern) && createRule(t, this._ignoreCase);
1167
+ if (e) {
908
1168
  this._added = true;
909
1169
  this._rules.push(e);
1170
+ if (matchesBasename(e.body)) this._basenameCount++;
910
1171
  }
911
1172
  }
912
1173
  add(t) {
913
1174
  this._added = false;
914
1175
  makeArray(isString(t) ? splitPattern(t) : t).forEach(this._add, this);
1176
+ if (this._added) this._literalRules = e;
915
1177
  return this._added;
916
1178
  }
1179
+ testLiteral(t) {
1180
+ const n = this._literalRules || (this._literalRules = this._rules.filter(({ body: t })=>"*" === t[t.length - (t[t.length - 1] === h ? 2 : 1)]));
1181
+ let r = false;
1182
+ let s = false;
1183
+ let o;
1184
+ for(let i = n.length - 1; i >= 0; i--){
1185
+ const u = n[i];
1186
+ if (u.checkRegex.test(t)) {
1187
+ r = !u.negative;
1188
+ s = u.negative;
1189
+ o = u.negative ? e : u;
1190
+ break;
1191
+ }
1192
+ }
1193
+ const i = {
1194
+ ignored: r,
1195
+ unignored: s
1196
+ };
1197
+ if (o) i.rule = o;
1198
+ return i;
1199
+ }
917
1200
  test(t, n, r) {
918
1201
  let s = false;
919
1202
  let o = false;
920
1203
  let i;
921
- this._rules.forEach((u)=>{
922
- const { negative: a } = u;
923
- if (o === a && s !== o || a && !s && !o && !n) return;
924
- const c = u[r].test(t);
925
- if (!c) return;
926
- s = !a;
927
- o = a;
928
- i = a ? e : u;
929
- });
930
- const u = {
1204
+ const u = this._rules;
1205
+ const { length: a } = u;
1206
+ const c = 2 * this._basenameCount >= a;
1207
+ const l = c ? basenameOf(t) : t;
1208
+ for(let f = 0; f < a; f++){
1209
+ const a = u[f];
1210
+ const { negative: p } = a;
1211
+ const d = o === p && s !== o || p && !s && !o && !n;
1212
+ if (!d && a[r].test(c && a._basenameOnly ? l : t)) {
1213
+ s = !p;
1214
+ o = p;
1215
+ i = p ? e : a;
1216
+ }
1217
+ }
1218
+ const f = {
931
1219
  ignored: s,
932
1220
  unignored: o
933
1221
  };
934
- if (i) u.rule = i;
935
- return u;
1222
+ if (i) f.rule = i;
1223
+ return f;
936
1224
  }
937
1225
  }
938
1226
  const throwError = (t, e)=>{
@@ -947,12 +1235,21 @@
947
1235
  }
948
1236
  return true;
949
1237
  };
950
- const isNotRelative = (t)=>l.test(t);
1238
+ const isNotRelative = (t)=>{
1239
+ const e = t.charCodeAt(0);
1240
+ if (e === p) return true;
1241
+ if (e !== d) return false;
1242
+ if (1 === t.length) return true;
1243
+ const n = t.charCodeAt(1);
1244
+ if (n === p) return true;
1245
+ if (n !== d) return false;
1246
+ return 2 === t.length || t.charCodeAt(2) === p;
1247
+ };
951
1248
  checkPath.isNotRelative = isNotRelative;
952
1249
  checkPath.convert = (t)=>t;
953
1250
  class Ignore {
954
1251
  constructor({ ignorecase: t = true, ignoreCase: e = t, allowRelativePaths: n = false } = {}){
955
- define(this, h, true);
1252
+ define(this, y, true);
956
1253
  this._rules = new RuleManager(e);
957
1254
  this._strictPathCheck = !n;
958
1255
  this._initCache();
@@ -968,28 +1265,23 @@
968
1265
  addPattern(t) {
969
1266
  return this.add(t);
970
1267
  }
971
- _test(t, e, n, r) {
972
- const s = t && checkPath.convert(t);
973
- checkPath(s, t, this._strictPathCheck ? throwError : RETURN_FALSE);
974
- return this._t(s, e, n, r);
1268
+ _test(t, e, n) {
1269
+ const r = t && checkPath.convert(t);
1270
+ checkPath(r, t, this._strictPathCheck ? throwError : RETURN_FALSE);
1271
+ return this._t(r, e, n);
975
1272
  }
976
1273
  checkIgnore(t) {
977
- if (!f.test(t)) return this.test(t);
978
- const e = t.split(p).filter(Boolean);
979
- e.pop();
980
- if (e.length) {
981
- const t = this._t(e.join(p) + p, this._testCache, true, e);
982
- if (t.ignored) return t;
983
- }
984
- return this._rules.test(t, false, R);
1274
+ if (t.charCodeAt(t.length - 1) !== p) return this.test(t);
1275
+ const e = this._t(t, this._testCache, true);
1276
+ if (e.ignored) return e;
1277
+ const n = this._rules.testLiteral(t);
1278
+ return n.ignored || n.unignored ? n : e;
985
1279
  }
986
- _t(t, e, n, r) {
987
- if (t in e) return e[t];
988
- if (!r) r = t.split(p).filter(Boolean);
989
- r.pop();
990
- if (!r.length) return e[t] = this._rules.test(t, n, A);
991
- const s = this._t(r.join(p) + p, e, n, r);
992
- return e[t] = s.ignored ? s : this._rules.test(t, n, A);
1280
+ _t(t, n, r) {
1281
+ if (t in n) return n[t];
1282
+ const s = parentOf(t);
1283
+ const o = s ? this._t(s, n, r) : e;
1284
+ return n[t] = o && o.ignored ? o : this._rules.test(t, r, T);
993
1285
  }
994
1286
  ignores(t) {
995
1287
  return this._test(t, this._ignoreCache, false).ignored;
@@ -1563,11 +1855,11 @@
1563
1855
  const g = s.isWindows(e);
1564
1856
  const y = r.globChars(g);
1565
1857
  const _ = r.extglobChars(y);
1566
- const { DOT_LITERAL: A, PLUS_LITERAL: R, SLASH_LITERAL: m, ONE_CHAR: E, DOTS_SLASH: b, NO_DOT: w, NO_DOT_SLASH: x, NO_DOTS_SLASH: C, QMARK: S, QMARK_NO_DOT: v, STAR: $, START_ANCHOR: T } = y;
1858
+ const { DOT_LITERAL: A, PLUS_LITERAL: R, SLASH_LITERAL: m, ONE_CHAR: E, DOTS_SLASH: b, NO_DOT: w, NO_DOT_SLASH: x, NO_DOTS_SLASH: C, QMARK: S, QMARK_NO_DOT: $, STAR: v, START_ANCHOR: T } = y;
1567
1859
  const globstar = (t)=>`(${h}(?:(?!${T}${t.dot ? b : A}).)*?)`;
1568
1860
  const H = n.dot ? "" : w;
1569
- const O = n.dot ? S : v;
1570
- let L = true === n.bash ? globstar(n) : $;
1861
+ const O = n.dot ? S : $;
1862
+ let L = true === n.bash ? globstar(n) : v;
1571
1863
  if (n.capture) L = `(${L})`;
1572
1864
  if ("boolean" == typeof n.noext) n.noextglob = n.noext;
1573
1865
  const P = {
@@ -2037,7 +2329,7 @@
2037
2329
  push({
2038
2330
  type: "qmark",
2039
2331
  value: B,
2040
- output: v
2332
+ output: $
2041
2333
  });
2042
2334
  continue;
2043
2335
  }
@@ -2497,8 +2789,8 @@
2497
2789
  let x = t;
2498
2790
  let C = -1;
2499
2791
  let S = 0;
2500
- let v = 0;
2501
- let $ = false;
2792
+ let $ = 0;
2793
+ let v = false;
2502
2794
  let T = false;
2503
2795
  let H = false;
2504
2796
  let O = false;
@@ -2544,14 +2836,14 @@
2544
2836
  continue;
2545
2837
  }
2546
2838
  if (true !== P && F === a && (F = advance()) === a) {
2547
- $ = G.isBrace = true;
2839
+ v = G.isBrace = true;
2548
2840
  H = G.isGlob = true;
2549
2841
  M = true;
2550
2842
  if (true === m) continue;
2551
2843
  break;
2552
2844
  }
2553
2845
  if (true !== P && F === u) {
2554
- $ = G.isBrace = true;
2846
+ v = G.isBrace = true;
2555
2847
  H = G.isGlob = true;
2556
2848
  M = true;
2557
2849
  if (true === m) continue;
@@ -2561,7 +2853,7 @@
2561
2853
  B--;
2562
2854
  if (0 === B) {
2563
2855
  P = false;
2564
- $ = G.isBrace = true;
2856
+ v = G.isBrace = true;
2565
2857
  M = true;
2566
2858
  break;
2567
2859
  }
@@ -2583,7 +2875,7 @@
2583
2875
  S += 2;
2584
2876
  continue;
2585
2877
  }
2586
- v = C + 1;
2878
+ $ = C + 1;
2587
2879
  continue;
2588
2880
  }
2589
2881
  if (true !== n.noext) {
@@ -2680,11 +2972,11 @@
2680
2972
  if (S > 0) {
2681
2973
  W = x.slice(0, S);
2682
2974
  x = x.slice(S);
2683
- v -= S;
2975
+ $ -= S;
2684
2976
  }
2685
- if (U && true === H && v > 0) {
2686
- U = x.slice(0, v);
2687
- j = x.slice(v);
2977
+ if (U && true === H && $ > 0) {
2978
+ U = x.slice(0, $);
2979
+ j = x.slice($);
2688
2980
  } else if (true === H) {
2689
2981
  U = "";
2690
2982
  j = x;
@@ -2702,7 +2994,7 @@
2702
2994
  start: S,
2703
2995
  base: U,
2704
2996
  glob: j,
2705
- isBrace: $,
2997
+ isBrace: v,
2706
2998
  isBracket: T,
2707
2999
  isGlob: H,
2708
3000
  isExtglob: O,
@@ -3042,9 +3334,9 @@
3042
3334
  convertPathToPattern: ()=>P,
3043
3335
  generateGlobTasks: ()=>O,
3044
3336
  generateGlobTasksSync: ()=>L,
3045
- globby: ()=>v,
3337
+ globby: ()=>$,
3046
3338
  globbyStream: ()=>T,
3047
- globbySync: ()=>$,
3339
+ globbySync: ()=>v,
3048
3340
  isDynamicPattern: ()=>H,
3049
3341
  isGitIgnored: ()=>isGitIgnored,
3050
3342
  isGitIgnoredSync: ()=>isGitIgnoredSync,
@@ -3242,7 +3534,7 @@
3242
3534
  }
3243
3535
  const g = require("node:fs/promises");
3244
3536
  const y = require("node:os");
3245
- var _ = __nccwpck_require__(869);
3537
+ var _ = __nccwpck_require__(425);
3246
3538
  function isPathInside(t, e) {
3247
3539
  const n = r.relative(e, t);
3248
3540
  return Boolean(n && ".." !== n && !n.startsWith(`..${r.sep}`) && n !== r.resolve(t));
@@ -4545,14 +4837,14 @@
4545
4837
  });
4546
4838
  return appendPruneIgnorePatterns(a, n);
4547
4839
  };
4548
- const v = normalizeArguments(async (t, e)=>{
4840
+ const $ = normalizeArguments(async (t, e)=>{
4549
4841
  assertGlobalGitignoreAsyncSupport(e);
4550
4842
  const { options: n, pruneIgnorePatterns: r, filter: s } = await applyIgnoreFilesAndGetFilter(e);
4551
4843
  const o = await generateTasks(t, n, r);
4552
4844
  const i = await Promise.all(o.map((t)=>c(t.patterns, t.options)));
4553
4845
  return unionFastGlobResultsAsync(i, s);
4554
4846
  });
4555
- const $ = normalizeArgumentsSync((t, e)=>{
4847
+ const v = normalizeArgumentsSync((t, e)=>{
4556
4848
  assertGlobalGitignoreSyncSupport(e);
4557
4849
  const { options: n, pruneIgnorePatterns: r, filter: s } = applyIgnoreFilesAndGetFilterSync(e);
4558
4850
  const o = generateTasksSync(t, n, r);