1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 02:16:54 +00:00

Replace deprecated String.prototype.substr()

String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
Tobias Speicher 2023-09-29 12:52:34 +02:00
parent e20ee44015
commit 3f59c9e8b2
No known key found for this signature in database
GPG key ID: 2CF824BD810C3BDB
2 changed files with 3 additions and 3 deletions

View file

@ -376,7 +376,7 @@ function mention_processAll(tokens, msg, user, color_mentions) {
this.applyHighlight(msg, priority, null, 'mention', true);
// Push the remaining text from the token.
text.push(segment.substr(match[0].length));
text.push(segment.slice(match[0].length));
}
} else

View file

@ -438,8 +438,8 @@ export default {
if ( idx === -1 )
msg.user = null;
else {
msg.user = msg.prefix.substr(0, idx);
msg.prefix = msg.prefix.substr(idx);
msg.user = msg.prefix.slice(0, idx);
msg.prefix = msg.prefix.slice(idx);
}
return msg;