Skip to content

Commit 121cdb2

Browse files
committed
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent b7081ed commit 121cdb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DiscordEmbed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ async function handleRequest(request) {
66
const contentType = response.headers.get("content-type");
77
if (contentType && contentType.startsWith("image/")) {
88
const url = new URL(request.url);
9-
const filename = decodeURIComponent(url.pathname.substr(url.pathname.lastIndexOf("/") + 1));
9+
const filename = decodeURIComponent(url.pathname.slice(url.pathname.lastIndexOf("/") + 1));
1010
const title = "ShareX";
1111
const description = filename;
1212
const color = "#00aff4";

0 commit comments

Comments
 (0)