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

lambda-wrap

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-wrap - npm Package Compare versions

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

4

lib/logFilters.js

@@ -94,7 +94,7 @@ /*

const val = options.logFields[key];
if (val === true) {
if (val === false) {
delete logData[key];
} else if (typeof val === 'function') {
logData[key] = val(logData[key]);
if (logData[key] === true || logData[key] === null) {
if (!logData[key]) {
delete logData[key];

@@ -101,0 +101,0 @@ }

{
"name": "lambda-wrap",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"description": "AWS Serverless wrapper for async generators",

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

@@ -70,16 +70,5 @@ # LambdaWrap

**Kind**: global class
* [lambdaWrap](#lambdaWrap)
* [new lambdaWrap([options])](#new_lambdaWrap_new)
* [~wrap(fn)](#lambdaWrap..wrap) ⇒ <code>lambdaHandler</code>
* [.responseHandler](#lambdaWrap..wrap.responseHandler)
* [.errorResponseHandler](#lambdaWrap..wrap.errorResponseHandler)
* [.logger](#lambdaWrap..wrap.logger)
* [.before(fn)](#lambdaWrap..wrap.before)
* [.catch(fn)](#lambdaWrap..wrap.catch)
* [.finally(fn)](#lambdaWrap..wrap.finally)
<a name="new_lambdaWrap_new"></a>
### new lambdaWrap([options])
### new lambdaWrap([globalOptions])
`lambdaWrap` function. You can pass options to override or assign new

@@ -114,79 +103,8 @@ attributes to `event` object. For example add custom headers:

**Returns**: <code>wrapFn</code> - - the wrap function
**Returns**: <code>function</code> - - the wrap function
| Param | Type | Description |
| --- | --- | --- |
| [options] | <code>LambdaWrapOptions</code> | Use to override or assign new attributes to `event` object. E.g. headers. |
| [globalOptions] | <code>LambdaWrapOptions</code> | Use to override or assign new attributes |
<a name="lambdaWrap..wrap"></a>
### lambdaWrap~wrap(fn) ⇒ <code>lambdaHandler</code>
**Kind**: inner method of [<code>lambdaWrap</code>](#lambdaWrap)
**Returns**: <code>lambdaHandler</code> - - Lambda handler.
| Param | Type | Description |
| --- | --- | --- |
| fn | <code>function</code> | Function to be wrapped and used as a lambda handler. |
* [~wrap(fn)](#lambdaWrap..wrap) ⇒ <code>lambdaHandler</code>
* [.responseHandler](#lambdaWrap..wrap.responseHandler)
* [.errorResponseHandler](#lambdaWrap..wrap.errorResponseHandler)
* [.logger](#lambdaWrap..wrap.logger)
* [.before(fn)](#lambdaWrap..wrap.before)
* [.catch(fn)](#lambdaWrap..wrap.catch)
* [.finally(fn)](#lambdaWrap..wrap.finally)
<a name="lambdaWrap..wrap.responseHandler"></a>
#### wrap.responseHandler
Override default response function
**Kind**: static property of [<code>wrap</code>](#lambdaWrap..wrap)
<a name="lambdaWrap..wrap.errorResponseHandler"></a>
#### wrap.errorResponseHandler
Override default error response function
**Kind**: static property of [<code>wrap</code>](#lambdaWrap..wrap)
<a name="lambdaWrap..wrap.logger"></a>
#### wrap.logger
Override default logger object - `console`.
MUST implement `log`, `warn` and `error` methods.
**Kind**: static property of [<code>wrap</code>](#lambdaWrap..wrap)
<a name="lambdaWrap..wrap.before"></a>
#### wrap.before(fn)
Add new middleware.
**Kind**: static method of [<code>wrap</code>](#lambdaWrap..wrap)
| Param | Type | Description |
| --- | --- | --- |
| fn | <code>function</code> | Middleware function. |
<a name="lambdaWrap..wrap.catch"></a>
#### wrap.catch(fn)
Add new catch.
**Kind**: static method of [<code>wrap</code>](#lambdaWrap..wrap)
| Param | Type | Description |
| --- | --- | --- |
| fn | <code>function</code> | Catch function. |
<a name="lambdaWrap..wrap.finally"></a>
#### wrap.finally(fn)
Add finally method, which will be called after each request
**Kind**: static method of [<code>wrap</code>](#lambdaWrap..wrap)
| Param | Type | Description |
| --- | --- | --- |
| fn | <code>function</code> | Middleware function. |
<a name="error"></a>

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