Socket
Socket
Sign inDemoInstall

bunyan-decorator

Package Overview
Dependencies
22
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.6

2

package.json
{
"name": "bunyan-decorator",
"version": "1.0.4",
"version": "1.0.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -23,10 +23,8 @@ #bunyan-decorator

// Now decorator you class method
// Now decorator your class method to log it
class MyClass {
@log(Level.info)
searchById(req, res) {
return req.services[this._serviceClass]
.byId(req.params.id)
.then(json(res))
.catch(error(res));
searchById(id) {
return MySearchService.byId(id);
}

@@ -39,11 +37,9 @@ }

```
```javascript
class MyClass {
// This extractor ensure the promise result is not logged
// This extractor will transform the result nil, thus not return value is logged
@log(Level.info, { extractor: result => {} })
searchById(req, res) {
return req.services[this._serviceClass]
.byId(req.params.id)
.then(json(res))
.catch(error(res));
searchById(id) {
return MySearchService.byId(id);
}

@@ -50,0 +46,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc