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.0 to 3.0.1

15

lib/MagicPen.js

@@ -238,8 +238,15 @@ /*global window*/

var outputToPrepend = [].concat(pen.output[0]);
this.output = this.output.map(function (line) {
return normalizeLine(outputToPrepend.concat(line));
var height = this.size().height;
var output = this.clone();
output.block(function () {
for (var i = 0; i < height; i += 1) {
if (0 < i) {
this.nl();
}
this.append(pen);
}
});
output.block(this);
this.output = output.output;
return this;

@@ -246,0 +253,0 @@ };

@@ -481,8 +481,15 @@ /*!

var outputToPrepend = [].concat(pen.output[0]);
this.output = this.output.map(function (line) {
return normalizeLine(outputToPrepend.concat(line));
var height = this.size().height;
var output = this.clone();
output.block(function () {
for (var i = 0; i < height; i += 1) {
if (0 < i) {
this.nl();
}
this.append(pen);
}
});
output.block(this);
this.output = output.output;
return this;

@@ -1159,15 +1166,6 @@ };

var result = color.map_palette([target], relative, 'closest');
var result = color.map_palette([target], relative);
return result[key];
};
color.furthest = function(target, relative) {
var key = color.palette_map_key(target);
var result = color.map_palette([target], relative, 'furthest');
return result[key];
};
},{}],12:[function(require,module,exports){

@@ -1232,9 +1230,7 @@ /**

* @param [{rgbcolor}] b each element should have fields R,G,B
* @param 'type' should have field closest or furthest
* @return {palettemap}
*/
function map_palette(a, b, type)
function map_palette(a, b)
{
var c = {};
type = type || 'closest';
for (var idx1 in a){

@@ -1248,15 +1244,7 @@ var color1 = a[idx1];

var current_color_diff = diff(color1,color2);
if((best_color == undefined) || ((type === 'closest') && (current_color_diff < best_color_diff)))
if((best_color == undefined) || (current_color_diff < best_color_diff))
{
best_color = color2;
best_color_diff = current_color_diff;
continue;
}
if((type === 'furthest') && (current_color_diff > best_color_diff))
{
best_color = color2;
best_color_diff = current_color_diff;
continue;
}
}

@@ -1263,0 +1251,0 @@ c[palette_map_key(color1)] = best_color;

{
"name": "magicpen",
"version": "3.0.0",
"version": "3.0.1",
"description": "Styled output in both consoles and browsers",

@@ -5,0 +5,0 @@ "main": "./lib/MagicPen.js",

@@ -615,5 +615,11 @@ /*global describe, it, beforeEach*/

'<div style="font-family: monospace; white-space: nowrap">\n' +
' <div>&nbsp;<span style="color: gray">//</span>&nbsp;First&nbsp;line</div>\n' +
' <div>&nbsp;<span style="color: gray">//</span>&nbsp;Second&nbsp;line</div>\n' +
' <div>&nbsp;<span style="color: gray">//</span>&nbsp;&nbsp;&nbsp;Third&nbsp;line</div>\n' +
' <div><div style="display: inline-block; vertical-align: top"><div style="font-family: monospace; white-space: nowrap">\n' +
' <div>&nbsp;<span style="color: gray">//</span>&nbsp;</div>\n' +
' <div>&nbsp;<span style="color: gray">//</span>&nbsp;</div>\n' +
' <div>&nbsp;<span style="color: gray">//</span>&nbsp;</div>\n' +
'</div></div><div style="display: inline-block; vertical-align: top"><div style="font-family: monospace; white-space: nowrap">\n' +
' <div>First&nbsp;line</div>\n' +
' <div>Second&nbsp;line</div>\n' +
' <div>&nbsp;&nbsp;Third&nbsp;line</div>\n' +
'</div></div></div>\n' +
'</div>');

@@ -620,0 +626,0 @@ });

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