mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 12:57:47 +00:00
[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:
@@ -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},`;
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user