Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "extra-log", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Simple log wrapper for console which uses chalk for colors and cowsay for better loggin", | ||
"main": "src/log.js", | ||
"scripts": { | ||
"lint": "eslint src", | ||
"prepublishOnly": "npm test", | ||
"test": "jest", | ||
"test-coverage": "jest && codecov" | ||
"test-coverage": "jest --coverage", | ||
"test-coverage-report": "codecov" | ||
}, | ||
@@ -30,3 +33,11 @@ "keywords": [ | ||
"coverageDirectory": "./coverage/", | ||
"collectCoverage": true | ||
"collectCoverage": true, | ||
"coverageThreshold": { | ||
"global": { | ||
"branches": 100, | ||
"functions": 100, | ||
"lines": 100, | ||
"statements": 100 | ||
} | ||
} | ||
}, | ||
@@ -33,0 +44,0 @@ "repository": { |
@@ -5,2 +5,3 @@ # extra-log | ||
[![codecov](https://codecov.io/gh/rumax/extra-log/branch/master/graph/badge.svg)](https://codecov.io/gh/rumax/extra-log) | ||
[![npm version](https://badge.fury.io/js/extra-log.svg)](https://badge.fury.io/js/extra-log) | ||
@@ -7,0 +8,0 @@ Simple wrapper for [console](https://developer.mozilla.org/en-US/docs/Web/API/Console) using |
@@ -8,2 +8,8 @@ const chalk = require('chalk'); | ||
log(chalk[color](cowsay.say({ text: msg }))); | ||
const colorArgs = (color, params) => params.map((param) => { | ||
if ('object' === typeof param) { | ||
return param; | ||
} | ||
return chalk[color](param); | ||
}); | ||
@@ -28,3 +34,3 @@ const maxLevel = 3; | ||
activeLavel = maxLevel; | ||
} if (activeLavel < 0) { | ||
} if (0 > activeLavel) { | ||
activeLavel = 0; | ||
@@ -42,3 +48,3 @@ } | ||
if (levels.info <= activeLavel) { | ||
log(chalk.grey(...args)); | ||
log(...colorArgs('grey', args)); | ||
} | ||
@@ -50,3 +56,3 @@ }, | ||
if (levels.msg <= activeLavel) { | ||
log(chalk.green(...args)); | ||
log(...colorArgs('green', args)); | ||
} | ||
@@ -53,0 +59,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
4702
58
25