2023-11-14 16:17:22 +08:00
|
|
|
var a = /* @__PURE__ */ ((e) => (e[e.delete = 2] = "delete", e[e.reset = 1] = "reset", e))(a || {});
|
|
|
|
|
const h = (e) => ({
|
2023-11-11 15:30:11 +08:00
|
|
|
clear: function(t = 2) {
|
2023-11-14 16:17:22 +08:00
|
|
|
t === 1 ? Object.keys(e).forEach((s) => {
|
|
|
|
|
e[s] = void 0;
|
|
|
|
|
}) : t === 2 && Object.keys(e).forEach((s) => {
|
|
|
|
|
delete e[s];
|
2023-11-11 21:28:01 +08:00
|
|
|
});
|
2023-11-11 15:30:11 +08:00
|
|
|
},
|
|
|
|
|
replace: function(t) {
|
|
|
|
|
this.clear(
|
2023-11-11 21:28:01 +08:00
|
|
|
2
|
|
|
|
|
/* delete */
|
2023-11-11 15:30:11 +08:00
|
|
|
), Object.assign(e, t);
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-11-14 16:17:22 +08:00
|
|
|
function d(...e) {
|
2023-11-11 21:28:01 +08:00
|
|
|
let t = e ?? [];
|
|
|
|
|
return {
|
2023-11-14 16:17:22 +08:00
|
|
|
test: function(s) {
|
2023-11-11 21:28:01 +08:00
|
|
|
if (t.length <= 1)
|
|
|
|
|
return t.length === 1 ? t[0] : [];
|
2023-11-14 16:17:22 +08:00
|
|
|
let r = s ?? function(n, i) {
|
|
|
|
|
return n === i;
|
2023-11-11 21:28:01 +08:00
|
|
|
};
|
2023-11-14 16:17:22 +08:00
|
|
|
return t.reduce((n, i) => (i && i.length > 0 && (n.length === 0 ? n.push(...i) : i.forEach((u) => {
|
|
|
|
|
n.some((f) => r(f, u)) || n.push(u);
|
|
|
|
|
})), n), []);
|
2023-11-11 21:28:01 +08:00
|
|
|
},
|
2023-11-14 16:17:22 +08:00
|
|
|
path: function(...s) {
|
|
|
|
|
return this.test((r, n) => s.every((i) => r[i] === n[i]));
|
2023-11-10 16:35:59 +08:00
|
|
|
}
|
2023-11-11 21:28:01 +08:00
|
|
|
};
|
|
|
|
|
}
|
2023-11-14 16:17:22 +08:00
|
|
|
function m(e, t, s) {
|
|
|
|
|
const r = t, n = s || t;
|
|
|
|
|
return function(i) {
|
|
|
|
|
const u = [], l = i.matchAll(e);
|
2023-11-11 21:28:01 +08:00
|
|
|
let f = 0;
|
2023-11-14 16:17:22 +08:00
|
|
|
for (const o of l) {
|
|
|
|
|
const c = i.slice(f, o.index);
|
|
|
|
|
c && u.push(n(c, !1)), u.push(r(o[0], !0)), f = o.index + o[0].length;
|
2023-11-11 21:28:01 +08:00
|
|
|
}
|
2023-11-14 16:17:22 +08:00
|
|
|
return f < i.length && u.push(n(i.slice(f), !1)), u;
|
2023-11-10 16:35:59 +08:00
|
|
|
};
|
|
|
|
|
}
|
2023-11-12 21:58:32 +08:00
|
|
|
function g(e, t) {
|
2023-11-11 16:13:36 +08:00
|
|
|
return typeof e == "string" && typeof t == "string" ? e.toLowerCase() === t.toLowerCase() : e === void 0 && t === void 0;
|
|
|
|
|
}
|
2023-11-14 16:17:22 +08:00
|
|
|
const I = (e, t) => {
|
|
|
|
|
for (let s = 0; s < e.length; s++) {
|
|
|
|
|
let r = e[s];
|
|
|
|
|
if (g(r, t))
|
2023-11-11 16:13:36 +08:00
|
|
|
return !0;
|
|
|
|
|
}
|
|
|
|
|
return !1;
|
|
|
|
|
};
|
2023-11-14 16:17:22 +08:00
|
|
|
function O(e) {
|
2023-11-12 21:58:32 +08:00
|
|
|
const t = e.lastIndexOf(".");
|
|
|
|
|
return t === -1 ? "" : e.substring(t + 1);
|
|
|
|
|
}
|
2023-11-14 16:17:22 +08:00
|
|
|
function x(e) {
|
2023-11-12 21:58:32 +08:00
|
|
|
let t = e.lastIndexOf("/");
|
|
|
|
|
return t === -1 && (t = e.lastIndexOf("\\"), t === -1) ? e : e.substring(t + 1);
|
|
|
|
|
}
|
2023-11-14 16:17:22 +08:00
|
|
|
function E(e) {
|
|
|
|
|
const t = x(e), s = t.lastIndexOf(".");
|
|
|
|
|
return s === -1 ? t : t.substring(0, s);
|
|
|
|
|
}
|
|
|
|
|
function b(e, t = "win32") {
|
|
|
|
|
const s = t === "win32" ? "\\" : "/";
|
|
|
|
|
let r, n, i, u;
|
|
|
|
|
const l = e.lastIndexOf(s);
|
|
|
|
|
l === -1 ? (r = "", n = e) : (r = e.substring(0, l + 1), n = e.substring(l + 1));
|
|
|
|
|
const f = n.lastIndexOf(".");
|
|
|
|
|
return f === -1 ? (i = "", u = n) : (i = n.substring(f + 1), u = n.substring(0, f)), {
|
|
|
|
|
fileName: n,
|
|
|
|
|
fileNameNoExt: u,
|
|
|
|
|
fileExtName: i,
|
|
|
|
|
fullPath: e,
|
|
|
|
|
pathOnly: r
|
|
|
|
|
};
|
|
|
|
|
}
|
2023-11-10 16:35:59 +08:00
|
|
|
export {
|
2023-11-14 16:17:22 +08:00
|
|
|
a as RecordClearMode,
|
|
|
|
|
d as assignRecords,
|
2023-11-12 21:58:32 +08:00
|
|
|
g as equalsIgnoreCase,
|
2023-11-14 16:17:22 +08:00
|
|
|
O as getFileExt,
|
|
|
|
|
b as getFileInfo,
|
|
|
|
|
x as getFileName,
|
|
|
|
|
E as getFileNameWithoutExt,
|
|
|
|
|
I as includeIgnoreCase,
|
|
|
|
|
m as stringTokenizer,
|
|
|
|
|
h as withRecord
|
2023-11-10 16:35:59 +08:00
|
|
|
};
|
|
|
|
|
//# sourceMappingURL=index.es.js.map
|