[examples][cli][routing-utils][static-build] replace deprecated String.prototype.substr() (#7588)

.substr() is deprecated so we replace it with .slice() or substring() which aren't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

Co-authored-by: Steven <steven@ceriously.com>
This commit is contained in:
CommanderRoot
2022-03-24 22:03:40 +01:00
committed by GitHub
parent 06e7753df0
commit d2ba06c6cb
13 changed files with 42 additions and 42 deletions

View File

@@ -56,7 +56,7 @@ async function main() {
// if it's an empty string, just ignore it
if (!formatted) return false;
let type = url.substr(-3) == 'css' ? 'style' : 'script';
let type = url.slice(-3) == 'css' ? 'style' : 'script';
results += `</${formatted}>;rel=preload;as=${type},`;
});