@opendesign-plus-test/plugins 0.0.1-rc.10 → 0.0.1-rc.12
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/{generate-lastmod-changefreq-CYV0c6WF.js → generate-lastmod-changefreq-Wk3kOITw.js} +534 -531
- package/dist/index.js +11 -12
- package/dist/nuxt/sitemap/index.js +70 -0
- package/dist/nuxt/sitemap.d.ts +2 -0
- package/package.json +5 -1
- package/dist/__vite-browser-external-BDMct_Gn.js +0 -4
- package/dist/nuxt/generate-sitemap.d.ts +0 -2
- package/dist/nuxt/index.d.ts +0 -1
- package/dist/nuxt/index.js +0 -64
package/dist/{generate-lastmod-changefreq-CYV0c6WF.js → generate-lastmod-changefreq-Wk3kOITw.js}
RENAMED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ut = Object.defineProperty;
|
|
2
|
+
var yt = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var o = (i, t, e) => (
|
|
8
|
-
var
|
|
5
|
+
var Zt = (i, t, e) => t in i ? Ut(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
6
|
+
var T = (i, t, e) => Zt(i, typeof t != "symbol" ? t + "" : t, e), ct = (i, t, e) => t.has(i) || yt("Cannot " + e);
|
|
7
|
+
var o = (i, t, e) => (ct(i, t, "read from private field"), e ? e.call(i) : t.get(i)), R = (i, t, e) => t.has(i) ? yt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), S = (i, t, e, s) => (ct(i, t, "write to private field"), s ? s.call(i, e) : t.set(i, e), e), x = (i, t, e) => (ct(i, t, "access private method"), e);
|
|
8
|
+
var lt = (i, t, e, s) => ({
|
|
9
9
|
set _(n) {
|
|
10
|
-
|
|
10
|
+
S(i, t, n, e);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
13
|
return o(i, t, s);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import Ht, { resolve as Jt } from "node:path";
|
|
17
|
+
import { exec as Vt } from "node:child_process";
|
|
18
|
+
import { writeFileSync as Xt } from "node:fs";
|
|
19
|
+
import { promisify as Qt } from "node:util";
|
|
20
|
+
const Ot = (i, t, e) => {
|
|
21
|
+
const s = i instanceof RegExp ? wt(i, e) : i, n = t instanceof RegExp ? wt(t, e) : t, r = s !== null && n != null && Kt(s, n, e);
|
|
18
22
|
return r && {
|
|
19
23
|
start: r[0],
|
|
20
24
|
end: r[1],
|
|
@@ -22,124 +26,124 @@ const vt = (i, t, e) => {
|
|
|
22
26
|
body: e.slice(r[0] + s.length, r[1]),
|
|
23
27
|
post: e.slice(r[1] + n.length)
|
|
24
28
|
};
|
|
25
|
-
},
|
|
29
|
+
}, wt = (i, t) => {
|
|
26
30
|
const e = t.match(i);
|
|
27
31
|
return e ? e[0] : null;
|
|
28
|
-
},
|
|
29
|
-
let s, n, r, c,
|
|
30
|
-
if (p >= 0 &&
|
|
32
|
+
}, Kt = (i, t, e) => {
|
|
33
|
+
let s, n, r, c, a, p = e.indexOf(i), h = e.indexOf(t, p + 1), f = p;
|
|
34
|
+
if (p >= 0 && h > 0) {
|
|
31
35
|
if (i === t)
|
|
32
|
-
return [p,
|
|
33
|
-
for (s = [], r = e.length;
|
|
34
|
-
if (
|
|
35
|
-
s.push(
|
|
36
|
+
return [p, h];
|
|
37
|
+
for (s = [], r = e.length; f >= 0 && !a; ) {
|
|
38
|
+
if (f === p)
|
|
39
|
+
s.push(f), p = e.indexOf(i, f + 1);
|
|
36
40
|
else if (s.length === 1) {
|
|
37
41
|
const l = s.pop();
|
|
38
|
-
l !== void 0 && (
|
|
42
|
+
l !== void 0 && (a = [l, h]);
|
|
39
43
|
} else
|
|
40
|
-
n = s.pop(), n !== void 0 && n < r && (r = n, c =
|
|
41
|
-
|
|
44
|
+
n = s.pop(), n !== void 0 && n < r && (r = n, c = h), h = e.indexOf(t, f + 1);
|
|
45
|
+
f = p < h && p >= 0 ? p : h;
|
|
42
46
|
}
|
|
43
|
-
s.length && c !== void 0 && (
|
|
47
|
+
s.length && c !== void 0 && (a = [r, c]);
|
|
44
48
|
}
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
function
|
|
49
|
+
return a;
|
|
50
|
+
}, Tt = "\0SLASH" + Math.random() + "\0", vt = "\0OPEN" + Math.random() + "\0", dt = "\0CLOSE" + Math.random() + "\0", Rt = "\0COMMA" + Math.random() + "\0", Pt = "\0PERIOD" + Math.random() + "\0", Yt = new RegExp(Tt, "g"), te = new RegExp(vt, "g"), ee = new RegExp(dt, "g"), se = new RegExp(Rt, "g"), ne = new RegExp(Pt, "g"), ie = /\\\\/g, re = /\\{/g, oe = /\\}/g, ce = /\\,/g, le = /\\\./g, he = 1e5;
|
|
51
|
+
function ht(i) {
|
|
48
52
|
return isNaN(i) ? i.charCodeAt(0) : parseInt(i, 10);
|
|
49
53
|
}
|
|
50
|
-
function
|
|
51
|
-
return i.replace(
|
|
54
|
+
function ae(i) {
|
|
55
|
+
return i.replace(ie, Tt).replace(re, vt).replace(oe, dt).replace(ce, Rt).replace(le, Pt);
|
|
52
56
|
}
|
|
53
|
-
function
|
|
54
|
-
return i.replace(
|
|
57
|
+
function fe(i) {
|
|
58
|
+
return i.replace(Yt, "\\").replace(te, "{").replace(ee, "}").replace(se, ",").replace(ne, ".");
|
|
55
59
|
}
|
|
56
|
-
function
|
|
60
|
+
function jt(i) {
|
|
57
61
|
if (!i)
|
|
58
62
|
return [""];
|
|
59
|
-
const t = [], e =
|
|
63
|
+
const t = [], e = Ot("{", "}", i);
|
|
60
64
|
if (!e)
|
|
61
65
|
return i.split(",");
|
|
62
66
|
const { pre: s, body: n, post: r } = e, c = s.split(",");
|
|
63
67
|
c[c.length - 1] += "{" + n + "}";
|
|
64
|
-
const
|
|
65
|
-
return r.length && (c[c.length - 1] +=
|
|
68
|
+
const a = jt(r);
|
|
69
|
+
return r.length && (c[c.length - 1] += a.shift(), c.push.apply(c, a)), t.push.apply(t, c), t;
|
|
66
70
|
}
|
|
67
|
-
function
|
|
71
|
+
function ue(i, t = {}) {
|
|
68
72
|
if (!i)
|
|
69
73
|
return [];
|
|
70
|
-
const { max: e =
|
|
71
|
-
return i.slice(0, 2) === "{}" && (i = "\\{\\}" + i.slice(2)),
|
|
74
|
+
const { max: e = he } = t;
|
|
75
|
+
return i.slice(0, 2) === "{}" && (i = "\\{\\}" + i.slice(2)), K(ae(i), e, !0).map(fe);
|
|
72
76
|
}
|
|
73
|
-
function
|
|
77
|
+
function pe(i) {
|
|
74
78
|
return "{" + i + "}";
|
|
75
79
|
}
|
|
76
|
-
function
|
|
80
|
+
function ge(i) {
|
|
77
81
|
return /^-?0\d/.test(i);
|
|
78
82
|
}
|
|
79
|
-
function
|
|
83
|
+
function de(i, t) {
|
|
80
84
|
return i <= t;
|
|
81
85
|
}
|
|
82
|
-
function
|
|
86
|
+
function me(i, t) {
|
|
83
87
|
return i >= t;
|
|
84
88
|
}
|
|
85
|
-
function
|
|
86
|
-
const s = [], n =
|
|
89
|
+
function K(i, t, e) {
|
|
90
|
+
const s = [], n = Ot("{", "}", i);
|
|
87
91
|
if (!n)
|
|
88
92
|
return [i];
|
|
89
|
-
const r = n.pre, c = n.post.length ?
|
|
93
|
+
const r = n.pre, c = n.post.length ? K(n.post, t, !1) : [""];
|
|
90
94
|
if (/\$$/.test(n.pre))
|
|
91
|
-
for (let
|
|
92
|
-
const p = r + "{" + n.body + "}" + c[
|
|
95
|
+
for (let a = 0; a < c.length && a < t; a++) {
|
|
96
|
+
const p = r + "{" + n.body + "}" + c[a];
|
|
93
97
|
s.push(p);
|
|
94
98
|
}
|
|
95
99
|
else {
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
return n.post.match(/,(?!,).*\}/) ? (i = n.pre + "{" + n.body +
|
|
100
|
+
const a = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body), p = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body), h = a || p, f = n.body.indexOf(",") >= 0;
|
|
101
|
+
if (!h && !f)
|
|
102
|
+
return n.post.match(/,(?!,).*\}/) ? (i = n.pre + "{" + n.body + dt + n.post, K(i, t, !0)) : [i];
|
|
99
103
|
let l;
|
|
100
|
-
if (
|
|
104
|
+
if (h)
|
|
101
105
|
l = n.body.split(/\.\./);
|
|
102
|
-
else if (l =
|
|
106
|
+
else if (l = jt(n.body), l.length === 1 && l[0] !== void 0 && (l = K(l[0], t, !1).map(pe), l.length === 1))
|
|
103
107
|
return c.map((g) => n.pre + l[0] + g);
|
|
104
108
|
let u;
|
|
105
|
-
if (
|
|
106
|
-
const g =
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
const
|
|
109
|
+
if (h && l[0] !== void 0 && l[1] !== void 0) {
|
|
110
|
+
const g = ht(l[0]), y = ht(l[1]), E = Math.max(l[0].length, l[1].length);
|
|
111
|
+
let w = l.length === 3 && l[2] !== void 0 ? Math.max(Math.abs(ht(l[2])), 1) : 1, b = de;
|
|
112
|
+
y < g && (w *= -1, b = me);
|
|
113
|
+
const d = l.some(ge);
|
|
110
114
|
u = [];
|
|
111
|
-
for (let
|
|
112
|
-
let
|
|
115
|
+
for (let $ = g; b($, y); $ += w) {
|
|
116
|
+
let N;
|
|
113
117
|
if (p)
|
|
114
|
-
|
|
115
|
-
else if (
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
|
|
118
|
+
N = String.fromCharCode($), N === "\\" && (N = "");
|
|
119
|
+
else if (N = String($), d) {
|
|
120
|
+
const H = E - N.length;
|
|
121
|
+
if (H > 0) {
|
|
122
|
+
const X = new Array(H + 1).join("0");
|
|
123
|
+
$ < 0 ? N = "-" + X + N.slice(1) : N = X + N;
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
|
-
u.push(
|
|
126
|
+
u.push(N);
|
|
123
127
|
}
|
|
124
128
|
} else {
|
|
125
129
|
u = [];
|
|
126
130
|
for (let g = 0; g < l.length; g++)
|
|
127
|
-
u.push.apply(u,
|
|
131
|
+
u.push.apply(u, K(l[g], t, !1));
|
|
128
132
|
}
|
|
129
133
|
for (let g = 0; g < u.length; g++)
|
|
130
|
-
for (let
|
|
131
|
-
const
|
|
132
|
-
(!e ||
|
|
134
|
+
for (let y = 0; y < c.length && s.length < t; y++) {
|
|
135
|
+
const E = r + u[g] + c[y];
|
|
136
|
+
(!e || h || E) && s.push(E);
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
return s;
|
|
136
140
|
}
|
|
137
|
-
const
|
|
141
|
+
const ye = 1024 * 64, it = (i) => {
|
|
138
142
|
if (typeof i != "string")
|
|
139
143
|
throw new TypeError("invalid pattern");
|
|
140
|
-
if (i.length >
|
|
144
|
+
if (i.length > ye)
|
|
141
145
|
throw new TypeError("pattern is too long");
|
|
142
|
-
},
|
|
146
|
+
}, we = {
|
|
143
147
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
|
|
144
148
|
"[:alpha:]": ["\\p{L}\\p{Nl}", !0],
|
|
145
149
|
"[:ascii:]": ["\\x00-\\x7f", !1],
|
|
@@ -154,78 +158,78 @@ const ge = 1024 * 64, ot = (i) => {
|
|
|
154
158
|
"[:upper:]": ["\\p{Lu}", !0],
|
|
155
159
|
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
|
|
156
160
|
"[:xdigit:]": ["A-Fa-f0-9", !1]
|
|
157
|
-
},
|
|
161
|
+
}, Q = (i) => i.replace(/[[\]\\-]/g, "\\$&"), Se = (i) => i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), St = (i) => i.join(""), Ee = (i, t) => {
|
|
158
162
|
const e = t;
|
|
159
163
|
if (i.charAt(e) !== "[")
|
|
160
164
|
throw new Error("not in a brace expression");
|
|
161
165
|
const s = [], n = [];
|
|
162
|
-
let r = e + 1, c = !1,
|
|
166
|
+
let r = e + 1, c = !1, a = !1, p = !1, h = !1, f = e, l = "";
|
|
163
167
|
t: for (; r < i.length; ) {
|
|
164
|
-
const
|
|
165
|
-
if ((
|
|
166
|
-
|
|
168
|
+
const E = i.charAt(r);
|
|
169
|
+
if ((E === "!" || E === "^") && r === e + 1) {
|
|
170
|
+
h = !0, r++;
|
|
167
171
|
continue;
|
|
168
172
|
}
|
|
169
|
-
if (
|
|
170
|
-
|
|
173
|
+
if (E === "]" && c && !p) {
|
|
174
|
+
f = r + 1;
|
|
171
175
|
break;
|
|
172
176
|
}
|
|
173
|
-
if (c = !0,
|
|
177
|
+
if (c = !0, E === "\\" && !p) {
|
|
174
178
|
p = !0, r++;
|
|
175
179
|
continue;
|
|
176
180
|
}
|
|
177
|
-
if (
|
|
178
|
-
for (const [
|
|
179
|
-
if (i.startsWith(
|
|
181
|
+
if (E === "[" && !p) {
|
|
182
|
+
for (const [w, [b, A, d]] of Object.entries(we))
|
|
183
|
+
if (i.startsWith(w, r)) {
|
|
180
184
|
if (l)
|
|
181
185
|
return ["$.", !1, i.length - e, !0];
|
|
182
|
-
r +=
|
|
186
|
+
r += w.length, d ? n.push(b) : s.push(b), a = a || A;
|
|
183
187
|
continue t;
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
190
|
if (p = !1, l) {
|
|
187
|
-
|
|
191
|
+
E > l ? s.push(Q(l) + "-" + Q(E)) : E === l && s.push(Q(E)), l = "", r++;
|
|
188
192
|
continue;
|
|
189
193
|
}
|
|
190
194
|
if (i.startsWith("-]", r + 1)) {
|
|
191
|
-
s.push(
|
|
195
|
+
s.push(Q(E + "-")), r += 2;
|
|
192
196
|
continue;
|
|
193
197
|
}
|
|
194
198
|
if (i.startsWith("-", r + 1)) {
|
|
195
|
-
l =
|
|
199
|
+
l = E, r += 2;
|
|
196
200
|
continue;
|
|
197
201
|
}
|
|
198
|
-
s.push(
|
|
202
|
+
s.push(Q(E)), r++;
|
|
199
203
|
}
|
|
200
|
-
if (
|
|
204
|
+
if (f < r)
|
|
201
205
|
return ["", !1, 0, !1];
|
|
202
206
|
if (!s.length && !n.length)
|
|
203
207
|
return ["$.", !1, i.length - e, !0];
|
|
204
|
-
if (n.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !
|
|
205
|
-
const
|
|
206
|
-
return [
|
|
208
|
+
if (n.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !h) {
|
|
209
|
+
const E = s[0].length === 2 ? s[0].slice(-1) : s[0];
|
|
210
|
+
return [Se(E), !1, f - e, !1];
|
|
207
211
|
}
|
|
208
|
-
const u = "[" + (
|
|
209
|
-
return [s.length && n.length ? "(" + u + "|" + g + ")" : s.length ? u : g,
|
|
210
|
-
},
|
|
211
|
-
var
|
|
212
|
-
const
|
|
212
|
+
const u = "[" + (h ? "^" : "") + St(s) + "]", g = "[" + (h ? "" : "^") + St(n) + "]";
|
|
213
|
+
return [s.length && n.length ? "(" + u + "|" + g + ")" : s.length ? u : g, a, f - e, !0];
|
|
214
|
+
}, Y = (i, { windowsPathsNoEscape: t = !1, magicalBraces: e = !0 } = {}) => e ? t ? i.replace(/\[([^/\\])\]/g, "$1") : i.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1") : t ? i.replace(/\[([^/\\{}])\]/g, "$1") : i.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
215
|
+
var W;
|
|
216
|
+
const be = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), at = (i) => be.has(i), Et = (i) => at(i.type), xe = /* @__PURE__ */ new Map([
|
|
213
217
|
["!", ["@"]],
|
|
214
218
|
["?", ["?", "@"]],
|
|
215
219
|
["@", ["@"]],
|
|
216
220
|
["*", ["*", "+", "?", "@"]],
|
|
217
221
|
["+", ["+", "@"]]
|
|
218
|
-
]),
|
|
222
|
+
]), Me = /* @__PURE__ */ new Map([
|
|
219
223
|
["!", ["?"]],
|
|
220
224
|
["@", ["?"]],
|
|
221
225
|
["+", ["?", "*"]]
|
|
222
|
-
]),
|
|
226
|
+
]), Ne = /* @__PURE__ */ new Map([
|
|
223
227
|
["!", ["?", "@"]],
|
|
224
228
|
["?", ["?", "@"]],
|
|
225
229
|
["@", ["?", "@"]],
|
|
226
230
|
["*", ["*", "+", "?", "@"]],
|
|
227
231
|
["+", ["+", "@", "?", "*"]]
|
|
228
|
-
]),
|
|
232
|
+
]), bt = /* @__PURE__ */ new Map([
|
|
229
233
|
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
230
234
|
[
|
|
231
235
|
"?",
|
|
@@ -251,32 +255,32 @@ const we = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), ut = (i) => we.ha
|
|
|
251
255
|
["*", "*"]
|
|
252
256
|
])
|
|
253
257
|
]
|
|
254
|
-
]),
|
|
255
|
-
let
|
|
256
|
-
var
|
|
257
|
-
class
|
|
258
|
+
]), Ae = "(?!(?:^|/)\\.\\.?(?:$|/))", tt = "(?!\\.)", $e = /* @__PURE__ */ new Set(["[", "."]), Oe = /* @__PURE__ */ new Set(["..", "."]), Te = new Set("().*{}+?[]^$\\!"), ve = (i) => i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), mt = "[^/]", xt = mt + "*?", Mt = mt + "+?";
|
|
259
|
+
let Re = 0;
|
|
260
|
+
var v, P, z, m, O, G, U, F, _, q, V, M, Ct, I, et, Wt, ft, st, Dt, ut, Lt, kt, _t, nt, pt, qt;
|
|
261
|
+
class rt {
|
|
258
262
|
constructor(t, e, s = {}) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
263
|
+
R(this, M);
|
|
264
|
+
T(this, "type");
|
|
265
|
+
R(this, v);
|
|
266
|
+
R(this, P);
|
|
267
|
+
R(this, z, !1);
|
|
268
|
+
R(this, m, []);
|
|
269
|
+
R(this, O);
|
|
270
|
+
R(this, G);
|
|
271
|
+
R(this, U);
|
|
272
|
+
R(this, F, !1);
|
|
273
|
+
R(this, _);
|
|
274
|
+
R(this, q);
|
|
271
275
|
// set to true if it's an extglob with no children
|
|
272
276
|
// (which really means one child of '')
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
this.type = t, t &&
|
|
277
|
+
R(this, V, !1);
|
|
278
|
+
T(this, "id", ++Re);
|
|
279
|
+
this.type = t, t && S(this, P, !0), S(this, O, e), S(this, v, o(this, O) ? o(o(this, O), v) : this), S(this, _, o(this, v) === this ? s : o(o(this, v), _)), S(this, U, o(this, v) === this ? [] : o(o(this, v), U)), t === "!" && !o(o(this, v), F) && o(this, U).push(this), S(this, G, o(this, O) ? o(o(this, O), m).length : 0);
|
|
276
280
|
}
|
|
277
281
|
get depth() {
|
|
278
282
|
var t;
|
|
279
|
-
return (((t = o(this,
|
|
283
|
+
return (((t = o(this, O)) == null ? void 0 : t.depth) ?? -1) + 1;
|
|
280
284
|
}
|
|
281
285
|
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
282
286
|
var t;
|
|
@@ -284,95 +288,95 @@ class ct {
|
|
|
284
288
|
"@@type": "AST",
|
|
285
289
|
id: this.id,
|
|
286
290
|
type: this.type,
|
|
287
|
-
root: o(this,
|
|
288
|
-
parent: (t = o(this,
|
|
291
|
+
root: o(this, v).id,
|
|
292
|
+
parent: (t = o(this, O)) == null ? void 0 : t.id,
|
|
289
293
|
depth: this.depth,
|
|
290
|
-
partsLength: o(this,
|
|
291
|
-
parts: o(this,
|
|
294
|
+
partsLength: o(this, m).length,
|
|
295
|
+
parts: o(this, m)
|
|
292
296
|
};
|
|
293
297
|
}
|
|
294
298
|
get hasMagic() {
|
|
295
|
-
if (o(this,
|
|
296
|
-
return o(this,
|
|
297
|
-
for (const t of o(this,
|
|
299
|
+
if (o(this, P) !== void 0)
|
|
300
|
+
return o(this, P);
|
|
301
|
+
for (const t of o(this, m))
|
|
298
302
|
if (typeof t != "string" && (t.type || t.hasMagic))
|
|
299
|
-
return
|
|
300
|
-
return o(this,
|
|
303
|
+
return S(this, P, !0);
|
|
304
|
+
return o(this, P);
|
|
301
305
|
}
|
|
302
306
|
// reconstructs the pattern
|
|
303
307
|
toString() {
|
|
304
|
-
return o(this,
|
|
308
|
+
return o(this, q) !== void 0 ? o(this, q) : this.type ? S(this, q, this.type + "(" + o(this, m).map((t) => String(t)).join("|") + ")") : S(this, q, o(this, m).map((t) => String(t)).join(""));
|
|
305
309
|
}
|
|
306
310
|
push(...t) {
|
|
307
311
|
for (const e of t)
|
|
308
312
|
if (e !== "") {
|
|
309
|
-
if (typeof e != "string" && !(e instanceof
|
|
313
|
+
if (typeof e != "string" && !(e instanceof W && o(e, O) === this))
|
|
310
314
|
throw new Error("invalid part: " + e);
|
|
311
|
-
o(this,
|
|
315
|
+
o(this, m).push(e);
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
318
|
toJSON() {
|
|
315
319
|
var e;
|
|
316
|
-
const t = this.type === null ? o(this,
|
|
317
|
-
return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === o(this,
|
|
320
|
+
const t = this.type === null ? o(this, m).slice().map((s) => typeof s == "string" ? s : s.toJSON()) : [this.type, ...o(this, m).map((s) => s.toJSON())];
|
|
321
|
+
return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === o(this, v) || o(o(this, v), F) && ((e = o(this, O)) == null ? void 0 : e.type) === "!") && t.push({}), t;
|
|
318
322
|
}
|
|
319
323
|
isStart() {
|
|
320
324
|
var e;
|
|
321
|
-
if (o(this,
|
|
325
|
+
if (o(this, v) === this)
|
|
322
326
|
return !0;
|
|
323
|
-
if (!((e = o(this,
|
|
327
|
+
if (!((e = o(this, O)) != null && e.isStart()))
|
|
324
328
|
return !1;
|
|
325
|
-
if (o(this,
|
|
329
|
+
if (o(this, G) === 0)
|
|
326
330
|
return !0;
|
|
327
|
-
const t = o(this,
|
|
328
|
-
for (let s = 0; s < o(this,
|
|
329
|
-
const n = o(t,
|
|
330
|
-
if (!(n instanceof
|
|
331
|
+
const t = o(this, O);
|
|
332
|
+
for (let s = 0; s < o(this, G); s++) {
|
|
333
|
+
const n = o(t, m)[s];
|
|
334
|
+
if (!(n instanceof W && n.type === "!"))
|
|
331
335
|
return !1;
|
|
332
336
|
}
|
|
333
337
|
return !0;
|
|
334
338
|
}
|
|
335
339
|
isEnd() {
|
|
336
340
|
var e, s, n;
|
|
337
|
-
if (o(this,
|
|
341
|
+
if (o(this, v) === this || ((e = o(this, O)) == null ? void 0 : e.type) === "!")
|
|
338
342
|
return !0;
|
|
339
|
-
if (!((s = o(this,
|
|
343
|
+
if (!((s = o(this, O)) != null && s.isEnd()))
|
|
340
344
|
return !1;
|
|
341
345
|
if (!this.type)
|
|
342
|
-
return (n = o(this,
|
|
343
|
-
const t = o(this,
|
|
344
|
-
return o(this,
|
|
346
|
+
return (n = o(this, O)) == null ? void 0 : n.isEnd();
|
|
347
|
+
const t = o(this, O) ? o(o(this, O), m).length : 0;
|
|
348
|
+
return o(this, G) === t - 1;
|
|
345
349
|
}
|
|
346
350
|
copyIn(t) {
|
|
347
351
|
typeof t == "string" ? this.push(t) : this.push(t.clone(this));
|
|
348
352
|
}
|
|
349
353
|
clone(t) {
|
|
350
|
-
const e = new
|
|
351
|
-
for (const s of o(this,
|
|
354
|
+
const e = new W(this.type, t);
|
|
355
|
+
for (const s of o(this, m))
|
|
352
356
|
e.copyIn(s);
|
|
353
357
|
return e;
|
|
354
358
|
}
|
|
355
359
|
static fromGlob(t, e = {}) {
|
|
356
360
|
var n;
|
|
357
|
-
const s = new
|
|
358
|
-
return x(n =
|
|
361
|
+
const s = new W(null, void 0, e);
|
|
362
|
+
return x(n = W, I, et).call(n, t, s, 0, e, 0), s;
|
|
359
363
|
}
|
|
360
364
|
// returns the regular expression if there's magic, or the unescaped
|
|
361
365
|
// string if not.
|
|
362
366
|
toMMPattern() {
|
|
363
|
-
if (this !== o(this,
|
|
364
|
-
return o(this,
|
|
367
|
+
if (this !== o(this, v))
|
|
368
|
+
return o(this, v).toMMPattern();
|
|
365
369
|
const t = this.toString(), [e, s, n, r] = this.toRegExpSource();
|
|
366
|
-
if (!(n || o(this,
|
|
370
|
+
if (!(n || o(this, P) || o(this, _).nocase && !o(this, _).nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase()))
|
|
367
371
|
return s;
|
|
368
|
-
const
|
|
369
|
-
return Object.assign(new RegExp(`^${e}$`,
|
|
372
|
+
const a = (o(this, _).nocase ? "i" : "") + (r ? "u" : "");
|
|
373
|
+
return Object.assign(new RegExp(`^${e}$`, a), {
|
|
370
374
|
_src: e,
|
|
371
375
|
_glob: t
|
|
372
376
|
});
|
|
373
377
|
}
|
|
374
378
|
get options() {
|
|
375
|
-
return o(this,
|
|
379
|
+
return o(this, _);
|
|
376
380
|
}
|
|
377
381
|
// returns the string match, the regexp source, whether there's magic
|
|
378
382
|
// in the regexp (so a regular expression is required) and whether or
|
|
@@ -445,328 +449,328 @@ class ct {
|
|
|
445
449
|
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
446
450
|
toRegExpSource(t) {
|
|
447
451
|
var p;
|
|
448
|
-
const e = t ?? !!o(this,
|
|
449
|
-
if (o(this,
|
|
450
|
-
const
|
|
451
|
-
var
|
|
452
|
-
const [
|
|
453
|
-
return
|
|
452
|
+
const e = t ?? !!o(this, _).dot;
|
|
453
|
+
if (o(this, v) === this && (x(this, M, nt).call(this), x(this, M, Ct).call(this)), !Et(this)) {
|
|
454
|
+
const h = this.isStart() && this.isEnd() && !o(this, m).some((y) => typeof y != "string"), f = o(this, m).map((y) => {
|
|
455
|
+
var d;
|
|
456
|
+
const [E, w, b, A] = typeof y == "string" ? x(d = W, I, qt).call(d, y, o(this, P), h) : y.toRegExpSource(t);
|
|
457
|
+
return S(this, P, o(this, P) || b), S(this, z, o(this, z) || A), E;
|
|
454
458
|
}).join("");
|
|
455
459
|
let l = "";
|
|
456
|
-
if (this.isStart() && typeof o(this,
|
|
457
|
-
const
|
|
460
|
+
if (this.isStart() && typeof o(this, m)[0] == "string" && !(o(this, m).length === 1 && Oe.has(o(this, m)[0]))) {
|
|
461
|
+
const E = $e, w = (
|
|
458
462
|
// dots are allowed, and the pattern starts with [ or .
|
|
459
|
-
e &&
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
),
|
|
463
|
-
l =
|
|
463
|
+
e && E.has(f.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
464
|
+
f.startsWith("\\.") && E.has(f.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
465
|
+
f.startsWith("\\.\\.") && E.has(f.charAt(4))
|
|
466
|
+
), b = !e && !t && E.has(f.charAt(0));
|
|
467
|
+
l = w ? Ae : b ? tt : "";
|
|
464
468
|
}
|
|
465
469
|
let u = "";
|
|
466
|
-
return this.isEnd() && o(o(this,
|
|
467
|
-
l +
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
o(this,
|
|
470
|
+
return this.isEnd() && o(o(this, v), F) && ((p = o(this, O)) == null ? void 0 : p.type) === "!" && (u = "(?:$|\\/)"), [
|
|
471
|
+
l + f + u,
|
|
472
|
+
Y(f),
|
|
473
|
+
S(this, P, !!o(this, P)),
|
|
474
|
+
o(this, z)
|
|
471
475
|
];
|
|
472
476
|
}
|
|
473
477
|
const s = this.type === "*" || this.type === "+", n = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
474
|
-
let r = x(this, M,
|
|
478
|
+
let r = x(this, M, pt).call(this, e);
|
|
475
479
|
if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
|
|
476
|
-
const
|
|
477
|
-
return
|
|
480
|
+
const h = this.toString(), f = this;
|
|
481
|
+
return S(f, m, [h]), f.type = null, S(f, P, void 0), [h, Y(this.toString()), !1, !1];
|
|
478
482
|
}
|
|
479
|
-
let c = !s || t || e || !
|
|
483
|
+
let c = !s || t || e || !tt ? "" : x(this, M, pt).call(this, !0);
|
|
480
484
|
c === r && (c = ""), c && (r = `(?:${r})(?:${c})*?`);
|
|
481
|
-
let
|
|
482
|
-
if (this.type === "!" && o(this,
|
|
483
|
-
|
|
485
|
+
let a = "";
|
|
486
|
+
if (this.type === "!" && o(this, V))
|
|
487
|
+
a = (this.isStart() && !e ? tt : "") + Mt;
|
|
484
488
|
else {
|
|
485
|
-
const
|
|
489
|
+
const h = this.type === "!" ? (
|
|
486
490
|
// !() must match something,but !(x) can match ''
|
|
487
|
-
"))" + (this.isStart() && !e && !t ?
|
|
491
|
+
"))" + (this.isStart() && !e && !t ? tt : "") + xt + ")"
|
|
488
492
|
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && c ? ")" : this.type === "*" && c ? ")?" : `)${this.type}`;
|
|
489
|
-
|
|
493
|
+
a = n + r + h;
|
|
490
494
|
}
|
|
491
495
|
return [
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
o(this,
|
|
496
|
+
a,
|
|
497
|
+
Y(r),
|
|
498
|
+
S(this, P, !!o(this, P)),
|
|
499
|
+
o(this, z)
|
|
496
500
|
];
|
|
497
501
|
}
|
|
498
502
|
}
|
|
499
|
-
|
|
500
|
-
if (this !== o(this,
|
|
503
|
+
v = new WeakMap(), P = new WeakMap(), z = new WeakMap(), m = new WeakMap(), O = new WeakMap(), G = new WeakMap(), U = new WeakMap(), F = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), V = new WeakMap(), M = new WeakSet(), Ct = function() {
|
|
504
|
+
if (this !== o(this, v))
|
|
501
505
|
throw new Error("should only call on root");
|
|
502
|
-
if (o(this,
|
|
506
|
+
if (o(this, F))
|
|
503
507
|
return this;
|
|
504
|
-
this.toString(),
|
|
508
|
+
this.toString(), S(this, F, !0);
|
|
505
509
|
let t;
|
|
506
|
-
for (; t = o(this,
|
|
510
|
+
for (; t = o(this, U).pop(); ) {
|
|
507
511
|
if (t.type !== "!")
|
|
508
512
|
continue;
|
|
509
|
-
let e = t, s = o(e,
|
|
513
|
+
let e = t, s = o(e, O);
|
|
510
514
|
for (; s; ) {
|
|
511
|
-
for (let n = o(e,
|
|
512
|
-
for (const r of o(t,
|
|
515
|
+
for (let n = o(e, G) + 1; !s.type && n < o(s, m).length; n++)
|
|
516
|
+
for (const r of o(t, m)) {
|
|
513
517
|
if (typeof r == "string")
|
|
514
518
|
throw new Error("string part in extglob AST??");
|
|
515
|
-
r.copyIn(o(s,
|
|
519
|
+
r.copyIn(o(s, m)[n]);
|
|
516
520
|
}
|
|
517
|
-
e = s, s = o(e,
|
|
521
|
+
e = s, s = o(e, O);
|
|
518
522
|
}
|
|
519
523
|
}
|
|
520
524
|
return this;
|
|
521
|
-
},
|
|
522
|
-
var
|
|
525
|
+
}, I = new WeakSet(), et = function(t, e, s, n, r) {
|
|
526
|
+
var E, w, b, A;
|
|
523
527
|
const c = n.maxExtglobRecursion ?? 2;
|
|
524
|
-
let
|
|
528
|
+
let a = !1, p = !1, h = -1, f = !1;
|
|
525
529
|
if (e.type === null) {
|
|
526
|
-
let
|
|
527
|
-
for (;
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
|
|
530
|
+
let d = s, $ = "";
|
|
531
|
+
for (; d < t.length; ) {
|
|
532
|
+
const N = t.charAt(d++);
|
|
533
|
+
if (a || N === "\\") {
|
|
534
|
+
a = !a, $ += N;
|
|
531
535
|
continue;
|
|
532
536
|
}
|
|
533
537
|
if (p) {
|
|
534
|
-
|
|
538
|
+
d === h + 1 ? (N === "^" || N === "!") && (f = !0) : N === "]" && !(d === h + 2 && f) && (p = !1), $ += N;
|
|
535
539
|
continue;
|
|
536
|
-
} else if (
|
|
537
|
-
p = !0,
|
|
540
|
+
} else if (N === "[") {
|
|
541
|
+
p = !0, h = d, f = !1, $ += N;
|
|
538
542
|
continue;
|
|
539
543
|
}
|
|
540
|
-
if (!n.noext &&
|
|
541
|
-
e.push(
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
+
if (!n.noext && at(N) && t.charAt(d) === "(" && r <= c) {
|
|
545
|
+
e.push($), $ = "";
|
|
546
|
+
const X = new W(N, e);
|
|
547
|
+
d = x(E = W, I, et).call(E, t, X, d, n, r + 1), e.push(X);
|
|
544
548
|
continue;
|
|
545
549
|
}
|
|
546
|
-
|
|
550
|
+
$ += N;
|
|
547
551
|
}
|
|
548
|
-
return e.push(
|
|
552
|
+
return e.push($), d;
|
|
549
553
|
}
|
|
550
|
-
let l = s + 1, u = new
|
|
554
|
+
let l = s + 1, u = new W(null, e);
|
|
551
555
|
const g = [];
|
|
552
|
-
let
|
|
556
|
+
let y = "";
|
|
553
557
|
for (; l < t.length; ) {
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
|
|
558
|
+
const d = t.charAt(l++);
|
|
559
|
+
if (a || d === "\\") {
|
|
560
|
+
a = !a, y += d;
|
|
557
561
|
continue;
|
|
558
562
|
}
|
|
559
563
|
if (p) {
|
|
560
|
-
l ===
|
|
564
|
+
l === h + 1 ? (d === "^" || d === "!") && (f = !0) : d === "]" && !(l === h + 2 && f) && (p = !1), y += d;
|
|
561
565
|
continue;
|
|
562
|
-
} else if (
|
|
563
|
-
p = !0,
|
|
566
|
+
} else if (d === "[") {
|
|
567
|
+
p = !0, h = l, f = !1, y += d;
|
|
564
568
|
continue;
|
|
565
569
|
}
|
|
566
|
-
if (!n.noext &&
|
|
567
|
-
(r <= c || e && x(
|
|
568
|
-
const
|
|
569
|
-
u.push(
|
|
570
|
-
const
|
|
571
|
-
u.push(
|
|
570
|
+
if (!n.noext && at(d) && t.charAt(l) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
571
|
+
(r <= c || e && x(w = e, M, st).call(w, d))) {
|
|
572
|
+
const N = e && x(b = e, M, st).call(b, d) ? 0 : 1;
|
|
573
|
+
u.push(y), y = "";
|
|
574
|
+
const H = new W(d, u);
|
|
575
|
+
u.push(H), l = x(A = W, I, et).call(A, t, H, l, n, r + N);
|
|
572
576
|
continue;
|
|
573
577
|
}
|
|
574
|
-
if (
|
|
575
|
-
u.push(
|
|
578
|
+
if (d === "|") {
|
|
579
|
+
u.push(y), y = "", g.push(u), u = new W(null, e);
|
|
576
580
|
continue;
|
|
577
581
|
}
|
|
578
|
-
if (
|
|
579
|
-
return
|
|
580
|
-
|
|
582
|
+
if (d === ")")
|
|
583
|
+
return y === "" && o(e, m).length === 0 && S(e, V, !0), u.push(y), y = "", e.push(...g, u), l;
|
|
584
|
+
y += d;
|
|
581
585
|
}
|
|
582
|
-
return e.type = null,
|
|
583
|
-
},
|
|
584
|
-
return x(this, M,
|
|
585
|
-
},
|
|
586
|
-
if (!t || typeof t != "object" || t.type !== null || o(t,
|
|
586
|
+
return e.type = null, S(e, P, void 0), S(e, m, [t.substring(s - 1)]), l;
|
|
587
|
+
}, Wt = function(t) {
|
|
588
|
+
return x(this, M, ft).call(this, t, Me);
|
|
589
|
+
}, ft = function(t, e = xe) {
|
|
590
|
+
if (!t || typeof t != "object" || t.type !== null || o(t, m).length !== 1 || this.type === null)
|
|
587
591
|
return !1;
|
|
588
|
-
const s = o(t,
|
|
589
|
-
return !s || typeof s != "object" || s.type === null ? !1 : x(this, M,
|
|
590
|
-
},
|
|
592
|
+
const s = o(t, m)[0];
|
|
593
|
+
return !s || typeof s != "object" || s.type === null ? !1 : x(this, M, st).call(this, s.type, e);
|
|
594
|
+
}, st = function(t, e = Ne) {
|
|
591
595
|
var s;
|
|
592
596
|
return !!((s = e.get(this.type)) != null && s.includes(t));
|
|
593
|
-
},
|
|
594
|
-
const s = o(t,
|
|
595
|
-
o(n,
|
|
596
|
-
},
|
|
597
|
-
const s = o(t,
|
|
598
|
-
o(this,
|
|
599
|
-
for (const n of o(s,
|
|
600
|
-
typeof n == "object" &&
|
|
601
|
-
|
|
602
|
-
},
|
|
603
|
-
const e =
|
|
597
|
+
}, Dt = function(t, e) {
|
|
598
|
+
const s = o(t, m)[0], n = new W(null, s, this.options);
|
|
599
|
+
o(n, m).push(""), s.push(n), x(this, M, ut).call(this, t, e);
|
|
600
|
+
}, ut = function(t, e) {
|
|
601
|
+
const s = o(t, m)[0];
|
|
602
|
+
o(this, m).splice(e, 1, ...o(s, m));
|
|
603
|
+
for (const n of o(s, m))
|
|
604
|
+
typeof n == "object" && S(n, O, this);
|
|
605
|
+
S(this, q, void 0);
|
|
606
|
+
}, Lt = function(t) {
|
|
607
|
+
const e = bt.get(this.type);
|
|
604
608
|
return !!(e != null && e.has(t));
|
|
605
|
-
},
|
|
606
|
-
if (!t || typeof t != "object" || t.type !== null || o(t,
|
|
609
|
+
}, kt = function(t) {
|
|
610
|
+
if (!t || typeof t != "object" || t.type !== null || o(t, m).length !== 1 || this.type === null || o(this, m).length !== 1)
|
|
607
611
|
return !1;
|
|
608
|
-
const e = o(t,
|
|
609
|
-
return !e || typeof e != "object" || e.type === null ? !1 : x(this, M,
|
|
610
|
-
},
|
|
611
|
-
const e =
|
|
612
|
+
const e = o(t, m)[0];
|
|
613
|
+
return !e || typeof e != "object" || e.type === null ? !1 : x(this, M, Lt).call(this, e.type);
|
|
614
|
+
}, _t = function(t) {
|
|
615
|
+
const e = bt.get(this.type), s = o(t, m)[0], n = e == null ? void 0 : e.get(s.type);
|
|
612
616
|
if (!n)
|
|
613
617
|
return !1;
|
|
614
|
-
|
|
615
|
-
for (const r of o(this,
|
|
616
|
-
typeof r == "object" &&
|
|
617
|
-
this.type = n,
|
|
618
|
-
},
|
|
618
|
+
S(this, m, o(s, m));
|
|
619
|
+
for (const r of o(this, m))
|
|
620
|
+
typeof r == "object" && S(r, O, this);
|
|
621
|
+
this.type = n, S(this, q, void 0), S(this, V, !1);
|
|
622
|
+
}, nt = function() {
|
|
619
623
|
var t, e;
|
|
620
|
-
if (
|
|
624
|
+
if (Et(this)) {
|
|
621
625
|
let s = 0, n = !1;
|
|
622
626
|
do {
|
|
623
627
|
n = !0;
|
|
624
|
-
for (let r = 0; r < o(this,
|
|
625
|
-
const c = o(this,
|
|
626
|
-
typeof c == "object" && (x(e = c, M,
|
|
628
|
+
for (let r = 0; r < o(this, m).length; r++) {
|
|
629
|
+
const c = o(this, m)[r];
|
|
630
|
+
typeof c == "object" && (x(e = c, M, nt).call(e), x(this, M, ft).call(this, c) ? (n = !1, x(this, M, ut).call(this, c, r)) : x(this, M, Wt).call(this, c) ? (n = !1, x(this, M, Dt).call(this, c, r)) : x(this, M, kt).call(this, c) && (n = !1, x(this, M, _t).call(this, c)));
|
|
627
631
|
}
|
|
628
632
|
} while (!n && ++s < 10);
|
|
629
633
|
} else
|
|
630
|
-
for (const s of o(this,
|
|
631
|
-
typeof s == "object" && x(t = s, M,
|
|
632
|
-
|
|
633
|
-
},
|
|
634
|
-
return o(this,
|
|
634
|
+
for (const s of o(this, m))
|
|
635
|
+
typeof s == "object" && x(t = s, M, nt).call(t);
|
|
636
|
+
S(this, q, void 0);
|
|
637
|
+
}, pt = function(t) {
|
|
638
|
+
return o(this, m).map((e) => {
|
|
635
639
|
if (typeof e == "string")
|
|
636
640
|
throw new Error("string type in extglob ast??");
|
|
637
641
|
const [s, n, r, c] = e.toRegExpSource(t);
|
|
638
|
-
return
|
|
642
|
+
return S(this, z, o(this, z) || c), s;
|
|
639
643
|
}).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
|
|
640
|
-
},
|
|
641
|
-
let n = !1, r = "", c = !1,
|
|
644
|
+
}, qt = function(t, e, s = !1) {
|
|
645
|
+
let n = !1, r = "", c = !1, a = !1;
|
|
642
646
|
for (let p = 0; p < t.length; p++) {
|
|
643
|
-
const
|
|
647
|
+
const h = t.charAt(p);
|
|
644
648
|
if (n) {
|
|
645
|
-
n = !1, r += (
|
|
649
|
+
n = !1, r += (Te.has(h) ? "\\" : "") + h;
|
|
646
650
|
continue;
|
|
647
651
|
}
|
|
648
|
-
if (
|
|
649
|
-
if (
|
|
652
|
+
if (h === "*") {
|
|
653
|
+
if (a)
|
|
650
654
|
continue;
|
|
651
|
-
|
|
655
|
+
a = !0, r += s && /^[*]+$/.test(t) ? Mt : xt, e = !0;
|
|
652
656
|
continue;
|
|
653
657
|
} else
|
|
654
|
-
|
|
655
|
-
if (
|
|
658
|
+
a = !1;
|
|
659
|
+
if (h === "\\") {
|
|
656
660
|
p === t.length - 1 ? r += "\\\\" : n = !0;
|
|
657
661
|
continue;
|
|
658
662
|
}
|
|
659
|
-
if (
|
|
660
|
-
const [
|
|
663
|
+
if (h === "[") {
|
|
664
|
+
const [f, l, u, g] = Ee(t, p);
|
|
661
665
|
if (u) {
|
|
662
|
-
r +=
|
|
666
|
+
r += f, c = c || l, p += u - 1, e = e || g;
|
|
663
667
|
continue;
|
|
664
668
|
}
|
|
665
669
|
}
|
|
666
|
-
if (
|
|
667
|
-
r +=
|
|
670
|
+
if (h === "?") {
|
|
671
|
+
r += mt, e = !0;
|
|
668
672
|
continue;
|
|
669
673
|
}
|
|
670
|
-
r +=
|
|
674
|
+
r += ve(h);
|
|
671
675
|
}
|
|
672
|
-
return [r,
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
const
|
|
676
|
-
const e =
|
|
676
|
+
return [r, Y(t), !!e, c];
|
|
677
|
+
}, R(rt, I);
|
|
678
|
+
W = rt;
|
|
679
|
+
const Pe = (i, { windowsPathsNoEscape: t = !1, magicalBraces: e = !1 } = {}) => e ? t ? i.replace(/[?*()[\]{}]/g, "[$&]") : i.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? i.replace(/[?*()[\]]/g, "[$&]") : i.replace(/[?*()[\]\\]/g, "\\$&"), j = (i, t, e = {}) => (it(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new ot(t, e).match(i)), je = /^\*+([^+@!?*[(]*)$/, Ce = (i) => (t) => !t.startsWith(".") && t.endsWith(i), We = (i) => (t) => t.endsWith(i), De = (i) => (i = i.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(i)), Le = (i) => (i = i.toLowerCase(), (t) => t.toLowerCase().endsWith(i)), ke = /^\*+\.\*+$/, _e = (i) => !i.startsWith(".") && i.includes("."), qe = (i) => i !== "." && i !== ".." && i.includes("."), ze = /^\.\*+$/, Ge = (i) => i !== "." && i !== ".." && i.startsWith("."), Fe = /^\*+$/, Be = (i) => i.length !== 0 && !i.startsWith("."), Ie = (i) => i.length !== 0 && i !== "." && i !== "..", Ue = /^\?+([^+@!?*[(]*)?$/, Ze = ([i, t = ""]) => {
|
|
680
|
+
const e = zt([i]);
|
|
677
681
|
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
678
|
-
},
|
|
679
|
-
const e =
|
|
682
|
+
}, He = ([i, t = ""]) => {
|
|
683
|
+
const e = Gt([i]);
|
|
680
684
|
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
681
|
-
},
|
|
682
|
-
const e =
|
|
685
|
+
}, Je = ([i, t = ""]) => {
|
|
686
|
+
const e = Gt([i]);
|
|
683
687
|
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
684
|
-
},
|
|
685
|
-
const e =
|
|
688
|
+
}, Ve = ([i, t = ""]) => {
|
|
689
|
+
const e = zt([i]);
|
|
686
690
|
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
687
|
-
},
|
|
691
|
+
}, zt = ([i]) => {
|
|
688
692
|
const t = i.length;
|
|
689
693
|
return (e) => e.length === t && !e.startsWith(".");
|
|
690
|
-
},
|
|
694
|
+
}, Gt = ([i]) => {
|
|
691
695
|
const t = i.length;
|
|
692
696
|
return (e) => e.length === t && e !== "." && e !== "..";
|
|
693
|
-
},
|
|
697
|
+
}, Ft = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", Nt = {
|
|
694
698
|
win32: { sep: "\\" },
|
|
695
699
|
posix: { sep: "/" }
|
|
696
|
-
},
|
|
697
|
-
j.sep =
|
|
698
|
-
const
|
|
699
|
-
j.GLOBSTAR =
|
|
700
|
-
const
|
|
701
|
-
j.filter =
|
|
702
|
-
const
|
|
700
|
+
}, Xe = Ft === "win32" ? Nt.win32.sep : Nt.posix.sep;
|
|
701
|
+
j.sep = Xe;
|
|
702
|
+
const C = Symbol("globstar **");
|
|
703
|
+
j.GLOBSTAR = C;
|
|
704
|
+
const Qe = "[^/]", Ke = Qe + "*?", Ye = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", ts = "(?:(?!(?:\\/|^)\\.).)*?", es = (i, t = {}) => (e) => j(e, i, t);
|
|
705
|
+
j.filter = es;
|
|
706
|
+
const k = (i, t = {}) => Object.assign({}, i, t), ss = (i) => {
|
|
703
707
|
if (!i || typeof i != "object" || !Object.keys(i).length)
|
|
704
708
|
return j;
|
|
705
709
|
const t = j;
|
|
706
|
-
return Object.assign((s, n, r = {}) => t(s, n,
|
|
710
|
+
return Object.assign((s, n, r = {}) => t(s, n, k(i, r)), {
|
|
707
711
|
Minimatch: class extends t.Minimatch {
|
|
708
712
|
constructor(n, r = {}) {
|
|
709
|
-
super(n,
|
|
713
|
+
super(n, k(i, r));
|
|
710
714
|
}
|
|
711
715
|
static defaults(n) {
|
|
712
|
-
return t.defaults(
|
|
716
|
+
return t.defaults(k(i, n)).Minimatch;
|
|
713
717
|
}
|
|
714
718
|
},
|
|
715
719
|
AST: class extends t.AST {
|
|
716
720
|
/* c8 ignore start */
|
|
717
721
|
constructor(n, r, c = {}) {
|
|
718
|
-
super(n, r,
|
|
722
|
+
super(n, r, k(i, c));
|
|
719
723
|
}
|
|
720
724
|
/* c8 ignore stop */
|
|
721
725
|
static fromGlob(n, r = {}) {
|
|
722
|
-
return t.AST.fromGlob(n,
|
|
726
|
+
return t.AST.fromGlob(n, k(i, r));
|
|
723
727
|
}
|
|
724
728
|
},
|
|
725
|
-
unescape: (s, n = {}) => t.unescape(s,
|
|
726
|
-
escape: (s, n = {}) => t.escape(s,
|
|
727
|
-
filter: (s, n = {}) => t.filter(s,
|
|
728
|
-
defaults: (s) => t.defaults(
|
|
729
|
-
makeRe: (s, n = {}) => t.makeRe(s,
|
|
730
|
-
braceExpand: (s, n = {}) => t.braceExpand(s,
|
|
731
|
-
match: (s, n, r = {}) => t.match(s, n,
|
|
729
|
+
unescape: (s, n = {}) => t.unescape(s, k(i, n)),
|
|
730
|
+
escape: (s, n = {}) => t.escape(s, k(i, n)),
|
|
731
|
+
filter: (s, n = {}) => t.filter(s, k(i, n)),
|
|
732
|
+
defaults: (s) => t.defaults(k(i, s)),
|
|
733
|
+
makeRe: (s, n = {}) => t.makeRe(s, k(i, n)),
|
|
734
|
+
braceExpand: (s, n = {}) => t.braceExpand(s, k(i, n)),
|
|
735
|
+
match: (s, n, r = {}) => t.match(s, n, k(i, r)),
|
|
732
736
|
sep: t.sep,
|
|
733
|
-
GLOBSTAR:
|
|
737
|
+
GLOBSTAR: C
|
|
734
738
|
});
|
|
735
739
|
};
|
|
736
|
-
j.defaults =
|
|
737
|
-
const
|
|
738
|
-
j.braceExpand =
|
|
739
|
-
const
|
|
740
|
-
j.makeRe =
|
|
741
|
-
const
|
|
742
|
-
const s = new
|
|
740
|
+
j.defaults = ss;
|
|
741
|
+
const Bt = (i, t = {}) => (it(i), t.nobrace || !/\{(?:(?!\{).)*\}/.test(i) ? [i] : ue(i, { max: t.braceExpandMax }));
|
|
742
|
+
j.braceExpand = Bt;
|
|
743
|
+
const ns = (i, t = {}) => new ot(i, t).makeRe();
|
|
744
|
+
j.makeRe = ns;
|
|
745
|
+
const is = (i, t, e = {}) => {
|
|
746
|
+
const s = new ot(t, e);
|
|
743
747
|
return i = i.filter((n) => s.match(n)), s.options.nonull && !i.length && i.push(t), i;
|
|
744
748
|
};
|
|
745
|
-
j.match =
|
|
746
|
-
const
|
|
747
|
-
var
|
|
748
|
-
class
|
|
749
|
+
j.match = is;
|
|
750
|
+
const At = /[?*]|[+@!]\(.*?\)|\[|\]/, rs = (i) => i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
751
|
+
var L, It, gt, J;
|
|
752
|
+
class ot {
|
|
749
753
|
constructor(t, e = {}) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
754
|
+
R(this, L);
|
|
755
|
+
T(this, "options");
|
|
756
|
+
T(this, "set");
|
|
757
|
+
T(this, "pattern");
|
|
758
|
+
T(this, "windowsPathsNoEscape");
|
|
759
|
+
T(this, "nonegate");
|
|
760
|
+
T(this, "negate");
|
|
761
|
+
T(this, "comment");
|
|
762
|
+
T(this, "empty");
|
|
763
|
+
T(this, "preserveMultipleSlashes");
|
|
764
|
+
T(this, "partial");
|
|
765
|
+
T(this, "globSet");
|
|
766
|
+
T(this, "globParts");
|
|
767
|
+
T(this, "nocase");
|
|
768
|
+
T(this, "isWindows");
|
|
769
|
+
T(this, "platform");
|
|
770
|
+
T(this, "windowsNoMagicRoot");
|
|
771
|
+
T(this, "maxGlobstarRecursion");
|
|
772
|
+
T(this, "regexp");
|
|
773
|
+
it(t), e = e || {}, this.options = e, this.maxGlobstarRecursion = e.maxGlobstarRecursion ?? 200, this.pattern = t, this.platform = e.platform || Ft, this.isWindows = this.platform === "win32";
|
|
770
774
|
const s = "allowWindowsEscape";
|
|
771
775
|
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e[s] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
|
|
772
776
|
}
|
|
@@ -794,16 +798,16 @@ class lt {
|
|
|
794
798
|
this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
|
|
795
799
|
const s = this.globSet.map((r) => this.slashSplit(r));
|
|
796
800
|
this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
|
|
797
|
-
let n = this.globParts.map((r, c,
|
|
801
|
+
let n = this.globParts.map((r, c, a) => {
|
|
798
802
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
799
|
-
const p = r[0] === "" && r[1] === "" && (r[2] === "?" || !
|
|
803
|
+
const p = r[0] === "" && r[1] === "" && (r[2] === "?" || !At.test(r[2])) && !At.test(r[3]), h = /^[a-z]:/i.test(r[0]);
|
|
800
804
|
if (p)
|
|
801
805
|
return [
|
|
802
806
|
...r.slice(0, 4),
|
|
803
|
-
...r.slice(4).map((
|
|
807
|
+
...r.slice(4).map((f) => this.parse(f))
|
|
804
808
|
];
|
|
805
|
-
if (
|
|
806
|
-
return [r[0], ...r.slice(1).map((
|
|
809
|
+
if (h)
|
|
810
|
+
return [r[0], ...r.slice(1).map((f) => this.parse(f))];
|
|
807
811
|
}
|
|
808
812
|
return r.map((p) => this.parse(p));
|
|
809
813
|
});
|
|
@@ -895,18 +899,18 @@ class lt {
|
|
|
895
899
|
for (; s[c + 1] === "**"; )
|
|
896
900
|
c++;
|
|
897
901
|
c > n && s.splice(n + 1, c - n);
|
|
898
|
-
let
|
|
899
|
-
const p = s[n + 2],
|
|
900
|
-
if (
|
|
902
|
+
let a = s[n + 1];
|
|
903
|
+
const p = s[n + 2], h = s[n + 3];
|
|
904
|
+
if (a !== ".." || !p || p === "." || p === ".." || !h || h === "." || h === "..")
|
|
901
905
|
continue;
|
|
902
906
|
e = !0, s.splice(n, 1);
|
|
903
|
-
const
|
|
904
|
-
|
|
907
|
+
const f = s.slice(0);
|
|
908
|
+
f[n] = "**", t.push(f), n--;
|
|
905
909
|
}
|
|
906
910
|
if (!this.preserveMultipleSlashes) {
|
|
907
911
|
for (let c = 1; c < s.length - 1; c++) {
|
|
908
|
-
const
|
|
909
|
-
c === 1 &&
|
|
912
|
+
const a = s[c];
|
|
913
|
+
c === 1 && a === "" && s[0] === "" || (a === "." || a === "") && (e = !0, s.splice(c, 1), c--);
|
|
910
914
|
}
|
|
911
915
|
s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = !0, s.pop());
|
|
912
916
|
}
|
|
@@ -942,22 +946,22 @@ class lt {
|
|
|
942
946
|
return t.filter((e) => e.length);
|
|
943
947
|
}
|
|
944
948
|
partsMatch(t, e, s = !1) {
|
|
945
|
-
let n = 0, r = 0, c = [],
|
|
949
|
+
let n = 0, r = 0, c = [], a = "";
|
|
946
950
|
for (; n < t.length && r < e.length; )
|
|
947
951
|
if (t[n] === e[r])
|
|
948
|
-
c.push(
|
|
952
|
+
c.push(a === "b" ? e[r] : t[n]), n++, r++;
|
|
949
953
|
else if (s && t[n] === "**" && e[r] === t[n + 1])
|
|
950
954
|
c.push(t[n]), n++;
|
|
951
955
|
else if (s && e[r] === "**" && t[n] === e[r + 1])
|
|
952
956
|
c.push(e[r]), r++;
|
|
953
957
|
else if (t[n] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
|
|
954
|
-
if (
|
|
958
|
+
if (a === "b")
|
|
955
959
|
return !1;
|
|
956
|
-
|
|
960
|
+
a = "a", c.push(t[n]), n++, r++;
|
|
957
961
|
} else if (e[r] === "*" && t[n] && (this.options.dot || !t[n].startsWith(".")) && t[n] !== "**") {
|
|
958
|
-
if (
|
|
962
|
+
if (a === "a")
|
|
959
963
|
return !1;
|
|
960
|
-
|
|
964
|
+
a = "b", c.push(e[r]), n++, r++;
|
|
961
965
|
} else
|
|
962
966
|
return !1;
|
|
963
967
|
return t.length === e.length && c;
|
|
@@ -979,31 +983,31 @@ class lt {
|
|
|
979
983
|
matchOne(t, e, s = !1) {
|
|
980
984
|
let n = 0, r = 0;
|
|
981
985
|
if (this.isWindows) {
|
|
982
|
-
const
|
|
986
|
+
const a = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), p = !a && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), h = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), f = !h && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), l = p ? 3 : a ? 0 : void 0, u = f ? 3 : h ? 0 : void 0;
|
|
983
987
|
if (typeof l == "number" && typeof u == "number") {
|
|
984
|
-
const [g,
|
|
988
|
+
const [g, y] = [
|
|
985
989
|
t[l],
|
|
986
990
|
e[u]
|
|
987
991
|
];
|
|
988
|
-
g.toLowerCase() ===
|
|
992
|
+
g.toLowerCase() === y.toLowerCase() && (e[u] = g, r = u, n = l);
|
|
989
993
|
}
|
|
990
994
|
}
|
|
991
995
|
const { optimizationLevel: c = 1 } = this.options;
|
|
992
|
-
return c >= 2 && (t = this.levelTwoFileOptimize(t)), e.includes(
|
|
996
|
+
return c >= 2 && (t = this.levelTwoFileOptimize(t)), e.includes(C) ? x(this, L, It).call(this, t, e, s, n, r) : x(this, L, J).call(this, t, e, s, n, r);
|
|
993
997
|
}
|
|
994
998
|
braceExpand() {
|
|
995
|
-
return
|
|
999
|
+
return Bt(this.pattern, this.options);
|
|
996
1000
|
}
|
|
997
1001
|
parse(t) {
|
|
998
|
-
|
|
1002
|
+
it(t);
|
|
999
1003
|
const e = this.options;
|
|
1000
1004
|
if (t === "**")
|
|
1001
|
-
return
|
|
1005
|
+
return C;
|
|
1002
1006
|
if (t === "")
|
|
1003
1007
|
return "";
|
|
1004
1008
|
let s, n = null;
|
|
1005
|
-
(s = t.match(
|
|
1006
|
-
const r =
|
|
1009
|
+
(s = t.match(Fe)) ? n = e.dot ? Ie : Be : (s = t.match(je)) ? n = (e.nocase ? e.dot ? Le : De : e.dot ? We : Ce)(s[1]) : (s = t.match(Ue)) ? n = (e.nocase ? e.dot ? He : Ze : e.dot ? Je : Ve)(s) : (s = t.match(ke)) ? n = e.dot ? qe : _e : (s = t.match(ze)) && (n = Ge);
|
|
1010
|
+
const r = rt.fromGlob(t, this.options).toMMPattern();
|
|
1007
1011
|
return n && typeof r == "object" && Reflect.defineProperty(r, "test", { value: n }), r;
|
|
1008
1012
|
}
|
|
1009
1013
|
makeRe() {
|
|
@@ -1012,29 +1016,29 @@ class lt {
|
|
|
1012
1016
|
const t = this.set;
|
|
1013
1017
|
if (!t.length)
|
|
1014
1018
|
return this.regexp = !1, this.regexp;
|
|
1015
|
-
const e = this.options, s = e.noglobstar ?
|
|
1019
|
+
const e = this.options, s = e.noglobstar ? Ke : e.dot ? Ye : ts, n = new Set(e.nocase ? ["i"] : []);
|
|
1016
1020
|
let r = t.map((p) => {
|
|
1017
|
-
const
|
|
1021
|
+
const h = p.map((l) => {
|
|
1018
1022
|
if (l instanceof RegExp)
|
|
1019
1023
|
for (const u of l.flags.split(""))
|
|
1020
1024
|
n.add(u);
|
|
1021
|
-
return typeof l == "string" ?
|
|
1025
|
+
return typeof l == "string" ? rs(l) : l === C ? C : l._src;
|
|
1022
1026
|
});
|
|
1023
|
-
|
|
1024
|
-
const g =
|
|
1025
|
-
l !==
|
|
1027
|
+
h.forEach((l, u) => {
|
|
1028
|
+
const g = h[u + 1], y = h[u - 1];
|
|
1029
|
+
l !== C || y === C || (y === void 0 ? g !== void 0 && g !== C ? h[u + 1] = "(?:\\/|" + s + "\\/)?" + g : h[u] = s : g === void 0 ? h[u - 1] = y + "(?:\\/|\\/" + s + ")?" : g !== C && (h[u - 1] = y + "(?:\\/|\\/" + s + "\\/)" + g, h[u + 1] = C));
|
|
1026
1030
|
});
|
|
1027
|
-
const
|
|
1028
|
-
if (this.partial &&
|
|
1031
|
+
const f = h.filter((l) => l !== C);
|
|
1032
|
+
if (this.partial && f.length >= 1) {
|
|
1029
1033
|
const l = [];
|
|
1030
|
-
for (let u = 1; u <=
|
|
1031
|
-
l.push(
|
|
1034
|
+
for (let u = 1; u <= f.length; u++)
|
|
1035
|
+
l.push(f.slice(0, u).join("/"));
|
|
1032
1036
|
return "(?:" + l.join("|") + ")";
|
|
1033
1037
|
}
|
|
1034
|
-
return
|
|
1038
|
+
return f.join("/");
|
|
1035
1039
|
}).join("|");
|
|
1036
|
-
const [c,
|
|
1037
|
-
r = "^" + c + r +
|
|
1040
|
+
const [c, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1041
|
+
r = "^" + c + r + a + "$", this.partial && (r = "^(?:\\/|" + c + r.slice(1, -1) + a + ")$"), this.negate && (r = "^(?!" + r + ").+$");
|
|
1038
1042
|
try {
|
|
1039
1043
|
this.regexp = new RegExp(r, [...n].join(""));
|
|
1040
1044
|
} catch {
|
|
@@ -1060,11 +1064,11 @@ class lt {
|
|
|
1060
1064
|
this.debug(this.pattern, "set", r);
|
|
1061
1065
|
let c = n[n.length - 1];
|
|
1062
1066
|
if (!c)
|
|
1063
|
-
for (let
|
|
1064
|
-
c = n[
|
|
1065
|
-
for (const
|
|
1067
|
+
for (let a = n.length - 2; !c && a >= 0; a--)
|
|
1068
|
+
c = n[a];
|
|
1069
|
+
for (const a of r) {
|
|
1066
1070
|
let p = n;
|
|
1067
|
-
if (s.matchBase &&
|
|
1071
|
+
if (s.matchBase && a.length === 1 && (p = [c]), this.matchOne(p, a, e))
|
|
1068
1072
|
return s.flipNegate ? !0 : !this.negate;
|
|
1069
1073
|
}
|
|
1070
1074
|
return s.flipNegate ? !1 : this.negate;
|
|
@@ -1073,71 +1077,71 @@ class lt {
|
|
|
1073
1077
|
return j.defaults(t).Minimatch;
|
|
1074
1078
|
}
|
|
1075
1079
|
}
|
|
1076
|
-
|
|
1077
|
-
const c = e.indexOf(
|
|
1080
|
+
L = new WeakSet(), It = function(t, e, s, n, r) {
|
|
1081
|
+
const c = e.indexOf(C, r), a = e.lastIndexOf(C), [p, h, f] = s ? [
|
|
1078
1082
|
e.slice(r, c),
|
|
1079
1083
|
e.slice(c + 1),
|
|
1080
1084
|
[]
|
|
1081
1085
|
] : [
|
|
1082
1086
|
e.slice(r, c),
|
|
1083
|
-
e.slice(c + 1,
|
|
1084
|
-
e.slice(
|
|
1087
|
+
e.slice(c + 1, a),
|
|
1088
|
+
e.slice(a + 1)
|
|
1085
1089
|
];
|
|
1086
1090
|
if (p.length) {
|
|
1087
|
-
const
|
|
1088
|
-
if (!x(this,
|
|
1091
|
+
const A = t.slice(n, n + p.length);
|
|
1092
|
+
if (!x(this, L, J).call(this, A, p, s, 0, 0))
|
|
1089
1093
|
return !1;
|
|
1090
1094
|
n += p.length, r += p.length;
|
|
1091
1095
|
}
|
|
1092
1096
|
let l = 0;
|
|
1093
|
-
if (
|
|
1094
|
-
if (
|
|
1097
|
+
if (f.length) {
|
|
1098
|
+
if (f.length + n > t.length)
|
|
1095
1099
|
return !1;
|
|
1096
|
-
let
|
|
1097
|
-
if (x(this,
|
|
1098
|
-
l =
|
|
1100
|
+
let A = t.length - f.length;
|
|
1101
|
+
if (x(this, L, J).call(this, t, f, s, A, 0))
|
|
1102
|
+
l = f.length;
|
|
1099
1103
|
else {
|
|
1100
|
-
if (t[t.length - 1] !== "" || n +
|
|
1104
|
+
if (t[t.length - 1] !== "" || n + f.length === t.length || (A--, !x(this, L, J).call(this, t, f, s, A, 0)))
|
|
1101
1105
|
return !1;
|
|
1102
|
-
l =
|
|
1106
|
+
l = f.length + 1;
|
|
1103
1107
|
}
|
|
1104
1108
|
}
|
|
1105
|
-
if (!
|
|
1106
|
-
let
|
|
1107
|
-
for (let
|
|
1108
|
-
const
|
|
1109
|
-
if (
|
|
1109
|
+
if (!h.length) {
|
|
1110
|
+
let A = !!l;
|
|
1111
|
+
for (let d = n; d < t.length - l; d++) {
|
|
1112
|
+
const $ = String(t[d]);
|
|
1113
|
+
if (A = !0, $ === "." || $ === ".." || !this.options.dot && $.startsWith("."))
|
|
1110
1114
|
return !1;
|
|
1111
1115
|
}
|
|
1112
|
-
return s ||
|
|
1116
|
+
return s || A;
|
|
1113
1117
|
}
|
|
1114
1118
|
const u = [[[], 0]];
|
|
1115
|
-
let g = u[0],
|
|
1116
|
-
const
|
|
1117
|
-
for (const
|
|
1118
|
-
|
|
1119
|
-
let
|
|
1120
|
-
const
|
|
1121
|
-
for (const
|
|
1122
|
-
|
|
1123
|
-
return !!x(this,
|
|
1119
|
+
let g = u[0], y = 0;
|
|
1120
|
+
const E = [0];
|
|
1121
|
+
for (const A of h)
|
|
1122
|
+
A === C ? (E.push(y), g = [[], 0], u.push(g)) : (g[0].push(A), y++);
|
|
1123
|
+
let w = u.length - 1;
|
|
1124
|
+
const b = t.length - l;
|
|
1125
|
+
for (const A of u)
|
|
1126
|
+
A[1] = b - (E[w--] + A[0].length);
|
|
1127
|
+
return !!x(this, L, gt).call(this, t, u, n, 0, s, 0, !!l);
|
|
1124
1128
|
}, // return false for "nope, not matching"
|
|
1125
1129
|
// return null for "not matching, cannot keep trying"
|
|
1126
|
-
|
|
1130
|
+
gt = function(t, e, s, n, r, c, a) {
|
|
1127
1131
|
const p = e[n];
|
|
1128
1132
|
if (!p) {
|
|
1129
1133
|
for (let l = s; l < t.length; l++) {
|
|
1130
|
-
|
|
1134
|
+
a = !0;
|
|
1131
1135
|
const u = t[l];
|
|
1132
1136
|
if (u === "." || u === ".." || !this.options.dot && u.startsWith("."))
|
|
1133
1137
|
return !1;
|
|
1134
1138
|
}
|
|
1135
|
-
return
|
|
1139
|
+
return a;
|
|
1136
1140
|
}
|
|
1137
|
-
const [
|
|
1138
|
-
for (; s <=
|
|
1139
|
-
if (x(this,
|
|
1140
|
-
const g = x(this,
|
|
1141
|
+
const [h, f] = p;
|
|
1142
|
+
for (; s <= f; ) {
|
|
1143
|
+
if (x(this, L, J).call(this, t.slice(0, s + h.length), h, r, s, 0) && c < this.maxGlobstarRecursion) {
|
|
1144
|
+
const g = x(this, L, gt).call(this, t, e, s + h.length, n + 1, r, c + 1, a);
|
|
1141
1145
|
if (g !== !1)
|
|
1142
1146
|
return g;
|
|
1143
1147
|
}
|
|
@@ -1147,99 +1151,99 @@ mt = function(t, e, s, n, r, c, f) {
|
|
|
1147
1151
|
s++;
|
|
1148
1152
|
}
|
|
1149
1153
|
return r || null;
|
|
1150
|
-
},
|
|
1151
|
-
let c,
|
|
1152
|
-
for (c = n,
|
|
1154
|
+
}, J = function(t, e, s, n, r) {
|
|
1155
|
+
let c, a, p, h;
|
|
1156
|
+
for (c = n, a = r, h = t.length, p = e.length; c < h && a < p; c++, a++) {
|
|
1153
1157
|
this.debug("matchOne loop");
|
|
1154
|
-
let
|
|
1155
|
-
if (this.debug(e,
|
|
1158
|
+
let f = e[a], l = t[c];
|
|
1159
|
+
if (this.debug(e, f, l), f === !1 || f === C)
|
|
1156
1160
|
return !1;
|
|
1157
1161
|
let u;
|
|
1158
|
-
if (typeof
|
|
1162
|
+
if (typeof f == "string" ? (u = l === f, this.debug("string match", f, l, u)) : (u = f.test(l), this.debug("pattern match", f, l, u)), !u)
|
|
1159
1163
|
return !1;
|
|
1160
1164
|
}
|
|
1161
|
-
if (c ===
|
|
1165
|
+
if (c === h && a === p)
|
|
1162
1166
|
return !0;
|
|
1163
|
-
if (c ===
|
|
1167
|
+
if (c === h)
|
|
1164
1168
|
return s;
|
|
1165
|
-
if (
|
|
1166
|
-
return c ===
|
|
1169
|
+
if (a === p)
|
|
1170
|
+
return c === h - 1 && t[c] === "";
|
|
1167
1171
|
throw new Error("wtf?");
|
|
1168
1172
|
};
|
|
1169
|
-
j.AST =
|
|
1170
|
-
j.Minimatch =
|
|
1171
|
-
j.escape =
|
|
1172
|
-
j.unescape =
|
|
1173
|
-
class
|
|
1173
|
+
j.AST = rt;
|
|
1174
|
+
j.Minimatch = ot;
|
|
1175
|
+
j.escape = Pe;
|
|
1176
|
+
j.unescape = Y;
|
|
1177
|
+
class os {
|
|
1174
1178
|
constructor(t) {
|
|
1175
|
-
|
|
1176
|
-
|
|
1179
|
+
T(this, "value");
|
|
1180
|
+
T(this, "next");
|
|
1177
1181
|
this.value = t;
|
|
1178
1182
|
}
|
|
1179
1183
|
}
|
|
1180
|
-
var
|
|
1181
|
-
class
|
|
1184
|
+
var D, B, Z;
|
|
1185
|
+
class cs {
|
|
1182
1186
|
constructor() {
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1187
|
+
R(this, D);
|
|
1188
|
+
R(this, B);
|
|
1189
|
+
R(this, Z);
|
|
1186
1190
|
this.clear();
|
|
1187
1191
|
}
|
|
1188
1192
|
enqueue(t) {
|
|
1189
|
-
const e = new
|
|
1190
|
-
o(this,
|
|
1193
|
+
const e = new os(t);
|
|
1194
|
+
o(this, D) ? (o(this, B).next = e, S(this, B, e)) : (S(this, D, e), S(this, B, e)), lt(this, Z)._++;
|
|
1191
1195
|
}
|
|
1192
1196
|
dequeue() {
|
|
1193
|
-
const t = o(this,
|
|
1197
|
+
const t = o(this, D);
|
|
1194
1198
|
if (t)
|
|
1195
|
-
return
|
|
1199
|
+
return S(this, D, o(this, D).next), lt(this, Z)._--, o(this, D) || S(this, B, void 0), t.value;
|
|
1196
1200
|
}
|
|
1197
1201
|
peek() {
|
|
1198
|
-
if (o(this,
|
|
1199
|
-
return o(this,
|
|
1202
|
+
if (o(this, D))
|
|
1203
|
+
return o(this, D).value;
|
|
1200
1204
|
}
|
|
1201
1205
|
clear() {
|
|
1202
|
-
|
|
1206
|
+
S(this, D, void 0), S(this, B, void 0), S(this, Z, 0);
|
|
1203
1207
|
}
|
|
1204
1208
|
get size() {
|
|
1205
|
-
return o(this,
|
|
1209
|
+
return o(this, Z);
|
|
1206
1210
|
}
|
|
1207
1211
|
*[Symbol.iterator]() {
|
|
1208
|
-
let t = o(this,
|
|
1212
|
+
let t = o(this, D);
|
|
1209
1213
|
for (; t; )
|
|
1210
1214
|
yield t.value, t = t.next;
|
|
1211
1215
|
}
|
|
1212
1216
|
*drain() {
|
|
1213
|
-
for (; o(this,
|
|
1217
|
+
for (; o(this, D); )
|
|
1214
1218
|
yield this.dequeue();
|
|
1215
1219
|
}
|
|
1216
1220
|
}
|
|
1217
|
-
|
|
1218
|
-
function
|
|
1221
|
+
D = new WeakMap(), B = new WeakMap(), Z = new WeakMap();
|
|
1222
|
+
function ls(i) {
|
|
1219
1223
|
let t = !1;
|
|
1220
|
-
if (typeof i == "object" && ({ concurrency: i, rejectOnClear: t = !1 } = i),
|
|
1224
|
+
if (typeof i == "object" && ({ concurrency: i, rejectOnClear: t = !1 } = i), $t(i), typeof t != "boolean")
|
|
1221
1225
|
throw new TypeError("Expected `rejectOnClear` to be a boolean");
|
|
1222
|
-
const e = new
|
|
1226
|
+
const e = new cs();
|
|
1223
1227
|
let s = 0;
|
|
1224
1228
|
const n = () => {
|
|
1225
1229
|
s < i && e.size > 0 && (s++, e.dequeue().run());
|
|
1226
1230
|
}, r = () => {
|
|
1227
1231
|
s--, n();
|
|
1228
|
-
}, c = async (
|
|
1229
|
-
const u = (async () =>
|
|
1230
|
-
|
|
1232
|
+
}, c = async (h, f, l) => {
|
|
1233
|
+
const u = (async () => h(...l))();
|
|
1234
|
+
f(u);
|
|
1231
1235
|
try {
|
|
1232
1236
|
await u;
|
|
1233
1237
|
} catch {
|
|
1234
1238
|
}
|
|
1235
1239
|
r();
|
|
1236
|
-
},
|
|
1240
|
+
}, a = (h, f, l, u) => {
|
|
1237
1241
|
const g = { reject: l };
|
|
1238
|
-
new Promise((
|
|
1239
|
-
g.run =
|
|
1240
|
-
}).then(c.bind(void 0,
|
|
1241
|
-
}, p = (
|
|
1242
|
-
|
|
1242
|
+
new Promise((y) => {
|
|
1243
|
+
g.run = y, e.enqueue(g);
|
|
1244
|
+
}).then(c.bind(void 0, h, f, u)), s < i && n();
|
|
1245
|
+
}, p = (h, ...f) => new Promise((l, u) => {
|
|
1246
|
+
a(h, l, u, f);
|
|
1243
1247
|
});
|
|
1244
1248
|
return Object.defineProperties(p, {
|
|
1245
1249
|
activeCount: {
|
|
@@ -1254,33 +1258,34 @@ function rs(i) {
|
|
|
1254
1258
|
e.clear();
|
|
1255
1259
|
return;
|
|
1256
1260
|
}
|
|
1257
|
-
const
|
|
1261
|
+
const h = AbortSignal.abort().reason;
|
|
1258
1262
|
for (; e.size > 0; )
|
|
1259
|
-
e.dequeue().reject(
|
|
1263
|
+
e.dequeue().reject(h);
|
|
1260
1264
|
}
|
|
1261
1265
|
},
|
|
1262
1266
|
concurrency: {
|
|
1263
1267
|
get: () => i,
|
|
1264
|
-
set(
|
|
1265
|
-
|
|
1268
|
+
set(h) {
|
|
1269
|
+
$t(h), i = h, queueMicrotask(() => {
|
|
1266
1270
|
for (; s < i && e.size > 0; )
|
|
1267
1271
|
n();
|
|
1268
1272
|
});
|
|
1269
1273
|
}
|
|
1270
1274
|
},
|
|
1271
1275
|
map: {
|
|
1272
|
-
async value(
|
|
1273
|
-
const l = Array.from(
|
|
1276
|
+
async value(h, f) {
|
|
1277
|
+
const l = Array.from(h, (u, g) => this(f, u, g));
|
|
1274
1278
|
return Promise.all(l);
|
|
1275
1279
|
}
|
|
1276
1280
|
}
|
|
1277
1281
|
}), p;
|
|
1278
1282
|
}
|
|
1279
|
-
function
|
|
1283
|
+
function $t(i) {
|
|
1280
1284
|
if (!((Number.isInteger(i) || i === Number.POSITIVE_INFINITY) && i > 0))
|
|
1281
1285
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
1282
1286
|
}
|
|
1283
|
-
|
|
1287
|
+
const hs = Qt(Vt);
|
|
1288
|
+
function as(i) {
|
|
1284
1289
|
if (i.length < 2) return "never";
|
|
1285
1290
|
const t = [...i].sort((n, r) => n - r);
|
|
1286
1291
|
let e = 0;
|
|
@@ -1289,84 +1294,82 @@ function os(i) {
|
|
|
1289
1294
|
const s = e / (t.length - 1) / 864e5;
|
|
1290
1295
|
return s <= 1 ? "daily" : s <= 7 ? "weekly" : s <= 30 ? "monthly" : s <= 365 ? "yearly" : "never";
|
|
1291
1296
|
}
|
|
1292
|
-
function
|
|
1297
|
+
function ws(i) {
|
|
1293
1298
|
const t = i.pageEntryPattern;
|
|
1294
1299
|
let e = i.rootDir ?? "", s = i.outputFile ?? "";
|
|
1295
|
-
const n = i.concurrency ?? 20, r = i.commitCount ?? 10, c = i.ignoreDeps ? Array.isArray(i.ignoreDeps) ? i.ignoreDeps : [i.ignoreDeps] : [],
|
|
1300
|
+
const n = i.concurrency ?? 20, r = i.commitCount ?? 10, c = i.ignoreDeps ? Array.isArray(i.ignoreDeps) ? i.ignoreDeps : [i.ignoreDeps] : [], a = {};
|
|
1296
1301
|
let p;
|
|
1297
1302
|
return {
|
|
1298
1303
|
name: "vite-last-modified",
|
|
1299
|
-
async configResolved(
|
|
1300
|
-
|
|
1301
|
-
p = a.build.ssr, e || (e = a.root), s || (s = h(e, "last-modified.json"));
|
|
1304
|
+
async configResolved(h) {
|
|
1305
|
+
p = h.build.ssr, e || (e = h.root), s || (s = Jt(e, "last-modified.json"));
|
|
1302
1306
|
},
|
|
1303
1307
|
async buildEnd() {
|
|
1304
1308
|
if (p || process.env.NODE_ENV !== "production")
|
|
1305
1309
|
return;
|
|
1306
|
-
const
|
|
1307
|
-
if (
|
|
1308
|
-
return
|
|
1309
|
-
const
|
|
1310
|
+
const h = /* @__PURE__ */ new Map(), f = ls(n), l = (w) => {
|
|
1311
|
+
if (h.has(w))
|
|
1312
|
+
return h.get(w);
|
|
1313
|
+
const b = f(async () => {
|
|
1310
1314
|
try {
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1313
|
-
`).map((
|
|
1315
|
+
const A = w.includes("?") ? w.slice(0, w.indexOf("?")) : w, d = Ht.relative(e, A).replace(/\\/g, "/"), { stdout: $ } = await hs(`git log --follow -n ${r} --format=%at -- "${d}"`, { cwd: e });
|
|
1316
|
+
return $.trim() ? $.trim().split(`
|
|
1317
|
+
`).map((N) => parseInt(N, 10) * 1e3) : [];
|
|
1314
1318
|
} catch {
|
|
1315
1319
|
return [];
|
|
1316
1320
|
}
|
|
1317
1321
|
});
|
|
1318
|
-
return
|
|
1319
|
-
},
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
for (const
|
|
1325
|
-
if (
|
|
1322
|
+
return h.set(w, b), b;
|
|
1323
|
+
}, u = (w, b) => {
|
|
1324
|
+
if (b.has(w)) return;
|
|
1325
|
+
b.add(w);
|
|
1326
|
+
const A = this.getModuleInfo(w);
|
|
1327
|
+
if (A)
|
|
1328
|
+
for (const d of A.importedIds) {
|
|
1329
|
+
if (d.includes("node_modules") || !d.startsWith(e))
|
|
1326
1330
|
continue;
|
|
1327
|
-
const
|
|
1328
|
-
c.some((
|
|
1331
|
+
const $ = d.slice(e.length).replace(/^\/?/, "").split("?")[0];
|
|
1332
|
+
c.some((N) => j($, N, { dot: !0 })) || u(d, b);
|
|
1329
1333
|
}
|
|
1330
|
-
},
|
|
1331
|
-
if (!
|
|
1334
|
+
}, g = [...this.getModuleIds()].filter((w) => {
|
|
1335
|
+
if (!w.startsWith(e))
|
|
1332
1336
|
return !1;
|
|
1333
|
-
const
|
|
1334
|
-
return typeof t == "string" ? j(
|
|
1337
|
+
const b = w.slice(e.length).replace(/^\//, "");
|
|
1338
|
+
return typeof t == "string" ? j(b, t, { dot: !0 }) : t.test(b);
|
|
1335
1339
|
});
|
|
1336
|
-
if (
|
|
1340
|
+
if (g.length === 0) {
|
|
1337
1341
|
console.warn("[lastModifiedPlugin] No MD files found in module graph");
|
|
1338
1342
|
return;
|
|
1339
1343
|
}
|
|
1340
1344
|
console.log("[lastModifiedPlugin] start collect entry files deps");
|
|
1341
|
-
let
|
|
1342
|
-
for (const
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
+
let y = /* @__PURE__ */ new Map();
|
|
1346
|
+
for (const w of g) {
|
|
1347
|
+
const b = /* @__PURE__ */ new Set();
|
|
1348
|
+
u(w, b), y.set(w, b);
|
|
1345
1349
|
}
|
|
1346
|
-
if (console.log(`[lastModifiedPlugin] Analyzed ${
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1350
|
+
if (console.log(`[lastModifiedPlugin] Analyzed ${g.length} entry files`), typeof i.modifyDepMap == "function") {
|
|
1351
|
+
const w = await i.modifyDepMap(y);
|
|
1352
|
+
w && w instanceof Map && (y = w);
|
|
1349
1353
|
}
|
|
1350
|
-
const
|
|
1351
|
-
for (const
|
|
1352
|
-
for (const
|
|
1353
|
-
|
|
1354
|
-
await Promise.all([...
|
|
1355
|
-
for (const [
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1354
|
+
const E = /* @__PURE__ */ new Set();
|
|
1355
|
+
for (const w of y.values())
|
|
1356
|
+
for (const b of w)
|
|
1357
|
+
E.add(b);
|
|
1358
|
+
await Promise.all([...E].map(l));
|
|
1359
|
+
for (const [w, b] of y) {
|
|
1360
|
+
const A = w.slice(e.length).replace(/^\//, ""), d = (await Promise.all([...b].map(l))).flat(), $ = d.length > 0 ? Math.max(...d) : 0, N = as(d);
|
|
1361
|
+
a[A] = { lastmod: $, changefreq: N };
|
|
1358
1362
|
}
|
|
1359
1363
|
},
|
|
1360
|
-
|
|
1361
|
-
const { writeFileSync: a } = await import("./__vite-browser-external-BDMct_Gn.js");
|
|
1364
|
+
closeBundle() {
|
|
1362
1365
|
if (p || process.env.NODE_ENV !== "production")
|
|
1363
1366
|
return;
|
|
1364
|
-
const h = Object.fromEntries(Object.entries(
|
|
1365
|
-
|
|
1367
|
+
const h = Object.fromEntries(Object.entries(a).sort(([f], [l]) => f.localeCompare(l)));
|
|
1368
|
+
Xt(s, JSON.stringify(h, null, 2), "utf8"), console.log(`[lastModifiedPlugin] Written ${s}`);
|
|
1366
1369
|
}
|
|
1367
1370
|
};
|
|
1368
1371
|
}
|
|
1369
1372
|
export {
|
|
1370
|
-
|
|
1373
|
+
ws as g,
|
|
1371
1374
|
j as m
|
|
1372
1375
|
};
|