Comparing version 3.0.6 to 3.0.7
@@ -24,2 +24,6 @@ var duplicateText = require('./duplicateText'); | ||
if (!utils.lineContainsBlocks(line)) { | ||
return [line]; | ||
} | ||
var result = []; | ||
@@ -44,4 +48,6 @@ | ||
Array.prototype.push.apply(result[index], blockLine); | ||
if (padLines) { | ||
result[index].push(createPadding(longestLineLength - blockLinesLengths[index])); | ||
var paddingLength = longestLineLength - blockLinesLengths[index]; | ||
if (padLines && paddingLength > 0) { | ||
result[index].push(createPadding(paddingLength)); | ||
} | ||
@@ -81,3 +87,3 @@ }); | ||
return this[outputEntry.style] ? | ||
this[outputEntry.style].apply(this, outputEntry.args) : | ||
String(this[outputEntry.style].apply(this, outputEntry.args)) : | ||
''; | ||
@@ -84,0 +90,0 @@ }, this).join(''); |
@@ -42,2 +42,9 @@ var utils = { | ||
lineContainsBlocks: function (line) { | ||
return line.some(function (outputEntry) { | ||
return outputEntry.style === 'block' || | ||
(outputEntry.style === 'text' && String(outputEntry.args[0]).indexOf('\n') !== -1); | ||
}); | ||
}, | ||
arrayEquals: function (a, b) { | ||
@@ -44,0 +51,0 @@ if (a === b) { |
@@ -659,2 +659,6 @@ /*! | ||
if (!utils.lineContainsBlocks(line)) { | ||
return [line]; | ||
} | ||
var result = []; | ||
@@ -679,4 +683,6 @@ | ||
Array.prototype.push.apply(result[index], blockLine); | ||
if (padLines) { | ||
result[index].push(createPadding(longestLineLength - blockLinesLengths[index])); | ||
var paddingLength = longestLineLength - blockLinesLengths[index]; | ||
if (padLines && paddingLength > 0) { | ||
result[index].push(createPadding(paddingLength)); | ||
} | ||
@@ -716,3 +722,3 @@ }); | ||
return this[outputEntry.style] ? | ||
this[outputEntry.style].apply(this, outputEntry.args) : | ||
String(this[outputEntry.style].apply(this, outputEntry.args)) : | ||
''; | ||
@@ -810,2 +816,9 @@ }, this).join(''); | ||
lineContainsBlocks: function (line) { | ||
return line.some(function (outputEntry) { | ||
return outputEntry.style === 'block' || | ||
(outputEntry.style === 'text' && String(outputEntry.args[0]).indexOf('\n') !== -1); | ||
}); | ||
}, | ||
arrayEquals: function (a, b) { | ||
@@ -812,0 +825,0 @@ if (a === b) { |
{ | ||
"name": "magicpen", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Styled output in both consoles and browsers", | ||
@@ -5,0 +5,0 @@ "main": "./lib/MagicPen.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
469024
2744