Comparing version 0.3.0 to 0.3.1
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
322557
8483
550