Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

print-tools-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

print-tools-js - npm Package Compare versions

Comparing version 1.0.6 to 1.0.8

15

js/tests/test.js

@@ -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', {

10

js/utils/printer.js

@@ -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);

2

package.json
{
"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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc