first commit
This commit is contained in:
commit
db5762abd4
687 files changed
+171307
No files matched your search
@@ -0,0 +1,17 @@
|
||||
function e(e) {
|
||||
return typeof e == `string` && /-L\s*$/.test(e);
|
||||
}
|
||||
function t(e) {
|
||||
return typeof e == `string` ? e.replace(/-L\s*$/, ``).trim() : ``;
|
||||
}
|
||||
function n(n, r) {
|
||||
if (!n) return ``;
|
||||
let i = [...new Set(r.filter((t) => e(t)).map((e) => e.trim()))].sort(
|
||||
(e, t) => t.length - e.length,
|
||||
);
|
||||
if (!i.length) return n;
|
||||
let a = i.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`)).join(`|`),
|
||||
o = RegExp(`(?<![A-Za-z0-9_-])(?:${a})(?![A-Za-z0-9_-])`, `g`);
|
||||
return n.replace(o, (e) => t(e));
|
||||
}
|
||||
export { t as n, n as r, e as t };
|
||||
Reference in new issue
Block a user