@weapp-tailwindcss/shared 1.1.3-alpha.1 → 2.0.0-next.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/README.md +4 -5
- package/dist/chunk-8l464Juk.js +28 -0
- package/dist/extractors.d.ts +3 -2
- package/dist/extractors.js +28 -35
- package/dist/extractors.mjs +25 -35
- package/dist/index.d.ts +9 -16
- package/dist/index.js +75 -477
- package/dist/index.mjs +51 -477
- package/dist/node.d.ts +4 -3
- package/dist/node.js +464 -24
- package/dist/node.mjs +460 -24
- package/package.json +8 -3
- package/dist/chunk-5F5YENBW.js +0 -41
- package/dist/chunk-7QA6IUZF.mjs +0 -43
- package/dist/extractors.d.mts +0 -5
- package/dist/index.d.mts +0 -30
- package/dist/node.d.mts +0 -6
package/dist/node.js
CHANGED
|
@@ -1,28 +1,468 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("./chunk-8l464Juk.js");
|
|
3
|
+
let node_crypto = require("node:crypto");
|
|
4
|
+
node_crypto = require_chunk.__toESM(node_crypto);
|
|
5
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
6
|
+
let _lazyMatch = () => {
|
|
7
|
+
var __lib__ = (() => {
|
|
8
|
+
var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
|
|
9
|
+
for (var n in e) m(r, n, {
|
|
10
|
+
get: e[n],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
}, H = (r, e, n, a) => {
|
|
14
|
+
if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, {
|
|
15
|
+
get: () => e[t],
|
|
16
|
+
enumerable: !(a = V(e, t)) || a.enumerable
|
|
17
|
+
});
|
|
18
|
+
return r;
|
|
19
|
+
}, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
|
|
20
|
+
q(w, { default: () => re });
|
|
21
|
+
var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
|
|
22
|
+
const e = /* @__PURE__ */ new Map();
|
|
23
|
+
return (n) => {
|
|
24
|
+
const a = e.get(n);
|
|
25
|
+
if (a) return a;
|
|
26
|
+
const t = r(n);
|
|
27
|
+
return e.set(n, t), t;
|
|
28
|
+
};
|
|
29
|
+
}, rr = (r, e, n = {}) => {
|
|
30
|
+
const a = {
|
|
31
|
+
cache: {},
|
|
32
|
+
input: r,
|
|
33
|
+
index: 0,
|
|
34
|
+
indexMax: 0,
|
|
35
|
+
options: n,
|
|
36
|
+
output: []
|
|
37
|
+
};
|
|
38
|
+
if (v(e)(a) && a.index === r.length) return a.output;
|
|
39
|
+
throw new Error(`Failed to parse at index ${a.indexMax}`);
|
|
40
|
+
}, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
|
|
41
|
+
const n = {};
|
|
42
|
+
for (const a of r) {
|
|
43
|
+
if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
|
|
44
|
+
const t = a.charCodeAt(0);
|
|
45
|
+
n[t] = true;
|
|
46
|
+
}
|
|
47
|
+
return (a) => {
|
|
48
|
+
const t = a.index, o = a.input;
|
|
49
|
+
for (; a.index < o.length && o.charCodeAt(a.index) in n;) a.index += 1;
|
|
50
|
+
const u = a.index;
|
|
51
|
+
if (u > t) {
|
|
52
|
+
if (!h(e) && !a.options.silent) {
|
|
53
|
+
const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
|
|
54
|
+
h(c) || a.output.push(c);
|
|
55
|
+
}
|
|
56
|
+
a.indexMax = Math.max(a.indexMax, a.index);
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
};
|
|
60
|
+
}, nr = (r, e) => {
|
|
61
|
+
const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
|
|
62
|
+
return g((o) => {
|
|
63
|
+
t.lastIndex = o.index;
|
|
64
|
+
const u = t.exec(o.input);
|
|
65
|
+
if (u) {
|
|
66
|
+
if (!h(e) && !o.options.silent) {
|
|
67
|
+
const s = d(e) ? e(...u, o.input, String(o.index)) : e;
|
|
68
|
+
h(s) || o.output.push(s);
|
|
69
|
+
}
|
|
70
|
+
return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
|
|
71
|
+
} else return false;
|
|
72
|
+
});
|
|
73
|
+
}, ar = (r, e) => (n) => {
|
|
74
|
+
if (n.input.startsWith(r, n.index)) {
|
|
75
|
+
if (!h(e) && !n.options.silent) {
|
|
76
|
+
const t = d(e) ? e(r, n.input, String(n.index)) : e;
|
|
77
|
+
h(t) || n.output.push(t);
|
|
78
|
+
}
|
|
79
|
+
return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
|
|
80
|
+
} else return false;
|
|
81
|
+
}, C = (r, e, n, a) => {
|
|
82
|
+
const t = v(r);
|
|
83
|
+
return g(_(M((o) => {
|
|
84
|
+
let u = 0;
|
|
85
|
+
for (; u < n;) {
|
|
86
|
+
const s = o.index;
|
|
87
|
+
if (!t(o) || (u += 1, o.index === s)) break;
|
|
88
|
+
}
|
|
89
|
+
return u >= e;
|
|
90
|
+
})));
|
|
91
|
+
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, Infinity), x = (r, e) => {
|
|
92
|
+
const n = r.map(v);
|
|
93
|
+
return g(_(M((a) => {
|
|
94
|
+
for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
|
|
95
|
+
return true;
|
|
96
|
+
})));
|
|
97
|
+
}, l = (r, e) => {
|
|
98
|
+
const n = r.map(v);
|
|
99
|
+
return g(_((a) => {
|
|
100
|
+
for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return true;
|
|
101
|
+
return false;
|
|
102
|
+
}));
|
|
103
|
+
}, M = (r, e = false) => {
|
|
104
|
+
const n = v(r);
|
|
105
|
+
return (a) => {
|
|
106
|
+
const t = a.index, o = a.output.length, u = n(a);
|
|
107
|
+
return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
|
|
108
|
+
};
|
|
109
|
+
}, _ = (r, e) => {
|
|
110
|
+
return v(r);
|
|
111
|
+
}, g = (() => {
|
|
112
|
+
let r = 0;
|
|
113
|
+
return (e) => {
|
|
114
|
+
const n = v(e), a = r += 1;
|
|
115
|
+
return (t) => {
|
|
116
|
+
var o;
|
|
117
|
+
if (t.options.memoization === false) return n(t);
|
|
118
|
+
const u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
|
|
119
|
+
if (c === false) return false;
|
|
120
|
+
if (W(c)) return t.index = c, true;
|
|
121
|
+
if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), true;
|
|
122
|
+
{
|
|
123
|
+
const Z = t.output.length;
|
|
124
|
+
if (n(t)) {
|
|
125
|
+
const D = t.index, U = t.output.length;
|
|
126
|
+
if (U > Z) {
|
|
127
|
+
const ee = t.output.slice(Z, U);
|
|
128
|
+
s.set(u, {
|
|
129
|
+
index: D,
|
|
130
|
+
output: ee
|
|
131
|
+
});
|
|
132
|
+
} else s.set(u, D);
|
|
133
|
+
return true;
|
|
134
|
+
} else return s.set(u, false), false;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
})(), E = (r) => {
|
|
139
|
+
let e;
|
|
140
|
+
return (n) => (e || (e = v(r())), e(n));
|
|
141
|
+
}, v = Y((r) => {
|
|
142
|
+
if (d(r)) return Q(r) ? E(r) : r;
|
|
143
|
+
if (b(r) || X(r)) return i(r);
|
|
144
|
+
if (A(r)) return x(r);
|
|
145
|
+
if (K(r)) return l(Object.values(r));
|
|
146
|
+
throw new Error("Invalid rule");
|
|
147
|
+
}), P = "abcdefghijklmnopqrstuvwxyz", ir = (r) => {
|
|
148
|
+
let e = "";
|
|
149
|
+
for (; r > 0;) e = P[(r - 1) % 26] + e, r = Math.floor((r - 1) / 26);
|
|
150
|
+
return e;
|
|
151
|
+
}, O = (r) => {
|
|
152
|
+
let e = 0;
|
|
153
|
+
for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
|
|
154
|
+
return e;
|
|
155
|
+
}, S = (r, e) => {
|
|
156
|
+
if (e < r) return S(e, r);
|
|
157
|
+
const n = [];
|
|
158
|
+
for (; r <= e;) n.push(r++);
|
|
159
|
+
return n;
|
|
160
|
+
}, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
|
|
161
|
+
const e = {};
|
|
162
|
+
return (n) => e[n] ?? (e[n] = r(n));
|
|
163
|
+
}, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), fr = l([i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), i(/^(!!)+/, "")]), j = l([
|
|
164
|
+
i(/\/(\*\*\/)+/, "(?:/.+/|/)"),
|
|
165
|
+
i(/^(\*\*\/)+/, "(?:^|.*/)"),
|
|
166
|
+
i(/\/(\*\*)$/, "(?:/.*|$)"),
|
|
167
|
+
i(/\*\*/, ".*")
|
|
168
|
+
]), N = l([i(/\*\/(?!\*\*\/)/, "[^/]*/"), i(/\*/, "[^/]*")]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Er = l([
|
|
169
|
+
y,
|
|
170
|
+
i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`),
|
|
171
|
+
br,
|
|
172
|
+
i(/[^\]]/, p)
|
|
173
|
+
]), B = x([
|
|
174
|
+
$r,
|
|
175
|
+
tr(Ar),
|
|
176
|
+
f(Er),
|
|
177
|
+
wr
|
|
178
|
+
]), Pr = i("{", "(?:"), Or = i("}", ")"), I = x([
|
|
179
|
+
Pr,
|
|
180
|
+
l([
|
|
181
|
+
i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")),
|
|
182
|
+
i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")),
|
|
183
|
+
i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase())
|
|
184
|
+
]),
|
|
185
|
+
Or
|
|
186
|
+
]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), F = x([
|
|
187
|
+
kr,
|
|
188
|
+
f(l([
|
|
189
|
+
j,
|
|
190
|
+
N,
|
|
191
|
+
k,
|
|
192
|
+
B,
|
|
193
|
+
I,
|
|
194
|
+
E(() => F),
|
|
195
|
+
y,
|
|
196
|
+
Fr,
|
|
197
|
+
Ir,
|
|
198
|
+
Lr
|
|
199
|
+
])),
|
|
200
|
+
Br
|
|
201
|
+
]), L = z(f(l([
|
|
202
|
+
sr,
|
|
203
|
+
cr,
|
|
204
|
+
lr,
|
|
205
|
+
fr,
|
|
206
|
+
j,
|
|
207
|
+
N,
|
|
208
|
+
k,
|
|
209
|
+
B,
|
|
210
|
+
I,
|
|
211
|
+
F,
|
|
212
|
+
y,
|
|
213
|
+
pr,
|
|
214
|
+
vr
|
|
215
|
+
]))), Tr = i(/\\./, p), qr = i(/./, p), Yr = z(f(l([
|
|
216
|
+
Tr,
|
|
217
|
+
i(/\*\*\*+/, "*"),
|
|
218
|
+
i(/([^/{[(!])\*\*/, (r, e) => `${e}*`),
|
|
219
|
+
i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`),
|
|
220
|
+
qr
|
|
221
|
+
]))), $ = (r, e) => {
|
|
222
|
+
const n = Array.isArray(r) ? r : [r];
|
|
223
|
+
if (!n.length) return false;
|
|
224
|
+
const a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
|
|
225
|
+
return a.some((s) => s.test(o));
|
|
226
|
+
};
|
|
227
|
+
$.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
|
|
228
|
+
var re = $;
|
|
229
|
+
return J(w);
|
|
230
|
+
})();
|
|
231
|
+
return __lib__.default || __lib__;
|
|
232
|
+
};
|
|
233
|
+
let _match;
|
|
234
|
+
const zeptomatch = (path, pattern) => {
|
|
235
|
+
if (!_match) {
|
|
236
|
+
_match = _lazyMatch();
|
|
237
|
+
_lazyMatch = null;
|
|
238
|
+
}
|
|
239
|
+
return _match(path, pattern);
|
|
240
|
+
};
|
|
241
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
242
|
+
function normalizeWindowsPath(input = "") {
|
|
243
|
+
if (!input) return input;
|
|
244
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
245
|
+
}
|
|
246
|
+
const _UNC_REGEX = /^[/\\]{2}/;
|
|
247
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
248
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
249
|
+
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
250
|
+
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
251
|
+
const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
252
|
+
const normalize = function(path) {
|
|
253
|
+
if (path.length === 0) return ".";
|
|
254
|
+
path = normalizeWindowsPath(path);
|
|
255
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
256
|
+
const isPathAbsolute = isAbsolute(path);
|
|
257
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
258
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
259
|
+
if (path.length === 0) {
|
|
260
|
+
if (isPathAbsolute) return "/";
|
|
261
|
+
return trailingSeparator ? "./" : ".";
|
|
262
|
+
}
|
|
263
|
+
if (trailingSeparator) path += "/";
|
|
264
|
+
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
265
|
+
if (isUNCPath) {
|
|
266
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
267
|
+
return `//${path}`;
|
|
268
|
+
}
|
|
269
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
270
|
+
};
|
|
271
|
+
const join = function(...segments) {
|
|
272
|
+
let path = "";
|
|
273
|
+
for (const seg of segments) {
|
|
274
|
+
if (!seg) continue;
|
|
275
|
+
if (path.length > 0) {
|
|
276
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
277
|
+
const segLeading = seg[0] === "/";
|
|
278
|
+
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
279
|
+
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
280
|
+
} else path += seg;
|
|
281
|
+
}
|
|
282
|
+
return normalize(path);
|
|
283
|
+
};
|
|
284
|
+
function cwd() {
|
|
285
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
286
|
+
return "/";
|
|
287
|
+
}
|
|
288
|
+
const resolve = function(...arguments_) {
|
|
289
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
290
|
+
let resolvedPath = "";
|
|
291
|
+
let resolvedAbsolute = false;
|
|
292
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
293
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
294
|
+
if (!path || path.length === 0) continue;
|
|
295
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
296
|
+
resolvedAbsolute = isAbsolute(path);
|
|
297
|
+
}
|
|
298
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
299
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
300
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
301
|
+
};
|
|
302
|
+
function normalizeString(path, allowAboveRoot) {
|
|
303
|
+
let res = "";
|
|
304
|
+
let lastSegmentLength = 0;
|
|
305
|
+
let lastSlash = -1;
|
|
306
|
+
let dots = 0;
|
|
307
|
+
let char = null;
|
|
308
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
309
|
+
if (index < path.length) char = path[index];
|
|
310
|
+
else if (char === "/") break;
|
|
311
|
+
else char = "/";
|
|
312
|
+
if (char === "/") {
|
|
313
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
314
|
+
else if (dots === 2) {
|
|
315
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
316
|
+
if (res.length > 2) {
|
|
317
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
318
|
+
if (lastSlashIndex === -1) {
|
|
319
|
+
res = "";
|
|
320
|
+
lastSegmentLength = 0;
|
|
321
|
+
} else {
|
|
322
|
+
res = res.slice(0, lastSlashIndex);
|
|
323
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
324
|
+
}
|
|
325
|
+
lastSlash = index;
|
|
326
|
+
dots = 0;
|
|
327
|
+
continue;
|
|
328
|
+
} else if (res.length > 0) {
|
|
329
|
+
res = "";
|
|
330
|
+
lastSegmentLength = 0;
|
|
331
|
+
lastSlash = index;
|
|
332
|
+
dots = 0;
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (allowAboveRoot) {
|
|
337
|
+
res += res.length > 0 ? "/.." : "..";
|
|
338
|
+
lastSegmentLength = 2;
|
|
339
|
+
}
|
|
340
|
+
} else {
|
|
341
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
342
|
+
else res = path.slice(lastSlash + 1, index);
|
|
343
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
344
|
+
}
|
|
345
|
+
lastSlash = index;
|
|
346
|
+
dots = 0;
|
|
347
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
348
|
+
else dots = -1;
|
|
349
|
+
}
|
|
350
|
+
return res;
|
|
351
|
+
}
|
|
352
|
+
const isAbsolute = function(p) {
|
|
353
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
354
|
+
};
|
|
355
|
+
const toNamespacedPath = function(p) {
|
|
356
|
+
return normalizeWindowsPath(p);
|
|
357
|
+
};
|
|
358
|
+
const extname = function(p) {
|
|
359
|
+
if (p === "..") return "";
|
|
360
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
361
|
+
return match && match[1] || "";
|
|
362
|
+
};
|
|
363
|
+
const relative = function(from, to) {
|
|
364
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
365
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
366
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
|
|
367
|
+
const _fromCopy = [..._from];
|
|
368
|
+
for (const segment of _fromCopy) {
|
|
369
|
+
if (_to[0] !== segment) break;
|
|
370
|
+
_from.shift();
|
|
371
|
+
_to.shift();
|
|
372
|
+
}
|
|
373
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
374
|
+
};
|
|
375
|
+
const dirname = function(p) {
|
|
376
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
377
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
378
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
379
|
+
};
|
|
380
|
+
const format = function(p) {
|
|
381
|
+
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
382
|
+
const segments = [
|
|
383
|
+
p.root,
|
|
384
|
+
p.dir,
|
|
385
|
+
p.base ?? (p.name ?? "") + ext
|
|
386
|
+
].filter(Boolean);
|
|
387
|
+
return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
|
|
388
|
+
};
|
|
389
|
+
const basename = function(p, extension) {
|
|
390
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
391
|
+
let lastSegment = "";
|
|
392
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
393
|
+
const val = segments[i];
|
|
394
|
+
if (val) {
|
|
395
|
+
lastSegment = val;
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
400
|
+
};
|
|
401
|
+
const parse = function(p) {
|
|
402
|
+
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
403
|
+
const base = basename(p);
|
|
404
|
+
const extension = extname(base);
|
|
405
|
+
return {
|
|
406
|
+
root,
|
|
407
|
+
dir: dirname(p),
|
|
408
|
+
base,
|
|
409
|
+
ext: extension,
|
|
410
|
+
name: base.slice(0, base.length - extension.length)
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
const matchesGlob = (path, pattern) => {
|
|
414
|
+
return zeptomatch(pattern, normalize(path));
|
|
415
|
+
};
|
|
416
|
+
const _path = {
|
|
417
|
+
__proto__: null,
|
|
418
|
+
basename,
|
|
419
|
+
dirname,
|
|
420
|
+
extname,
|
|
421
|
+
format,
|
|
422
|
+
isAbsolute,
|
|
423
|
+
join,
|
|
424
|
+
matchesGlob,
|
|
425
|
+
normalize,
|
|
426
|
+
normalizeString,
|
|
427
|
+
parse,
|
|
428
|
+
relative,
|
|
429
|
+
resolve,
|
|
430
|
+
sep: "/",
|
|
431
|
+
toNamespacedPath
|
|
432
|
+
};
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
|
|
435
|
+
const delimiter = globalThis.process?.platform === "win32" ? ";" : ":";
|
|
436
|
+
const _platforms = {
|
|
437
|
+
posix: void 0,
|
|
438
|
+
win32: void 0
|
|
439
|
+
};
|
|
440
|
+
const mix = (del = delimiter) => {
|
|
441
|
+
return new Proxy(_path, { get(_, prop) {
|
|
442
|
+
if (prop === "delimiter") return del;
|
|
443
|
+
if (prop === "posix") return posix;
|
|
444
|
+
if (prop === "win32") return win32;
|
|
445
|
+
return _platforms[prop] || _path[prop];
|
|
446
|
+
} });
|
|
447
|
+
};
|
|
448
|
+
const posix = /* @__PURE__ */ mix(":");
|
|
449
|
+
const win32 = /* @__PURE__ */ mix(";");
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region src/node.ts
|
|
9
452
|
function md5(input) {
|
|
10
|
-
|
|
453
|
+
return node_crypto.default.createHash("md5").update(input).digest("hex");
|
|
11
454
|
}
|
|
12
455
|
function removeAllExtensions(filePath) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const dir = _pathe2.default.dirname(filePath);
|
|
23
|
-
return dir === "." ? baseName : _pathe2.default.join(dir, baseName);
|
|
456
|
+
if (!filePath) return "";
|
|
457
|
+
let baseName = posix.basename(filePath);
|
|
458
|
+
let ext = posix.extname(baseName);
|
|
459
|
+
while (ext) {
|
|
460
|
+
baseName = baseName.slice(0, -ext.length);
|
|
461
|
+
ext = posix.extname(baseName);
|
|
462
|
+
}
|
|
463
|
+
const dir = posix.dirname(filePath);
|
|
464
|
+
return dir === "." ? baseName : posix.join(dir, baseName);
|
|
24
465
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exports.md5 = md5; exports.removeAllExtensions = removeAllExtensions;
|
|
466
|
+
//#endregion
|
|
467
|
+
exports.md5 = md5;
|
|
468
|
+
exports.removeAllExtensions = removeAllExtensions;
|