mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fixed a typo in string truncation util
This commit is contained in:
@@ -177,7 +177,7 @@ export function truncateText(text: string, maxLength: number): string {
|
||||
return (
|
||||
text.substr(0, Math.floor(maxLength / 2)) +
|
||||
'…' +
|
||||
text.substr(length - Math.ceil(maxLength / 2) + 1)
|
||||
text.substr(length - Math.ceil(maxLength / 2) - 1)
|
||||
);
|
||||
} else {
|
||||
return text;
|
||||
|
||||
Reference in New Issue
Block a user