print-tools-js
Advanced tools
Comparing version 1.0.6 to 1.0.8
@@ -31,2 +31,7 @@ var COLS, assert, escRepl, p, presetTest, should, styleTest; | ||
}); | ||
it('Proper length - multiline string', function() { | ||
return (escRepl(func.bind(p)('Test '.repeat(100), { | ||
ret: true | ||
})).length % COLS).should.equal(0); | ||
}); | ||
it('Proper length with args', function() { | ||
@@ -69,2 +74,7 @@ return escRepl(func.bind(p)('Test', { | ||
}); | ||
it('Proper length - multiline string', function() { | ||
return (escRepl(func.bind(p)('Test '.repeat(100), { | ||
ret: true | ||
})).length % COLS).should.equal(0); | ||
}); | ||
it('Proper length with args', function() { | ||
@@ -140,2 +150,7 @@ return escRepl(func.bind(p)('Test', { | ||
}); | ||
it('Proper length - multiline string', function() { | ||
return (escRepl(p.log('Test '.repeat(100), { | ||
ret: true | ||
})).length % COLS).should.equal(0); | ||
}); | ||
it('Proper length with emoji', function() { | ||
@@ -142,0 +157,0 @@ return escRepl(p.log('Test', { |
@@ -100,3 +100,6 @@ var Print, box, chalk, dateFormat, dec, decArgs, emoji, getEmote, logOrReturn, presetArgs, printDecoration, printPreset; | ||
time = chalk.gray(dateFormat(new Date(), 'HH:MM:ss')); | ||
space = ' '.repeat(cols - text.replace(/\u001b\[.*?m/g, '').length - emote.length - time.replace(/\u001b\[.*?m/g, '').length - 1 - args.offset); | ||
if ((cols - text.replace(/\u001b\[.*?m/g, '').length - emote.length - time.replace(/\u001b\[.*?m/g, '').length - 1 - args.offset) < 0 && args.offset > 0) { | ||
args.offset -= 1; | ||
} | ||
space = ' '.repeat(cols - (text.replace(/\u001b\[.*?m/g, '').length % cols) - emote.length - time.replace(/\u001b\[.*?m/g, '').length - 1 - args.offset); | ||
output = `${text}${space}${emote} ${time}`; | ||
@@ -208,3 +211,6 @@ return logOrReturn(output, args.ret); | ||
cols = process.stdout.columns; | ||
space = ' '.repeat(cols - output.replace(/\u001b\[.*?m/g, '').length - emote.length - args.offset); | ||
if ((cols - output.replace(/\u001b\[.*?m/g, '').length - emote.length - args.offset) < 0 && args.offset > 0) { | ||
args.offset -= 1; | ||
} | ||
space = ' '.repeat(cols - (output.replace(/\u001b\[.*?m/g, '').length % cols) - emote.length - args.offset); | ||
output = `${output}${space}${emote}`; | ||
@@ -211,0 +217,0 @@ return logOrReturn(output, args.ret); |
{ | ||
"name": "print-tools-js", | ||
"version": "1.0.6", | ||
"version": "1.0.8", | ||
"description": "Package: print_tools_js", | ||
@@ -5,0 +5,0 @@ "main": "./js/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16046
429