fix: slice check

This commit is contained in:
Gabe
2025-09-25 01:50:22 +08:00
parent 7665f8c260
commit 1dabbfc4de
2 changed files with 10 additions and 3 deletions

View File

@@ -198,6 +198,8 @@ export const isSameSet = (a, b) => {
* @returns
*/
export const removeEndchar = (s, c, count = 1) => {
if (!s) return "";
let i = s.length;
while (i > s.length - count && s[i - 1] === c) {
i--;