Use at() instead of charAt()

This commit is contained in:
Nikita Karamov 2023-06-17 14:08:15 +02:00
parent c23921d0ff
commit a040b32405
No known key found for this signature in database
GPG key ID: 41D6F71EE78E77CD

View file

@ -43,7 +43,7 @@ function normalizeUrl(url) {
if (!url.includes("http://") && !url.includes("https://")) {
url = "https://" + url;
}
if (url.charAt(url.length - 1) !== "/") {
if (url.at(-1) !== "/") {
url = url + "/";
}
return url;