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

logformat

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logformat - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

9

index.js

@@ -31,7 +31,12 @@ "use strict";

function unhideErrorProperties(err) {
return _.extend(
err = _.extend(
Object.create(Object.getPrototypeOf(err)),
err,
_.pick(err, [ 'name', 'message', 'description', 'number', 'fileName', 'lineNumber', 'columnNumber', ])
_.pick(err, [ 'name', 'message', 'description', 'number', 'fileName', 'lineNumber', 'columnNumber', 'cause' ])
);
if (_.isError(err.cause)) {
err.cause = unhideErrorProperties(err.cause);
}
return err;
}

@@ -38,0 +43,0 @@

@@ -5,3 +5,3 @@ MIT License

```
Copyright (C) 2015-2021 SSi Canada and other contributors.
Copyright (C) 2015-2022 SSi Canada and other contributors.

@@ -8,0 +8,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "logformat",
"version": "3.0.0",
"version": "3.1.0",
"description": "stringify objects into searchable strings",

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

@@ -141,2 +141,8 @@ "use strict";

});
it('should log Error .cause', () => {
const cause = new Error('bad credentials')
const err = new Error('could not connect to db', { cause });
expect(logformat(err)).to.contain('bad credentials');
expect(logformat(err)).to.contain('could not connect');
});
});
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