From e0f2d76bf29412e4c6db224f2583a83006fc5262 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Tue, 22 Mar 2022 18:00:41 +0100 Subject: [PATCH] Refactor: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- src/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 64fa8c3e0..042ce3d85 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -85,8 +85,8 @@ export const toggleClass = (ele: HTMLElement, className: string) => { classString += '' + className } else { classString = - classString.substr(0, nameIndex) + - classString.substr(nameIndex + className.length) + classString.slice(0, nameIndex) + + classString.slice(nameIndex + className.length) } ele.className = classString }