kopia lustrzana https://github.com/bugout-dev/moonstream
8 wiersze
156 B
JavaScript
8 wiersze
156 B
JavaScript
![]() |
export const shorten = (string, length = 80) => {
|
||
|
if (string.length <= length) {
|
||
|
return string;
|
||
|
}
|
||
|
|
||
|
return string.substring(0, length) + "...";
|
||
|
};
|