Comparing version 1.0.4 to 1.0.5
@@ -1,15 +0,26 @@ | ||
/** | ||
* Created by Vincent on 2017/10/23. | ||
*/ | ||
module.exports = function(v) { | ||
/* eslint-disable */ | ||
const version = process.env.VERSION || process.env.REACT_APP_VERSION; | ||
module.exports = function() { | ||
const args = Array.prototype.slice | ||
.call(arguments) | ||
.map(val => { | ||
if (val === undefined) { | ||
return 'undefined'; | ||
} else if (typeof val === 'string') { | ||
return val; | ||
} | ||
try { | ||
return JSON.stringify(val); | ||
} catch (error) { | ||
return '[TypeError]'; | ||
} | ||
}) | ||
.join(' '); | ||
console.log( | ||
'%c [%s] %s ', | ||
'background: ' + | ||
(process.env.NODE_ENV === 'production' ? '#000' : '#f00') + | ||
'; color: #fff;', | ||
process.env.NODE_ENV, | ||
v | ||
? Array.prototype.slice.call(arguments).toString() | ||
: process.env.VERSION || process.env.REACT_APP_VERSION | ||
); // eslint-disable-line | ||
`%c [${process.env.NODE_ENV}] ${version} %c ${args}`, | ||
`background: ${ | ||
process.env.NODE_ENV === 'production' ? '#000' : '#f00' | ||
}; color: #fff;`, | ||
`` | ||
); | ||
}; |
{ | ||
"name": "consolev", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "consolev.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
956
25