Comparing version
@@ -0,1 +1,8 @@ | ||
<a name="4.0.4"></a> | ||
## 4.0.4 (2018-11-06) | ||
* Ensure indexOf is a function ([eeb3b80](https://github.com/achojs/acho/commit/eeb3b80)) | ||
<a name="4.0.3"></a> | ||
@@ -2,0 +9,0 @@ ## 4.0.3 (2018-09-22) |
@@ -5,3 +5,3 @@ 'use strict' | ||
const { colorize } = require('./Util') | ||
const { isString, colorize } = require('./Util') | ||
const CONST = require('./Constants') | ||
@@ -126,3 +126,5 @@ const format = require('./Format') | ||
const lineColor = CONST.LINE_COLOR | ||
if (message.indexOf('=' === -1)) return colorize(lineColor, message) | ||
if (isString(message) && message.indexOf('=' === -1)) { | ||
return colorize(lineColor, message) | ||
} | ||
const typeColor = this.types[type].color | ||
@@ -129,0 +131,0 @@ |
@@ -6,3 +6,16 @@ 'use strict' | ||
const { getColor, colorize } = require('./Util') | ||
const { | ||
getColor, | ||
colorize, | ||
isString, | ||
isEmpty, | ||
isSymbol, | ||
isObject, | ||
isBuffer, | ||
isError, | ||
isDate, | ||
isFalsy, | ||
isArray, | ||
hasWhiteSpace | ||
} = require('./Util') | ||
const CONST = require('./Constants') | ||
@@ -13,13 +26,2 @@ | ||
const isEmpty = arr => arr.length === 0 | ||
const isString = obj => typeof obj === 'string' | ||
const isSymbol = obj => typeof obj === 'symbol' | ||
const isObject = obj => typeof obj === 'object' | ||
const isBuffer = buf => buf instanceof Buffer | ||
const isError = err => err instanceof Error | ||
const isDate = date => date instanceof Date | ||
const isFalsy = value => [null, undefined, false].indexOf(value) !== -1 | ||
const isArray = arr => Array.isArray(arr) | ||
const hasWhiteSpace = s => s.indexOf(' ') !== -1 | ||
function prettyObj (obj, color, opts) { | ||
@@ -26,0 +28,0 @@ const lineColor = getColor(CONST.LINE_COLOR) |
@@ -13,3 +13,5 @@ 'use strict' | ||
let stylize | ||
for (let color of colors) stylize = getChalkColor(color) | ||
for (let color of colors) { | ||
stylize = getChalkColor(color) | ||
} | ||
return stylize | ||
@@ -20,2 +22,26 @@ } | ||
module.exports = { getColor, colorize } | ||
const isEmpty = arr => arr.length === 0 | ||
const isString = obj => typeof obj === 'string' | ||
const isSymbol = obj => typeof obj === 'symbol' | ||
const isObject = obj => typeof obj === 'object' | ||
const isBuffer = buf => buf instanceof Buffer | ||
const isError = err => err instanceof Error | ||
const isDate = date => date instanceof Date | ||
const isFalsy = value => [null, undefined, false].indexOf(value) !== -1 | ||
const isArray = arr => Array.isArray(arr) | ||
const hasWhiteSpace = s => s.indexOf(' ') !== -1 | ||
module.exports = { | ||
getColor, | ||
colorize, | ||
isString, | ||
isEmpty, | ||
isSymbol, | ||
isObject, | ||
isBuffer, | ||
isError, | ||
isDate, | ||
isFalsy, | ||
isArray, | ||
hasWhiteSpace | ||
} |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://acho.js.org", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"main": "./lib/Acho.js", | ||
@@ -8,0 +8,0 @@ "author": { |
49289
0.9%379
8.6%