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

middy

Package Overview
Dependencies
Maintainers
7
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

middy - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json
{
"name": "middy",
"version": "0.3.0",
"version": "0.3.1",
"description": "The simple (but cool 😎) middleware engine for AWS lambda in Node.js",

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

@@ -447,4 +447,6 @@ <div align="center">

<dd></dd>
<dt><a href="#middlewareFunction">middlewareFunction</a> : <code>function</code></dt>
<dt><a href="#middlewareNextFunction">middlewareNextFunction</a> : <code>function</code></dt>
<dd></dd>
<dt><a href="#middlewareFunction">middlewareFunction</a> ⇒ <code>void</code> | <code>Promise</code></dt>
<dd></dd>
<dt><a href="#middlewareObject">middlewareObject</a> : <code>Object</code></dt>

@@ -505,6 +507,18 @@ <dd></dd>

<a name="middlewareNextFunction"></a>
## middlewareNextFunction : <code>function</code>
**Kind**: global typedef
| Param | Type | Description |
| --- | --- | --- |
| error | <code>error</code> | An optional error object to pass in case an error occurred |
<a name="middlewareFunction"></a>
## middlewareFunction : <code>function</code>
## middlewareFunction ⇒ <code>void</code> \| <code>Promise</code>
**Kind**: global typedef
**Returns**: <code>void</code> \| <code>Promise</code> - - A middleware can return a Promise instead of using the `next` function as a callback.
In this case middy will wait for the promise to resolve (or reject) and it will automatically
propagate the result to the next middleware.

@@ -514,3 +528,3 @@ | Param | Type | Description |

| handler | <code>function</code> | the original handler function. It will expose properties `event`, `context`, `response` and `error` that can be used to interact with the middleware lifecycle |
| next | <code>function</code> | the callback to invoke to pass the control to the next middleware |
| next | [<code>middlewareNextFunction</code>](#middlewareNextFunction) | the callback to invoke to pass the control to the next middleware |

@@ -517,0 +531,0 @@ <a name="middlewareObject"></a>

@@ -33,2 +33,8 @@ const isPromise = require('./isPromise')

/**
* @typedef middlewareNextFunction
* @type {function}
* @param {error} error - An optional error object to pass in case an error occurred
*/
/**
* @typedef middlewareFunction

@@ -39,3 +45,6 @@ * @type {function}

* be used to interact with the middleware lifecycle
* @param {function} next - the callback to invoke to pass the control to the next middleware
* @param {middlewareNextFunction} next - the callback to invoke to pass the control to the next middleware
* @return {void|Promise} - A middleware can return a Promise instead of using the `next` function as a callback.
* In this case middy will wait for the promise to resolve (or reject) and it will automatically
* propagate the result to the next middleware.
*/

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