fix herf match func
This commit is contained in:
@@ -45,9 +45,10 @@ const init = async () => {
|
|||||||
try {
|
try {
|
||||||
await init();
|
await init();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.error("[KISS-Translator]", err);
|
||||||
const $err = document.createElement("div");
|
const $err = document.createElement("div");
|
||||||
$err.innerText = `KISS-Translator: ${err.message}`;
|
$err.innerText = `KISS-Translator: ${err.message}`;
|
||||||
$err.style.cssText = "background:red; color:#fff; z-index:10000;";
|
$err.style.cssText = "background:red; color:#fff;";
|
||||||
document.body.prepend($err);
|
document.body.prepend($err);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -91,7 +91,14 @@ export const isMatch = (s, p) => {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return p.slice(pIndex).replaceAll("*", "") === "";
|
while (pIndex < p.length) {
|
||||||
|
if (p[pIndex] !== "*") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -99,9 +99,10 @@ const init = async () => {
|
|||||||
try {
|
try {
|
||||||
await init();
|
await init();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.error("[KISS-Translator]", err);
|
||||||
const $err = document.createElement("div");
|
const $err = document.createElement("div");
|
||||||
$err.innerText = `KISS-Translator: ${err.message}`;
|
$err.innerText = `KISS-Translator: ${err.message}`;
|
||||||
$err.style.cssText = "background:red; color:#fff; z-index:10000;";
|
$err.style.cssText = "background:red; color:#fff;";
|
||||||
document.body.prepend($err);
|
document.body.prepend($err);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user