chore: replace deprecated String.prototype.substr() (#6333)
* chore: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com> * refactor: add prefer slice lint rule and fix errors Co-authored-by: erezrokah <erezrokah@users.noreply.github.com>
This commit is contained in:
@ -319,6 +319,7 @@ export default function withFileControl({ forImage } = {}) {
|
||||
if (!value || value.length <= size) {
|
||||
return value;
|
||||
}
|
||||
// eslint-disable-next-line unicorn/prefer-string-slice
|
||||
const text = `${value.substring(0, size / 2)}\u2026${value.substring(
|
||||
value.length - size / 2 + 1,
|
||||
value.length,
|
||||
|
Reference in New Issue
Block a user