Browse Source

Fix deadlock limitSymbols

master
morethanwords 4 years ago
parent
commit
66f79bd558
  1. 3
      src/helpers/string.ts

3
src/helpers/string.ts

@ -3,8 +3,9 @@ @@ -3,8 +3,9 @@
} */
export function limitSymbols(str: string, length: number, limitFrom = length + 10) {
str = str.trim();
if(str.length > limitFrom) {
str = str.slice(0, length).replace(/(\n|\s)+$/, '') + '...';
str = str.slice(0, length)/* .replace(/\s*$/, '') */ + '...';
}
return str;

Loading…
Cancel
Save