fix herf match func

This commit is contained in:
Gabe Yuan
2023-09-05 16:06:48 +08:00
parent 87ab45f936
commit a44747ccad
3 changed files with 12 additions and 3 deletions

View File

@@ -91,7 +91,14 @@ export const isMatch = (s, p) => {
return true;
}
return p.slice(pIndex).replaceAll("*", "") === "";
while (pIndex < p.length) {
if (p[pIndex] !== "*") {
return false;
}
pIndex++;
}
return true;
};
/**