Comparing version 1.2.2 to 1.3.0
# CHANGELOG | ||
### 1.3.0 | ||
**2018/03/16** | ||
- [#18] Expose browser.js for rollup and the like. Fixes [#5]. | ||
- [#13] @dabh Use new version of colors. | ||
- [#15] @dabh Add Typescript typings (ported from DefinitelyTyped). | ||
- [#17], [#16] Fix error messages other typos. | ||
### 1.2.2 | ||
@@ -4,0 +12,0 @@ **2017/12/05** |
@@ -53,3 +53,3 @@ 'use strict'; | ||
throw new Error([ | ||
'No tranform function found on format. Did you create a format instance?', | ||
'No transform function found on format. Did you create a format instance?', | ||
'const myFormat = format(formatFn);', | ||
@@ -56,0 +56,0 @@ 'const instance = myFormat();' |
@@ -27,3 +27,4 @@ 'use strict'; | ||
Object.defineProperty(format, name, { | ||
get: function () { return require('./' + path); } | ||
get: function () { return require('./' + path); }, | ||
configurable: true | ||
}); | ||
@@ -30,0 +31,0 @@ } |
{ | ||
"name": "logform", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "An mutable object-based log format designed for chaining & objectMode streams.", | ||
"main": "index.js", | ||
"browser": "browser.js", | ||
"scripts": { | ||
@@ -28,3 +29,3 @@ "lint": "populist *.js test/*.js examples/*.js", | ||
"dependencies": { | ||
"colors": "^1.1.2", | ||
"colors": "^1.2.0", | ||
"fecha": "^2.3.2" | ||
@@ -31,0 +32,0 @@ }, |
@@ -12,15 +12,21 @@ /* eslint no-undefined: 0 */ | ||
* | ||
* const { level, message, ...rest } = info; | ||
* ${level}: ${message} ${JSON.stringify(rest)} | ||
* const { level, message, splat, ...rest } = info; | ||
* | ||
* ${level}: ${message} if rest is empty | ||
* ${level}: ${message} ${JSON.stringify(rest)} otherwise | ||
*/ | ||
module.exports = format(function (info) { | ||
info[MESSAGE] = info.level + ': ' + info.message + ' ' + JSON.stringify( | ||
Object.assign({}, info, { | ||
level: undefined, | ||
message: undefined, | ||
splat: undefined | ||
}) | ||
); | ||
const stringifiedRest = JSON.stringify(Object.assign({}, info, { | ||
level: undefined, | ||
message: undefined, | ||
splat: undefined | ||
})); | ||
if (stringifiedRest !== '{}') { | ||
info[MESSAGE] = `${info.level}: ${info.message} ${stringifiedRest}`; | ||
} else { | ||
info[MESSAGE] = `${info.level}: ${info.message}`; | ||
} | ||
return info; | ||
}); |
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
27297
29
607
Updatedcolors@^1.2.0