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

winston-meta-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-meta-wrapper - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

22

index.js

@@ -5,3 +5,3 @@ 'use strict'

const formatRegExp = /%[sdj]/g
var formatRegExp = /%[sdj]/g

@@ -15,2 +15,3 @@ var wrapper = function (logger) {

this._logger = logger
this._filters = {}
}

@@ -29,5 +30,18 @@

}
this._logger.log.apply(this._logger, args)
if (this.filterApplies(args[formatArguments + 2])) {
this._logger.log.apply(this._logger, args)
}
}
WinstonMetaWrapper.prototype.filterApplies = function (metaArgs) {
return _.every(this._filters, function (regex, key) {
var r = new RegExp(regex)
if (_.has(metaArgs, key)) {
return r.test(metaArgs[key])
} else {
return true
}
})
}
WinstonMetaWrapper.prototype.error = function () {

@@ -65,2 +79,6 @@ var args = Array.prototype.slice.call(arguments)

WinstonMetaWrapper.prototype.setFilter = function (key, filterRegEx) {
this._filters[key] = filterRegEx
}
WinstonMetaWrapper.prototype.addMeta = function (meta) {

@@ -67,0 +85,0 @@ _.merge(this._meta, meta)

8

package.json
{
"name": "winston-meta-wrapper",
"version": "1.1.0",
"version": "1.2.0",
"description": "Wraps Winston logger to always add a set of metadata",

@@ -25,8 +25,8 @@ "main": "index.js",

"dependencies": {
"lodash": "^4.14.2"
"lodash": "4.15.0"
},
"devDependencies": {
"publish": "^0.6.0",
"winston": "^2.2.0"
"publish": "0.6.0",
"winston": "2.2.0"
}
}
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