opfs-worker 0.5.0 → 1.0.0
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/assets/worker-XHCzp1qX.js.map +1 -0
- package/dist/{helpers-Bm2TWyPQ.js → helpers-CTCvNFs1.js} +215 -150
- package/dist/{helpers-Bm2TWyPQ.js.map → helpers-CTCvNFs1.js.map} +1 -1
- package/dist/helpers-Cvjm0f_r.cjs +4 -0
- package/dist/{helpers-BoLdVbGk.cjs.map → helpers-Cvjm0f_r.cjs.map} +1 -1
- package/dist/index.cjs +302 -229
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +330 -255
- package/dist/index.js.map +1 -1
- package/dist/raw.cjs +1 -1
- package/dist/raw.cjs.map +1 -1
- package/dist/raw.js +110 -100
- package/dist/raw.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/encoder.d.ts +2 -1
- package/dist/utils/encoder.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +22 -3
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/worker.d.ts +14 -7
- package/dist/worker.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/assets/worker-3SMz_DAt.js.map +0 -1
- package/dist/helpers-BoLdVbGk.cjs +0 -4
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
class
|
|
1
|
+
class x extends Error {
|
|
2
2
|
constructor(t, e, n, i) {
|
|
3
3
|
super(t, { cause: i }), this.code = e, this.path = n, this.name = "OPFSError";
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
class rt extends
|
|
6
|
+
class rt extends x {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
super("OPFS is not supported in this browser", "OPFS_NOT_SUPPORTED", void 0, t);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class me extends x {
|
|
12
12
|
constructor(t) {
|
|
13
13
|
super("OPFS is not mounted", "OPFS_NOT_MOUNTED", void 0, t);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
class
|
|
16
|
+
class we extends x {
|
|
17
17
|
constructor(t, e, n) {
|
|
18
18
|
super(t, "INVALID_PATH", e, n);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
class ye extends
|
|
21
|
+
class ye extends x {
|
|
22
22
|
constructor(t, e) {
|
|
23
23
|
super(`File not found: ${t}`, "FILE_NOT_FOUND", t, e);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
class
|
|
26
|
+
class Ee extends x {
|
|
27
27
|
constructor(t, e) {
|
|
28
28
|
super(`Directory not found: ${t}`, "DIRECTORY_NOT_FOUND", t, e);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
class
|
|
31
|
+
class xe extends x {
|
|
32
32
|
constructor(t, e, n) {
|
|
33
33
|
super(`Permission denied for ${e} on: ${t}`, "PERMISSION_DENIED", t, n);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class Se extends
|
|
36
|
+
class Se extends x {
|
|
37
37
|
constructor(t, e, n) {
|
|
38
38
|
super(t, "STORAGE_ERROR", e, n);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
class
|
|
41
|
+
class be extends x {
|
|
42
42
|
constructor(t, e, n) {
|
|
43
43
|
super(`Operation timed out: ${t}`, "TIMEOUT_ERROR", e, n);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
const H = (s, t, e) => {
|
|
47
|
-
const n = s instanceof RegExp ?
|
|
47
|
+
const n = s instanceof RegExp ? W(s, e) : s, i = t instanceof RegExp ? W(t, e) : t, r = n !== null && i != null && ot(n, i, e);
|
|
48
48
|
return r && {
|
|
49
49
|
start: r[0],
|
|
50
50
|
end: r[1],
|
|
@@ -52,7 +52,7 @@ const H = (s, t, e) => {
|
|
|
52
52
|
body: e.slice(r[0] + n.length, r[1]),
|
|
53
53
|
post: e.slice(r[1] + i.length)
|
|
54
54
|
};
|
|
55
|
-
},
|
|
55
|
+
}, W = (s, t) => {
|
|
56
56
|
const e = t.match(s);
|
|
57
57
|
return e ? e[0] : null;
|
|
58
58
|
}, ot = (s, t, e) => {
|
|
@@ -77,10 +77,10 @@ const H = (s, t, e) => {
|
|
|
77
77
|
function L(s) {
|
|
78
78
|
return isNaN(s) ? s.charCodeAt(0) : parseInt(s, 10);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function wt(s) {
|
|
81
81
|
return s.replace(ft, Z).replace(pt, J).replace(dt, F).replace(gt, V).replace(mt, X);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function yt(s) {
|
|
84
84
|
return s.replace(ct, "\\").replace(at, "{").replace(ht, "}").replace(lt, ",").replace(ut, ".");
|
|
85
85
|
}
|
|
86
86
|
function Y(s) {
|
|
@@ -95,18 +95,18 @@ function Y(s) {
|
|
|
95
95
|
return r.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), t.push.apply(t, o), t;
|
|
96
96
|
}
|
|
97
97
|
function Et(s) {
|
|
98
|
-
return s ? (s.slice(0, 2) === "{}" && (s = "\\{\\}" + s.slice(2)), T(
|
|
98
|
+
return s ? (s.slice(0, 2) === "{}" && (s = "\\{\\}" + s.slice(2)), T(wt(s), !0).map(yt)) : [];
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function xt(s) {
|
|
101
101
|
return "{" + s + "}";
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function St(s) {
|
|
104
104
|
return /^-?0\d/.test(s);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function bt(s, t) {
|
|
107
107
|
return s <= t;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Ot(s, t) {
|
|
110
110
|
return s >= t;
|
|
111
111
|
}
|
|
112
112
|
function T(s, t) {
|
|
@@ -126,24 +126,24 @@ function T(s, t) {
|
|
|
126
126
|
let c;
|
|
127
127
|
if (h)
|
|
128
128
|
c = n.body.split(/\.\./);
|
|
129
|
-
else if (c = Y(n.body), c.length === 1 && c[0] !== void 0 && (c = T(c[0], !1).map(
|
|
129
|
+
else if (c = Y(n.body), c.length === 1 && c[0] !== void 0 && (c = T(c[0], !1).map(xt), c.length === 1))
|
|
130
130
|
return r.map((f) => n.pre + c[0] + f);
|
|
131
131
|
let p;
|
|
132
132
|
if (h && c[0] !== void 0 && c[1] !== void 0) {
|
|
133
133
|
const f = L(c[0]), u = L(c[1]), g = Math.max(c[0].length, c[1].length);
|
|
134
|
-
let d = c.length === 3 && c[2] !== void 0 ? Math.abs(L(c[2])) : 1, E =
|
|
135
|
-
u < f && (d *= -1, E =
|
|
136
|
-
const
|
|
134
|
+
let d = c.length === 3 && c[2] !== void 0 ? Math.abs(L(c[2])) : 1, E = bt;
|
|
135
|
+
u < f && (d *= -1, E = Ot);
|
|
136
|
+
const A = c.some(St);
|
|
137
137
|
p = [];
|
|
138
|
-
for (let
|
|
138
|
+
for (let S = f; E(S, u); S += d) {
|
|
139
139
|
let m;
|
|
140
140
|
if (a)
|
|
141
|
-
m = String.fromCharCode(
|
|
142
|
-
else if (m = String(
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
145
|
-
const P = new Array(
|
|
146
|
-
|
|
141
|
+
m = String.fromCharCode(S), m === "\\" && (m = "");
|
|
142
|
+
else if (m = String(S), A) {
|
|
143
|
+
const N = g - m.length;
|
|
144
|
+
if (N > 0) {
|
|
145
|
+
const P = new Array(N + 1).join("0");
|
|
146
|
+
S < 0 ? m = "-" + P + m.slice(1) : m = P + m;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
p.push(m);
|
|
@@ -161,12 +161,12 @@ function T(s, t) {
|
|
|
161
161
|
}
|
|
162
162
|
return e;
|
|
163
163
|
}
|
|
164
|
-
const
|
|
164
|
+
const vt = 1024 * 64, C = (s) => {
|
|
165
165
|
if (typeof s != "string")
|
|
166
166
|
throw new TypeError("invalid pattern");
|
|
167
|
-
if (s.length >
|
|
167
|
+
if (s.length > vt)
|
|
168
168
|
throw new TypeError("pattern is too long");
|
|
169
|
-
},
|
|
169
|
+
}, At = {
|
|
170
170
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
|
|
171
171
|
"[:alpha:]": ["\\p{L}\\p{Nl}", !0],
|
|
172
172
|
"[:ascii:]": ["\\x00-\\x7f", !1],
|
|
@@ -181,7 +181,7 @@ const bt = 1024 * 64, C = (s) => {
|
|
|
181
181
|
"[:upper:]": ["\\p{Lu}", !0],
|
|
182
182
|
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
|
|
183
183
|
"[:xdigit:]": ["A-Fa-f0-9", !1]
|
|
184
|
-
}, $ = (s) => s.replace(/[[\]\\-]/g, "\\$&"),
|
|
184
|
+
}, $ = (s) => s.replace(/[[\]\\-]/g, "\\$&"), Nt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), k = (s) => s.join(""), $t = (s, t) => {
|
|
185
185
|
const e = t;
|
|
186
186
|
if (s.charAt(e) !== "[")
|
|
187
187
|
throw new Error("not in a brace expression");
|
|
@@ -202,11 +202,11 @@ const bt = 1024 * 64, C = (s) => {
|
|
|
202
202
|
continue;
|
|
203
203
|
}
|
|
204
204
|
if (d === "[" && !h) {
|
|
205
|
-
for (const [E, [
|
|
205
|
+
for (const [E, [v, A, S]] of Object.entries(At))
|
|
206
206
|
if (s.startsWith(E, r)) {
|
|
207
207
|
if (p)
|
|
208
208
|
return ["$.", !1, s.length - e, !0];
|
|
209
|
-
r += E.length,
|
|
209
|
+
r += E.length, S ? i.push(v) : n.push(v), a = a || A;
|
|
210
210
|
continue t;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -230,12 +230,12 @@ const bt = 1024 * 64, C = (s) => {
|
|
|
230
230
|
return ["$.", !1, s.length - e, !0];
|
|
231
231
|
if (i.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !l) {
|
|
232
232
|
const d = n[0].length === 2 ? n[0].slice(-1) : n[0];
|
|
233
|
-
return [
|
|
233
|
+
return [Nt(d), !1, c - e, !1];
|
|
234
234
|
}
|
|
235
|
-
const f = "[" + (l ? "^" : "") +
|
|
235
|
+
const f = "[" + (l ? "^" : "") + k(n) + "]", u = "[" + (l ? "" : "^") + k(i) + "]";
|
|
236
236
|
return [n.length && i.length ? "(" + f + "|" + u + ")" : n.length ? f : u, a, c - e, !0];
|
|
237
|
-
}, M = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), Tt = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), z = (s) => Tt.has(s), Mt = "(?!(?:^|/)\\.\\.?(?:$|/))", R = "(?!\\.)", Pt = /* @__PURE__ */ new Set(["[", "."]), Rt = /* @__PURE__ */ new Set(["..", "."]), Ct = new Set("().*{}+?[]^$\\!"), Dt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"),
|
|
238
|
-
class
|
|
237
|
+
}, M = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"), Tt = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), z = (s) => Tt.has(s), Mt = "(?!(?:^|/)\\.\\.?(?:$|/))", R = "(?!\\.)", Pt = /* @__PURE__ */ new Set(["[", "."]), Rt = /* @__PURE__ */ new Set(["..", "."]), Ct = new Set("().*{}+?[]^$\\!"), Dt = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), j = "[^/]", _ = j + "*?", B = j + "+?";
|
|
238
|
+
class y {
|
|
239
239
|
type;
|
|
240
240
|
#s;
|
|
241
241
|
#n;
|
|
@@ -291,7 +291,7 @@ class w {
|
|
|
291
291
|
push(...t) {
|
|
292
292
|
for (const e of t)
|
|
293
293
|
if (e !== "") {
|
|
294
|
-
if (typeof e != "string" && !(e instanceof
|
|
294
|
+
if (typeof e != "string" && !(e instanceof y && e.#e === this))
|
|
295
295
|
throw new Error("invalid part: " + e);
|
|
296
296
|
this.#t.push(e);
|
|
297
297
|
}
|
|
@@ -310,7 +310,7 @@ class w {
|
|
|
310
310
|
const t = this.#e;
|
|
311
311
|
for (let e = 0; e < this.#o; e++) {
|
|
312
312
|
const n = t.#t[e];
|
|
313
|
-
if (!(n instanceof
|
|
313
|
+
if (!(n instanceof y && n.type === "!"))
|
|
314
314
|
return !1;
|
|
315
315
|
}
|
|
316
316
|
return !0;
|
|
@@ -329,7 +329,7 @@ class w {
|
|
|
329
329
|
typeof t == "string" ? this.push(t) : this.push(t.clone(this));
|
|
330
330
|
}
|
|
331
331
|
clone(t) {
|
|
332
|
-
const e = new
|
|
332
|
+
const e = new y(this.type, t);
|
|
333
333
|
for (const n of this.#t)
|
|
334
334
|
e.copyIn(n);
|
|
335
335
|
return e;
|
|
@@ -353,15 +353,15 @@ class w {
|
|
|
353
353
|
}
|
|
354
354
|
if (!i.noext && z(d) && t.charAt(u) === "(") {
|
|
355
355
|
e.push(g), g = "";
|
|
356
|
-
const E = new
|
|
357
|
-
u =
|
|
356
|
+
const E = new y(d, e);
|
|
357
|
+
u = y.#l(t, E, u, i), e.push(E);
|
|
358
358
|
continue;
|
|
359
359
|
}
|
|
360
360
|
g += d;
|
|
361
361
|
}
|
|
362
362
|
return e.push(g), u;
|
|
363
363
|
}
|
|
364
|
-
let l = n + 1, c = new
|
|
364
|
+
let l = n + 1, c = new y(null, e);
|
|
365
365
|
const p = [];
|
|
366
366
|
let f = "";
|
|
367
367
|
for (; l < t.length; ) {
|
|
@@ -379,12 +379,12 @@ class w {
|
|
|
379
379
|
}
|
|
380
380
|
if (z(u) && t.charAt(l) === "(") {
|
|
381
381
|
c.push(f), f = "";
|
|
382
|
-
const g = new
|
|
383
|
-
c.push(g), l =
|
|
382
|
+
const g = new y(u, c);
|
|
383
|
+
c.push(g), l = y.#l(t, g, l, i);
|
|
384
384
|
continue;
|
|
385
385
|
}
|
|
386
386
|
if (u === "|") {
|
|
387
|
-
c.push(f), f = "", p.push(c), c = new
|
|
387
|
+
c.push(f), f = "", p.push(c), c = new y(null, e);
|
|
388
388
|
continue;
|
|
389
389
|
}
|
|
390
390
|
if (u === ")")
|
|
@@ -394,8 +394,8 @@ class w {
|
|
|
394
394
|
return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], l;
|
|
395
395
|
}
|
|
396
396
|
static fromGlob(t, e = {}) {
|
|
397
|
-
const n = new
|
|
398
|
-
return
|
|
397
|
+
const n = new y(null, void 0, e);
|
|
398
|
+
return y.#l(t, n, 0, e), n;
|
|
399
399
|
}
|
|
400
400
|
// returns the regular expression if there's magic, or the unescaped
|
|
401
401
|
// string if not.
|
|
@@ -487,8 +487,8 @@ class w {
|
|
|
487
487
|
const e = t ?? !!this.#i.dot;
|
|
488
488
|
if (this.#s === this && this.#p(), !this.type) {
|
|
489
489
|
const h = this.isStart() && this.isEnd(), l = this.#t.map((u) => {
|
|
490
|
-
const [g, d, E,
|
|
491
|
-
return this.#n = this.#n || E, this.#r = this.#r ||
|
|
490
|
+
const [g, d, E, v] = typeof u == "string" ? y.#d(u, this.#n, h) : u.toRegExpSource(t);
|
|
491
|
+
return this.#n = this.#n || E, this.#r = this.#r || v, g;
|
|
492
492
|
}).join("");
|
|
493
493
|
let c = "";
|
|
494
494
|
if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && Rt.has(this.#t[0]))) {
|
|
@@ -565,7 +565,7 @@ class w {
|
|
|
565
565
|
continue;
|
|
566
566
|
}
|
|
567
567
|
if (h === "?") {
|
|
568
|
-
r +=
|
|
568
|
+
r += j, e = !0;
|
|
569
569
|
continue;
|
|
570
570
|
}
|
|
571
571
|
r += Dt(h);
|
|
@@ -573,7 +573,7 @@ class w {
|
|
|
573
573
|
return [r, M(t), !!e, o];
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
const Lt = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"),
|
|
576
|
+
const Lt = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"), w = (s, t, e = {}) => (C(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new D(t, e).match(s)), Ft = /^\*+([^+@!?\*\[\(]*)$/, jt = (s) => (t) => !t.startsWith(".") && t.endsWith(s), It = (s) => (t) => t.endsWith(s), Ut = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), Wt = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), kt = /^\*+\.\*+$/, zt = (s) => !s.startsWith(".") && s.includes("."), _t = (s) => s !== "." && s !== ".." && s.includes("."), Bt = /^\.\*+$/, qt = (s) => s !== "." && s !== ".." && s.startsWith("."), Gt = /^\*+$/, Ht = (s) => s.length !== 0 && !s.startsWith("."), Zt = (s) => s.length !== 0 && s !== "." && s !== "..", Jt = /^\?+([^+@!?\*\[\(]*)?$/, Vt = ([s, t = ""]) => {
|
|
577
577
|
const e = K([s]);
|
|
578
578
|
return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
|
|
579
579
|
}, Xt = ([s, t = ""]) => {
|
|
@@ -595,55 +595,55 @@ const Lt = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\]
|
|
|
595
595
|
win32: { sep: "\\" },
|
|
596
596
|
posix: { sep: "/" }
|
|
597
597
|
}, Qt = tt === "win32" ? q.win32.sep : q.posix.sep;
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
const te = "[^/]", ee = te + "*?", se = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", ne = "(?:(?!(?:\\/|^)\\.).)*?", ie = (s, t = {}) => (e) =>
|
|
602
|
-
|
|
603
|
-
const
|
|
598
|
+
w.sep = Qt;
|
|
599
|
+
const O = Symbol("globstar **");
|
|
600
|
+
w.GLOBSTAR = O;
|
|
601
|
+
const te = "[^/]", ee = te + "*?", se = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", ne = "(?:(?!(?:\\/|^)\\.).)*?", ie = (s, t = {}) => (e) => w(e, s, t);
|
|
602
|
+
w.filter = ie;
|
|
603
|
+
const b = (s, t = {}) => Object.assign({}, s, t), re = (s) => {
|
|
604
604
|
if (!s || typeof s != "object" || !Object.keys(s).length)
|
|
605
|
-
return
|
|
606
|
-
const t =
|
|
607
|
-
return Object.assign((n, i, r = {}) => t(n, i,
|
|
605
|
+
return w;
|
|
606
|
+
const t = w;
|
|
607
|
+
return Object.assign((n, i, r = {}) => t(n, i, b(s, r)), {
|
|
608
608
|
Minimatch: class extends t.Minimatch {
|
|
609
609
|
constructor(i, r = {}) {
|
|
610
|
-
super(i,
|
|
610
|
+
super(i, b(s, r));
|
|
611
611
|
}
|
|
612
612
|
static defaults(i) {
|
|
613
|
-
return t.defaults(
|
|
613
|
+
return t.defaults(b(s, i)).Minimatch;
|
|
614
614
|
}
|
|
615
615
|
},
|
|
616
616
|
AST: class extends t.AST {
|
|
617
617
|
/* c8 ignore start */
|
|
618
618
|
constructor(i, r, o = {}) {
|
|
619
|
-
super(i, r,
|
|
619
|
+
super(i, r, b(s, o));
|
|
620
620
|
}
|
|
621
621
|
/* c8 ignore stop */
|
|
622
622
|
static fromGlob(i, r = {}) {
|
|
623
|
-
return t.AST.fromGlob(i,
|
|
623
|
+
return t.AST.fromGlob(i, b(s, r));
|
|
624
624
|
}
|
|
625
625
|
},
|
|
626
|
-
unescape: (n, i = {}) => t.unescape(n,
|
|
627
|
-
escape: (n, i = {}) => t.escape(n,
|
|
628
|
-
filter: (n, i = {}) => t.filter(n,
|
|
629
|
-
defaults: (n) => t.defaults(
|
|
630
|
-
makeRe: (n, i = {}) => t.makeRe(n,
|
|
631
|
-
braceExpand: (n, i = {}) => t.braceExpand(n,
|
|
632
|
-
match: (n, i, r = {}) => t.match(n, i,
|
|
626
|
+
unescape: (n, i = {}) => t.unescape(n, b(s, i)),
|
|
627
|
+
escape: (n, i = {}) => t.escape(n, b(s, i)),
|
|
628
|
+
filter: (n, i = {}) => t.filter(n, b(s, i)),
|
|
629
|
+
defaults: (n) => t.defaults(b(s, n)),
|
|
630
|
+
makeRe: (n, i = {}) => t.makeRe(n, b(s, i)),
|
|
631
|
+
braceExpand: (n, i = {}) => t.braceExpand(n, b(s, i)),
|
|
632
|
+
match: (n, i, r = {}) => t.match(n, i, b(s, r)),
|
|
633
633
|
sep: t.sep,
|
|
634
|
-
GLOBSTAR:
|
|
634
|
+
GLOBSTAR: O
|
|
635
635
|
});
|
|
636
636
|
};
|
|
637
|
-
|
|
637
|
+
w.defaults = re;
|
|
638
638
|
const et = (s, t = {}) => (C(s), t.nobrace || !/\{(?:(?!\{).)*\}/.test(s) ? [s] : Et(s));
|
|
639
|
-
|
|
639
|
+
w.braceExpand = et;
|
|
640
640
|
const oe = (s, t = {}) => new D(s, t).makeRe();
|
|
641
|
-
|
|
641
|
+
w.makeRe = oe;
|
|
642
642
|
const ce = (s, t, e = {}) => {
|
|
643
643
|
const n = new D(t, e);
|
|
644
644
|
return s = s.filter((i) => n.match(i)), n.options.nonull && !s.length && s.push(t), s;
|
|
645
645
|
};
|
|
646
|
-
|
|
646
|
+
w.match = ce;
|
|
647
647
|
const G = /[?*]|[+@!]\(.*?\)|\[|\]/, ae = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
648
648
|
class D {
|
|
649
649
|
options;
|
|
@@ -872,10 +872,10 @@ class D {
|
|
|
872
872
|
matchOne(t, e, n = !1) {
|
|
873
873
|
const i = this.options;
|
|
874
874
|
if (this.isWindows) {
|
|
875
|
-
const d = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), E = !d && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]),
|
|
876
|
-
if (typeof
|
|
877
|
-
const [
|
|
878
|
-
|
|
875
|
+
const d = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), E = !d && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), v = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), A = !v && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), S = E ? 3 : d ? 0 : void 0, m = A ? 3 : v ? 0 : void 0;
|
|
876
|
+
if (typeof S == "number" && typeof m == "number") {
|
|
877
|
+
const [N, P] = [t[S], e[m]];
|
|
878
|
+
N.toLowerCase() === P.toLowerCase() && (e[m] = N, m > S ? e = e.slice(m) : S > m && (t = t.slice(S)));
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
const { optimizationLevel: r = 1 } = this.options;
|
|
@@ -885,7 +885,7 @@ class D {
|
|
|
885
885
|
var c = e[a], p = t[o];
|
|
886
886
|
if (this.debug(e, c, p), c === !1)
|
|
887
887
|
return !1;
|
|
888
|
-
if (c ===
|
|
888
|
+
if (c === O) {
|
|
889
889
|
this.debug("GLOBSTAR", [e, c, p]);
|
|
890
890
|
var f = o, u = a + 1;
|
|
891
891
|
if (u === l) {
|
|
@@ -927,12 +927,12 @@ globstar while`, t, f, e, u, g), this.matchOne(t.slice(f), e.slice(u), n))
|
|
|
927
927
|
C(t);
|
|
928
928
|
const e = this.options;
|
|
929
929
|
if (t === "**")
|
|
930
|
-
return
|
|
930
|
+
return O;
|
|
931
931
|
if (t === "")
|
|
932
932
|
return "";
|
|
933
933
|
let n, i = null;
|
|
934
|
-
(n = t.match(Gt)) ? i = e.dot ? Zt : Ht : (n = t.match(Ft)) ? i = (e.nocase ? e.dot ?
|
|
935
|
-
const r =
|
|
934
|
+
(n = t.match(Gt)) ? i = e.dot ? Zt : Ht : (n = t.match(Ft)) ? i = (e.nocase ? e.dot ? Wt : Ut : e.dot ? It : jt)(n[1]) : (n = t.match(Jt)) ? i = (e.nocase ? e.dot ? Xt : Vt : e.dot ? Yt : Kt)(n) : (n = t.match(kt)) ? i = e.dot ? _t : zt : (n = t.match(Bt)) && (i = qt);
|
|
935
|
+
const r = y.fromGlob(t, this.options).toMMPattern();
|
|
936
936
|
return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r;
|
|
937
937
|
}
|
|
938
938
|
makeRe() {
|
|
@@ -947,12 +947,12 @@ globstar while`, t, f, e, u, g), this.matchOne(t.slice(f), e.slice(u), n))
|
|
|
947
947
|
if (c instanceof RegExp)
|
|
948
948
|
for (const p of c.flags.split(""))
|
|
949
949
|
i.add(p);
|
|
950
|
-
return typeof c == "string" ? ae(c) : c ===
|
|
950
|
+
return typeof c == "string" ? ae(c) : c === O ? O : c._src;
|
|
951
951
|
});
|
|
952
952
|
return l.forEach((c, p) => {
|
|
953
953
|
const f = l[p + 1], u = l[p - 1];
|
|
954
|
-
c !==
|
|
955
|
-
}), l.filter((c) => c !==
|
|
954
|
+
c !== O || u === O || (u === void 0 ? f !== void 0 && f !== O ? l[p + 1] = "(?:\\/|" + n + "\\/)?" + f : l[p] = n : f === void 0 ? l[p - 1] = u + "(?:\\/|" + n + ")?" : f !== O && (l[p - 1] = u + "(?:\\/|\\/" + n + "\\/)" + f, l[p + 1] = O));
|
|
955
|
+
}), l.filter((c) => c !== O).join("/");
|
|
956
956
|
}).join("|");
|
|
957
957
|
const [o, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
958
958
|
r = "^" + o + r + a + "$", this.negate && (r = "^(?!" + r + ").+$");
|
|
@@ -992,13 +992,13 @@ globstar while`, t, f, e, u, g), this.matchOne(t.slice(f), e.slice(u), n))
|
|
|
992
992
|
return n.flipNegate ? !1 : this.negate;
|
|
993
993
|
}
|
|
994
994
|
static defaults(t) {
|
|
995
|
-
return
|
|
995
|
+
return w.defaults(t).Minimatch;
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
998
|
+
w.AST = y;
|
|
999
|
+
w.Minimatch = D;
|
|
1000
|
+
w.escape = Lt;
|
|
1001
|
+
w.unescape = M;
|
|
1002
1002
|
function he(s, t = "utf-8") {
|
|
1003
1003
|
switch (t) {
|
|
1004
1004
|
case "utf8":
|
|
@@ -1018,25 +1018,24 @@ function he(s, t = "utf-8") {
|
|
|
1018
1018
|
return Uint8Array.from(atob(s), (e) => e.charCodeAt(0));
|
|
1019
1019
|
case "hex":
|
|
1020
1020
|
if (!/^[\da-f]+$/i.test(s) || s.length % 2 !== 0)
|
|
1021
|
-
throw new
|
|
1021
|
+
throw new x("Invalid hex string", "INVALID_HEX_FORMAT");
|
|
1022
1022
|
return Uint8Array.from(s.match(/.{1,2}/g).map((e) => parseInt(e, 16)));
|
|
1023
1023
|
default:
|
|
1024
1024
|
return console.warn("Encoding not supported, falling back to UTF-8"), new TextEncoder().encode(s);
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function Ae(s, t = "utf-8") {
|
|
1028
1028
|
switch (t) {
|
|
1029
1029
|
case "utf8":
|
|
1030
1030
|
case "utf-8":
|
|
1031
1031
|
return new TextDecoder().decode(s);
|
|
1032
1032
|
case "utf16le":
|
|
1033
|
+
case "utf-16le":
|
|
1033
1034
|
case "ucs2":
|
|
1034
1035
|
case "ucs-2":
|
|
1035
1036
|
return ue(s);
|
|
1036
1037
|
case "latin1":
|
|
1037
1038
|
return String.fromCharCode(...s);
|
|
1038
|
-
case "binary":
|
|
1039
|
-
return String.fromCharCode(...s);
|
|
1040
1039
|
case "ascii":
|
|
1041
1040
|
return String.fromCharCode(...s.map((e) => e & 127));
|
|
1042
1041
|
case "base64":
|
|
@@ -1072,47 +1071,110 @@ function pe(s) {
|
|
|
1072
1071
|
t[e] = s.charCodeAt(e) & 127;
|
|
1073
1072
|
return t;
|
|
1074
1073
|
}
|
|
1075
|
-
|
|
1074
|
+
const de = [
|
|
1075
|
+
// Images
|
|
1076
|
+
".jpg",
|
|
1077
|
+
".jpeg",
|
|
1078
|
+
".png",
|
|
1079
|
+
".gif",
|
|
1080
|
+
".bmp",
|
|
1081
|
+
".webp",
|
|
1082
|
+
".svg",
|
|
1083
|
+
".ico",
|
|
1084
|
+
".tiff",
|
|
1085
|
+
".tga",
|
|
1086
|
+
// Audio
|
|
1087
|
+
".mp3",
|
|
1088
|
+
".wav",
|
|
1089
|
+
".ogg",
|
|
1090
|
+
".flac",
|
|
1091
|
+
".aac",
|
|
1092
|
+
".wma",
|
|
1093
|
+
".m4a",
|
|
1094
|
+
// Video
|
|
1095
|
+
".mp4",
|
|
1096
|
+
".avi",
|
|
1097
|
+
".mov",
|
|
1098
|
+
".wmv",
|
|
1099
|
+
".flv",
|
|
1100
|
+
".webm",
|
|
1101
|
+
".mkv",
|
|
1102
|
+
".m4v",
|
|
1103
|
+
// Documents
|
|
1104
|
+
".pdf",
|
|
1105
|
+
".doc",
|
|
1106
|
+
".docx",
|
|
1107
|
+
".xls",
|
|
1108
|
+
".xlsx",
|
|
1109
|
+
".ppt",
|
|
1110
|
+
".pptx",
|
|
1111
|
+
// Archives
|
|
1112
|
+
".zip",
|
|
1113
|
+
".rar",
|
|
1114
|
+
".7z",
|
|
1115
|
+
".tar",
|
|
1116
|
+
".gz",
|
|
1117
|
+
".bz2",
|
|
1118
|
+
// Executables
|
|
1119
|
+
".exe",
|
|
1120
|
+
".dll",
|
|
1121
|
+
".so",
|
|
1122
|
+
".dylib",
|
|
1123
|
+
".bin",
|
|
1124
|
+
// Other binary formats
|
|
1125
|
+
".dat",
|
|
1126
|
+
".db",
|
|
1127
|
+
".sqlite",
|
|
1128
|
+
".bin",
|
|
1129
|
+
".obj",
|
|
1130
|
+
".fbx",
|
|
1131
|
+
".3ds"
|
|
1132
|
+
];
|
|
1133
|
+
function Ne(s) {
|
|
1134
|
+
const t = s.toLowerCase().substring(s.lastIndexOf("."));
|
|
1135
|
+
return de.includes(t);
|
|
1136
|
+
}
|
|
1137
|
+
function $e() {
|
|
1076
1138
|
if (!("storage" in navigator) || !("getDirectory" in navigator.storage))
|
|
1077
1139
|
throw new rt();
|
|
1078
1140
|
}
|
|
1079
|
-
async function
|
|
1141
|
+
async function I(s, t, e) {
|
|
1080
1142
|
return typeof navigator < "u" && navigator.locks?.request ? navigator.locks.request(`opfs:${s.replace(/\/+/g, "/").toLowerCase()}`, { mode: t }, e) : e();
|
|
1081
1143
|
}
|
|
1082
|
-
function
|
|
1144
|
+
function U(s) {
|
|
1083
1145
|
return Array.isArray(s) ? s : (s.startsWith("~/") ? s.slice(2) : s).split("/").filter(Boolean);
|
|
1084
1146
|
}
|
|
1085
1147
|
function st(s) {
|
|
1086
1148
|
return typeof s == "string" ? s ?? "/" : `/${s.join("/")}`;
|
|
1087
1149
|
}
|
|
1088
1150
|
function nt(s) {
|
|
1089
|
-
const t =
|
|
1151
|
+
const t = U(s);
|
|
1090
1152
|
return t[t.length - 1] || "";
|
|
1091
1153
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const t =
|
|
1154
|
+
function Te(s) {
|
|
1155
|
+
const t = U(s);
|
|
1094
1156
|
return t.pop(), st(t);
|
|
1095
1157
|
}
|
|
1096
1158
|
function it(s) {
|
|
1097
1159
|
return !s || s === "/" ? "/" : s.startsWith("~/") ? `/${s.slice(2)}` : s.startsWith("/") ? s : `/${s}`;
|
|
1098
1160
|
}
|
|
1099
|
-
function
|
|
1161
|
+
function Me(s, t = !1) {
|
|
1100
1162
|
return s = s.replace(/\/$/, ""), t && !s.includes("*") ? `${s}/**` : s;
|
|
1101
1163
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1164
|
+
function Pe(s, t) {
|
|
1165
|
+
return w(s, t, {
|
|
1104
1166
|
dot: !0,
|
|
1105
1167
|
matchBase: !0
|
|
1106
1168
|
});
|
|
1107
1169
|
}
|
|
1108
|
-
function
|
|
1170
|
+
function Re(s, t) {
|
|
1109
1171
|
if (!t || Array.isArray(t) && t.length === 0)
|
|
1110
1172
|
return !1;
|
|
1111
1173
|
const e = it(s);
|
|
1112
|
-
return (Array.isArray(t) ? t : [t]).some((i) =>
|
|
1174
|
+
return (Array.isArray(t) ? t : [t]).some((i) => w(e, i, { dot: !0 }));
|
|
1113
1175
|
}
|
|
1114
|
-
function
|
|
1115
|
-
const t = it(s), e =
|
|
1176
|
+
function Ce(s) {
|
|
1177
|
+
const t = it(s), e = U(t), n = [];
|
|
1116
1178
|
for (const i of e)
|
|
1117
1179
|
if (!(i === "." || i === ""))
|
|
1118
1180
|
if (i === "..") {
|
|
@@ -1123,31 +1185,31 @@ function Pe(s) {
|
|
|
1123
1185
|
n.push(i);
|
|
1124
1186
|
return st(n);
|
|
1125
1187
|
}
|
|
1126
|
-
function
|
|
1188
|
+
function De(s) {
|
|
1127
1189
|
const t = nt(s), e = t.lastIndexOf(".");
|
|
1128
1190
|
return e <= 0 || e === t.length - 1 ? "" : t.slice(e);
|
|
1129
1191
|
}
|
|
1130
|
-
function
|
|
1192
|
+
function ge(s, t = "utf-8") {
|
|
1131
1193
|
return typeof s == "string" ? he(s, t) : s instanceof Uint8Array ? s : new Uint8Array(s);
|
|
1132
1194
|
}
|
|
1133
|
-
async function
|
|
1134
|
-
return
|
|
1195
|
+
async function Le(s, t) {
|
|
1196
|
+
return I(t, "shared", async () => {
|
|
1135
1197
|
const n = await (await s.getFile()).arrayBuffer();
|
|
1136
1198
|
return new Uint8Array(n);
|
|
1137
1199
|
});
|
|
1138
1200
|
}
|
|
1139
|
-
async function
|
|
1201
|
+
async function Fe(s, t, e, n, i = {}) {
|
|
1140
1202
|
const r = async () => {
|
|
1141
1203
|
let o = null;
|
|
1142
|
-
const a =
|
|
1204
|
+
const a = i.append || !1, h = !a && (i.truncate ?? !0);
|
|
1143
1205
|
try {
|
|
1144
1206
|
o = await s.createSyncAccessHandle();
|
|
1145
|
-
const l =
|
|
1207
|
+
const l = ge(t, e), c = a ? o.getSize() : 0;
|
|
1146
1208
|
o.write(l, { at: c }), h && o.truncate(l.byteLength), o.flush();
|
|
1147
1209
|
} catch (l) {
|
|
1148
1210
|
console.error(l);
|
|
1149
1211
|
const c = a ? "append" : "write";
|
|
1150
|
-
throw new
|
|
1212
|
+
throw new x(`Failed to ${c} file`, `${c.toUpperCase()}_FAILED`, void 0, l);
|
|
1151
1213
|
} finally {
|
|
1152
1214
|
try {
|
|
1153
1215
|
o?.close();
|
|
@@ -1155,15 +1217,15 @@ async function De(s, t, e, n = {}, i) {
|
|
|
1155
1217
|
}
|
|
1156
1218
|
}
|
|
1157
1219
|
};
|
|
1158
|
-
return
|
|
1220
|
+
return n ? I(n, "exclusive", r) : r();
|
|
1159
1221
|
}
|
|
1160
|
-
async function
|
|
1222
|
+
async function je(s, t = "SHA-1", e = 50 * 1024 * 1024) {
|
|
1161
1223
|
if (s instanceof File && (s = await s.arrayBuffer()), s.byteLength > e)
|
|
1162
1224
|
throw new Error(`File size ${s.byteLength} bytes exceeds maximum allowed size ${e} bytes`);
|
|
1163
1225
|
const n = new Uint8Array(s), i = await crypto.subtle.digest(t, n);
|
|
1164
1226
|
return Array.from(new Uint8Array(i)).map((o) => o.toString(16).padStart(2, "0")).join("");
|
|
1165
1227
|
}
|
|
1166
|
-
function
|
|
1228
|
+
function Ie(s, t) {
|
|
1167
1229
|
if (s.length !== t.length)
|
|
1168
1230
|
return !1;
|
|
1169
1231
|
for (let e = 0; e < s.length; e++)
|
|
@@ -1177,48 +1239,51 @@ async function Ue(s) {
|
|
|
1177
1239
|
}
|
|
1178
1240
|
async function We(s, t, e = {}) {
|
|
1179
1241
|
const n = nt(t);
|
|
1180
|
-
return
|
|
1242
|
+
return I(t, "exclusive", async () => {
|
|
1181
1243
|
const i = e.recursive ?? !1, r = e.force ?? !1;
|
|
1244
|
+
e.useTrash;
|
|
1182
1245
|
try {
|
|
1183
1246
|
await s.removeEntry(n, { recursive: i });
|
|
1184
1247
|
} catch (o) {
|
|
1185
1248
|
if (o.name === "NotFoundError") {
|
|
1186
1249
|
if (!r)
|
|
1187
|
-
throw new
|
|
1188
|
-
} else throw o.name === "InvalidModificationError" ? new
|
|
1250
|
+
throw new x(`No such file or directory: ${t}`, "ENOENT", void 0, o);
|
|
1251
|
+
} else throw o.name === "InvalidModificationError" ? new x(`Directory not empty: ${t}. Use recursive option to force removal.`, "ENOTEMPTY", void 0, o) : o.name === "TypeMismatchError" && !i ? new x(`Cannot remove directory without recursive option: ${t}`, "EISDIR", void 0, o) : new x(`Failed to remove entry: ${t}`, "RM_FAILED", void 0, o);
|
|
1189
1252
|
}
|
|
1190
1253
|
});
|
|
1191
1254
|
}
|
|
1192
1255
|
export {
|
|
1193
|
-
|
|
1256
|
+
de as B,
|
|
1257
|
+
Ee as D,
|
|
1194
1258
|
ye as F,
|
|
1195
|
-
|
|
1196
|
-
|
|
1259
|
+
x as O,
|
|
1260
|
+
we as P,
|
|
1197
1261
|
Se as S,
|
|
1198
|
-
|
|
1262
|
+
be as T,
|
|
1199
1263
|
rt as a,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1264
|
+
me as b,
|
|
1265
|
+
xe as c,
|
|
1266
|
+
$e as d,
|
|
1203
1267
|
nt as e,
|
|
1204
|
-
|
|
1205
|
-
|
|
1268
|
+
Te as f,
|
|
1269
|
+
Me as g,
|
|
1206
1270
|
Re as h,
|
|
1207
|
-
|
|
1271
|
+
Ne as i,
|
|
1208
1272
|
st as j,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1273
|
+
De as k,
|
|
1274
|
+
ge as l,
|
|
1275
|
+
Pe as m,
|
|
1212
1276
|
it as n,
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1277
|
+
Le as o,
|
|
1278
|
+
Fe as p,
|
|
1279
|
+
je as q,
|
|
1280
|
+
Ce as r,
|
|
1281
|
+
U as s,
|
|
1282
|
+
Ie as t,
|
|
1283
|
+
Ue as u,
|
|
1284
|
+
We as v,
|
|
1285
|
+
I as w,
|
|
1286
|
+
he as x,
|
|
1287
|
+
Ae as y
|
|
1223
1288
|
};
|
|
1224
|
-
//# sourceMappingURL=helpers-
|
|
1289
|
+
//# sourceMappingURL=helpers-CTCvNFs1.js.map
|