Skip to content

Commit

Permalink
chore: replace use of substr with substring #11 (#12)
Browse files Browse the repository at this point in the history
Closes #11
  • Loading branch information
grempe authored Feb 13, 2022
1 parent 99fc5ff commit 12fcc49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ulid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function replaceCharAt(str: string, index: number, char: string): string {
if (index > str.length - 1) {
return str;
}
return str.substr(0, index) + char + str.substr(index + 1);
return str.substring(0, index) + char + str.substring(index + 1);
}

/**
Expand All @@ -122,7 +122,7 @@ export function decodeTime(id: string): number {
}

const time = id
.substr(0, TIME_LEN)
.substring(0, TIME_LEN)
.split("")
.reverse()
.reduce((carry, char, index) => {
Expand Down

0 comments on commit 12fcc49

Please sign in to comment.