Comparing version 3.0.0 to 3.0.1
@@ -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> <span style="color: gray">//</span> First line</div>\n' + | ||
' <div> <span style="color: gray">//</span> Second line</div>\n' + | ||
' <div> <span style="color: gray">//</span> Third line</div>\n' + | ||
' <div><div style="display: inline-block; vertical-align: top"><div style="font-family: monospace; white-space: nowrap">\n' + | ||
' <div> <span style="color: gray">//</span> </div>\n' + | ||
' <div> <span style="color: gray">//</span> </div>\n' + | ||
' <div> <span style="color: gray">//</span> </div>\n' + | ||
'</div></div><div style="display: inline-block; vertical-align: top"><div style="font-family: monospace; white-space: nowrap">\n' + | ||
' <div>First line</div>\n' + | ||
' <div>Second line</div>\n' + | ||
' <div> Third line</div>\n' + | ||
'</div></div></div>\n' + | ||
'</div>'); | ||
@@ -620,0 +626,0 @@ }); |
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
461955
2536