Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

refactor: replace deprecated String.prototype.substr() #4942

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/dashboard/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ export const reverseLookup = async (
};

export const shortenAddress = (address: string) => {
return `${address.substr(0, 6)}...${address.substr(address.length - 4, 4)}`;
return `${address.slice(0, 6)}...${address.slice(-4)}`;
eggplantzzz marked this conversation as resolved.
Show resolved Hide resolved
};
4 changes: 2 additions & 2 deletions packages/events/Subscriber/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const convertHandlerNameToRegex = name => {
start += match.index + matchLength;
str += cleanString + starRegex;
}
str += name.substr(start).replace(reRegExpChar, "\\$&");
return new RegExp(`^${str.substr(1)}$`, "i");
str += name.slice(start).replace(reRegExpChar, "\\$&");
return new RegExp(`^${str.slice(1)}$`, "i");
};

const createLookupTable = handlerNames => {
Expand Down