Refactor: Replace deprecated substr() with slice() (#27370)

This commit is contained in:
Leslie Fernando
2025-10-06 13:21:51 +05:30
committed by GitHub
parent 5d9aae3ad5
commit 7b3a265a70
7 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ export default function parseAspectRatio(input: string) {
}
try {
if (input.endsWith("%")) {
return { w: 100, h: parseOrThrow(input.substr(0, input.length - 1)) };
return { w: 100, h: parseOrThrow(input.slice(0, -1)) };
}
const arr = input.replace(":", "x").split("x");