logd-console-output
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "logd-console-output", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "console output for logd", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,3 @@ 'use strict'; | ||
decoration, | ||
options, | ||
}) { | ||
@@ -29,9 +30,19 @@ const source = value.toString().split(/\n/g); | ||
context.print(this.decorate(context, value.name+' ', 'name')); | ||
context.print(this.decorate(context, this.truncate(source[0].slice(0, 80), 80), 'source')); | ||
context.print(this.decorate(context, this.truncate(source[0], options.truncate || 80), 'source')); | ||
let remainginChars = (options.truncate || 20) - source[0].length; | ||
this.truncateWhiteSpace(source.slice(1)).forEach((line) => { | ||
context.newLine(); | ||
context.print(this.decorate(context, this.truncate(line.slice(0, 80), 80), 'source')); | ||
}); | ||
if (remainginChars > 0) { | ||
this.truncateWhiteSpace(source.slice(1)).map((line) => { | ||
remainginChars -= line.length; | ||
return { | ||
line: line, | ||
remainginChars: remainginChars+line.length, | ||
}; | ||
}).filter(line => line.remainginChars > 0).forEach((line) => { | ||
context.newLine(); | ||
context.print(this.decorate(context, this.truncate(line.line, line.remainginChars), 'source')); | ||
}); | ||
} else context.print(this.decorate(context, ` \u2026`, 'source')); | ||
} | ||
@@ -38,0 +49,0 @@ |
@@ -150,4 +150,3 @@ 'use strict'; | ||
'\u001b[90m[Function] (3 lines)\u001b[39m\u001b[90m: \u001b[39m\u001b[36mtestArrowFunction \u001b[39m\u001b[90m(parameter) => {\u001b[39m', | ||
'\u001b[90m return 1;\u001b[39m', | ||
'\u001b[90m}\u001b[39m', | ||
'\u001b[90m return…\u001b[39m' | ||
]); | ||
@@ -154,0 +153,0 @@ }); |
@@ -24,2 +24,12 @@ 'use strict'; | ||
const aLongFunction = (some, paramters = {}) => { | ||
// the comment is of no use, | ||
const butTheVariable = 'is!'; | ||
for (const char of butTheVariable.values()) { | ||
console.log(char); | ||
} | ||
}; | ||
log.log({ | ||
@@ -39,2 +49,3 @@ callsite, | ||
() => {return 1;}, | ||
aLongFunction, | ||
435435, | ||
@@ -41,0 +52,0 @@ Symbol(234234), |
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
57326
1646