chore: remove all .substring() usage (#6352)
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
@ -319,11 +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,
|
||||
)}`;
|
||||
const text = `${value.slice(0, size / 2)}\u2026${value.slice(-(size / 2) + 1)}`;
|
||||
return (
|
||||
<FileLink href={value} rel="noopener" target="_blank">
|
||||
{text}
|
||||
|
Reference in New Issue
Block a user