@ctx-core/logger
Advanced tools
Comparing version 2.2.12 to 3.0.0
63
chalk.js
@@ -1,2 +0,61 @@ | ||
require = require('esm')(module) | ||
module.exports = require('./chalk.mjs') | ||
const use_chalk = typeof window === 'undefined' && typeof require === 'function' | ||
const chalk = _chalk() | ||
export function debug__chalk() { | ||
return (console.debug || console.info).apply(console, _ARR__chalk__debug(...arguments)) | ||
} | ||
export function log__chalk() { | ||
return console.log.apply(console, _ARR__chalk__log(...arguments)) | ||
} | ||
export function info__chalk() { | ||
return console.info.apply(console, _ARR__chalk__info(...arguments)) | ||
} | ||
export function warn__chalk() { | ||
return console.warn.apply(console, _ARR__chalk__warn(...arguments)) | ||
} | ||
export function error__chalk() { | ||
return console.error.apply(console, _ARR__chalk__error(...arguments)) | ||
} | ||
function _ARR__chalk__debug() { | ||
return ( | ||
use_chalk | ||
? [chalk.white(...arguments)] | ||
: arguments | ||
) | ||
} | ||
function _ARR__chalk__log() { | ||
return ( | ||
use_chalk | ||
? [chalk.grey(...arguments)] | ||
: arguments | ||
) | ||
} | ||
function _ARR__chalk__info() { | ||
return ( | ||
use_chalk | ||
? [chalk.green(...arguments)] | ||
: arguments | ||
) | ||
} | ||
function _ARR__chalk__warn() { | ||
return ( | ||
use_chalk | ||
? [chalk.red(...arguments)] | ||
: arguments | ||
) | ||
} | ||
function _ARR__chalk__error() { | ||
return ( | ||
use_chalk | ||
? [chalk.red.bold(...arguments)] | ||
: arguments | ||
) | ||
} | ||
function _chalk() { | ||
if (use_chalk) { | ||
return require('chalk') | ||
} else { | ||
return function chalk(...args) { | ||
return args | ||
} | ||
} | ||
} |
42
lib.js
@@ -1,2 +0,40 @@ | ||
require = require('esm')(module) | ||
module.exports = require('./lib.mjs') | ||
import { | ||
debug__chalk, | ||
log__chalk, | ||
info__chalk, | ||
warn__chalk, | ||
error__chalk | ||
} from './chalk.js' | ||
export function debug() { | ||
return debug__chalk(_timestamp(), ...arguments) | ||
} | ||
export function log() { | ||
return log__chalk(_timestamp(), ...arguments) | ||
} | ||
export function info() { | ||
return info__chalk(_timestamp(), ...arguments) | ||
} | ||
export function warn() { | ||
return warn__chalk(_timestamp(), ...arguments) | ||
} | ||
export function error() { | ||
return error__chalk(_timestamp(), ...arguments) | ||
} | ||
export const error__log = error | ||
function _timestamp() { | ||
return (new Date()).toISOString() | ||
} | ||
export function _log(message, fn) { | ||
return function () { | ||
log(message) | ||
return fn.apply(this, arguments) | ||
} | ||
} | ||
export function _console(fn, ctx__log) { | ||
return function () { | ||
for (let key in ctx__log) { | ||
console[key](ctx__log[key]) | ||
} | ||
return fn.apply(this, arguments) | ||
} | ||
} |
{ | ||
"name": "@ctx-core/logger", | ||
"version": "2.2.12", | ||
"version": "3.0.0", | ||
"description": "ctx-core logger", | ||
@@ -24,7 +24,6 @@ "main": "lib.js", | ||
"dependencies": { | ||
"@ctx-core/object": "^2.6.0", | ||
"chalk": "^2.4.1", | ||
"esm": "^3.0.84" | ||
"@ctx-core/object": "^3.0.0", | ||
"chalk": "^2.4.1" | ||
}, | ||
"gitHead": "ef8c06c1b6e6183cce5b0836c59761cce170a6e9" | ||
"gitHead": "7d0d73495e67101da1ad8aeb87a7b9918b4689c1" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
2
2965
5
104
1
+ Added@ctx-core/function@6.0.0(transitive)
+ Added@ctx-core/object@3.3.0(transitive)
- Removedesm@^3.0.84
- Removed@ctx-core/function@4.2.0(transitive)
- Removed@ctx-core/object@2.6.0(transitive)
- Removedesm@3.2.25(transitive)
Updated@ctx-core/object@^3.0.0