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

magicpen

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magicpen - npm Package Compare versions

Comparing version 3.0.6 to 3.0.7

12

lib/TextSerializer.js

@@ -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",

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