Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,6 @@ | ||
## 1.1.2 | ||
2022-01-09 | ||
- Fix replace colors with chalk | ||
## 1.1.1 | ||
@@ -2,0 +7,0 @@ 2021-10-19 |
@@ -1,2 +0,2 @@ | ||
const colors = require('colors'); | ||
const chalk = require('chalk'); | ||
const arrayOf = require('./lib/arrayOf'); | ||
@@ -65,4 +65,4 @@ const length = require('./lib/length'); | ||
if (!Object.prototype.hasOwnProperty.call(colors, color)) { | ||
throw new Error(`colors does not support color "${color}"`); | ||
if (typeof chalk[color] !== 'function') { | ||
throw new Error(`unsupported color "${color}"`); | ||
} | ||
@@ -103,3 +103,3 @@ if (!Object.prototype.hasOwnProperty.call(themes, theme)) { | ||
'mr', | ||
].map(item => themes[theme][item][color]); | ||
].map(item => chalk[color](themes[theme][item])); | ||
@@ -106,0 +106,0 @@ const lineMap = line => { |
@@ -1,2 +0,2 @@ | ||
require('colors'); | ||
const strip = require('strip-ansi'); | ||
@@ -36,3 +36,3 @@ /** | ||
module.exports = function length(string = ''){ | ||
const split = string.strip.split(ZERO_WIDTH_JOINER); | ||
const split = strip(string).split(ZERO_WIDTH_JOINER); | ||
return split.reduce( | ||
@@ -39,0 +39,0 @@ (sum, part) => sum + len(part), |
{ | ||
"name": "boxt", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "📦 Create boxes around text", | ||
@@ -25,12 +25,13 @@ "keywords": [ | ||
}, | ||
"dependencies": { | ||
"colors": "^1.3.2" | ||
}, | ||
"devDependencies": { | ||
"@omrilotan/eslint-config": "^1.3.0", | ||
"chai": "^4.3.0", | ||
"chalk": "^4.1.0", | ||
"chalk": "^4.1.2", | ||
"eslint": "^7.21.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"mocha": "^8.3.0" | ||
}, | ||
"dependencies": { | ||
"strip-ansi": "^6.0.1" | ||
} | ||
} |
@@ -35,3 +35,3 @@ # boxt [](https://www.npmjs.com/package/boxt) [](https://github.com/omrilotan/mono/tree/master/packages/boxt) | ||
| theme | border style | 'single' (default), 'double', 'round' | ||
| color | border colour | see [`colors` on NPM](https://www.npmjs.com/package/colors) | ||
| color | border colour | see [`chalk` on NPM](https://www.npmjs.com/package/chalk) | ||
| padding | space from borders to text | | ||
@@ -38,0 +38,0 @@ | align | Where to align the lines | 'center' (default), 'left'/'start', 'right'/'end' |
9671
6
+ Addedstrip-ansi@^6.0.1
+ Addedansi-regex@5.0.1(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
- Removedcolors@^1.3.2
- Removedcolors@1.4.0(transitive)