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:
@ -183,7 +183,7 @@
|
||||
h('h2', {}, 'Related Post'),
|
||||
h('h3', {}, post.get('title')),
|
||||
h('img', { src: post.get('image') }),
|
||||
h('p', {}, post.get('body', '').substr(0, 100) + '...'),
|
||||
h('p', {}, post.get('body', '').slice(0, 100) + '...'),
|
||||
) : null;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user