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

@middy/error-logger

Package Overview
Dependencies
Maintainers
3
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/error-logger - npm Package Compare versions

Comparing version 5.0.0-alpha.1 to 5.0.0-alpha.2

30

index.js
const defaults = {
logger: ({ error }) => console.error(error)
}
logger: ({ error })=>console.error(error)
};
const errorLoggerMiddleware = (opts = {})=>{
let { logger } = {
...defaults,
...opts
};
if (typeof logger !== 'function') logger = null;
const errorLoggerMiddlewareOnError = async (request)=>{
logger(request);
};
return {
onError: logger ? errorLoggerMiddlewareOnError : null
};
};
export default errorLoggerMiddleware;
const errorLoggerMiddleware = (opts = {}) => {
let { logger } = { ...defaults, ...opts }
if (typeof logger !== 'function') logger = null
const errorLoggerMiddlewareOnError = async (request) => {
logger(request)
}
return {
onError: logger ? errorLoggerMiddlewareOnError : null
}
}
export default errorLoggerMiddleware
{
"name": "@middy/error-logger",
"version": "5.0.0-alpha.1",
"version": "5.0.0-alpha.2",
"description": "Input and output logger middleware for the middy framework",

@@ -63,3 +63,3 @@ "type": "module",

"devDependencies": {
"@middy/core": "5.0.0-alpha.1",
"@middy/core": "5.0.0-alpha.2",
"@types/node": "^20.0.0"

@@ -66,0 +66,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