Replace deprecated String#substr with String#slice (#8314)

This commit is contained in:
CommanderRoot
2022-04-14 07:52:42 +00:00
committed by GitHub
parent 0e68c16a90
commit c35fc169f5
17 changed files with 37 additions and 37 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ function isValidHexColor(color: string): boolean {
return typeof color === "string" &&
(color.length === 7 || color.length === 9) &&
color.charAt(0) === "#" &&
!color.substr(1).split("").some(c => isNaN(parseInt(c, 16)));
!color.slice(1).split("").some(c => isNaN(parseInt(c, 16)));
}
function urlForColor(color: string): string {