mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
update stringwrap logic
This commit is contained in:
parent
50180cbdb3
commit
21bf3a2455
1 changed files with 2 additions and 2 deletions
|
@ -46,8 +46,8 @@ module.exports.timestamp = function(time, flag = "t"){
|
|||
module.exports.stringwrap = function(content = "", length, newlines = true){
|
||||
if(!newlines) content = content.replace(/\n/, ' ')
|
||||
if(content.length > length){
|
||||
c = content.substr(0, length) + '...';
|
||||
while(c.endsWith(' ...')) c = c.substr(0, c.length - 4) + '...';
|
||||
c = content.substr(0, length-1) + '…';
|
||||
while(c.endsWith(' …')) c = c.substr(0, c.length - 2) + '…';
|
||||
return c;
|
||||
}
|
||||
return content;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue