mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -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){
|
module.exports.stringwrap = function(content = "", length, newlines = true){
|
||||||
if(!newlines) content = content.replace(/\n/, ' ')
|
if(!newlines) content = content.replace(/\n/, ' ')
|
||||||
if(content.length > length){
|
if(content.length > length){
|
||||||
c = content.substr(0, length) + '...';
|
c = content.substr(0, length-1) + '…';
|
||||||
while(c.endsWith(' ...')) c = c.substr(0, c.length - 4) + '...';
|
while(c.endsWith(' …')) c = c.substr(0, c.length - 2) + '…';
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue