Comparing version 4.3.3 to 4.3.4
@@ -7,2 +7,5 @@ var utils = require('./utils'); | ||
var cacheSize = 0; | ||
var maxColorCacheSize = 1024; | ||
var ansiStyles = utils.extend({}, require('ansi-styles')); | ||
@@ -125,3 +128,7 @@ Object.keys(ansiStyles).forEach(function (styleName) { | ||
} | ||
ansiStyles[originalStyleName] = {open: open, close: close}; | ||
if (cacheSize < maxColorCacheSize) { | ||
ansiStyles[originalStyleName] = {open: open, close: close}; | ||
cacheSize += 1; | ||
} | ||
content = open + content + close; | ||
@@ -128,0 +135,0 @@ } |
@@ -31,2 +31,5 @@ /*! | ||
var cacheSize = 0; | ||
var maxColorCacheSize = 1024; | ||
var ansiStyles = utils.extend({}, require(12)); | ||
@@ -149,3 +152,7 @@ Object.keys(ansiStyles).forEach(function (styleName) { | ||
} | ||
ansiStyles[originalStyleName] = {open: open, close: close}; | ||
if (cacheSize < maxColorCacheSize) { | ||
ansiStyles[originalStyleName] = {open: open, close: close}; | ||
cacheSize += 1; | ||
} | ||
content = open + content + close; | ||
@@ -152,0 +159,0 @@ } |
{ | ||
"name": "magicpen", | ||
"version": "4.3.3", | ||
"version": "4.3.4", | ||
"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
531351
3347