Commit 4ed3123
refactor: replace deprecated String.prototype.substr() with substring()
String.prototype.substr() is deprecated and may be removed in future
JavaScript engine versions (Annex B of the ECMAScript specification).
Replaced all occurrences in the codebase with String.prototype.substring():
- src/algorithms/string/rabin-karp/rabinKarp.js
- src/algorithms/cryptography/polynomial-hash/__test__/SimplePolynomialHash.test.js
- src/algorithms/cryptography/polynomial-hash/__test__/PolynomialHash.test.js
The behavior is identical since all substr(start, length) calls are
converted to substring(start, start + length) with the same arguments.
All existing tests pass.1 parent 95ead35 commit 4ed3123
3 files changed
Lines changed: 5 additions & 5 deletions
File tree
- src/algorithms
- cryptography/polynomial-hash/__test__
- string/rabin-karp
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments