Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

logform

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logform - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

browser.js

8

CHANGELOG.md
# 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**

2

combine.js

@@ -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;
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc