]> cat aescling's git repositories - mastodon.git/commit
Replace deprecated String.prototype.substr() (#17949)
authorCommanderRoot <CommanderRoot@users.noreply.github.com>
Mon, 4 Apr 2022 16:19:45 +0000 (18:19 +0200)
committerGitHub <noreply@github.com>
Mon, 4 Apr 2022 16:19:45 +0000 (12:19 -0400)
commit0ec695e036dab45d57598f451266bd0b176df9fd
tree0b68486138f3ec36bdba2f58f3f8db41e5bae6a9
parent80ded02a4bd2ea6d5b9b69198753063224773f66
Replace deprecated String.prototype.substr() (#17949)

* Replace deprecated String.prototype.substr()

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

* Change String.prototype.substring() to String.prototype.slice()

.substring() and .slice() work very similary but .slice() is a bit faster and stricter

* Add ESLint rule to forbid usage of .substr and .substring

.substr() is deprecated and .substring() is very similar to .slice() so better to use .slice() at all times

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
.eslintrc.js
app/javascript/mastodon/features/emoji/emoji_mart_search_light.js
app/javascript/mastodon/features/status/components/card.js
app/javascript/mastodon/features/video/index.js