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

lambda-wrap

Package Overview
Dependencies
Maintainers
1
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 1.0.1 to 1.0.3

.circleci/config.yml

6

index.js
'use strict';
const wrapError = require('./lib/error');
const { LambdaWrap } = require('./lib/lambda-wrap');
const error = require('./lib/error');
const LambdaWrap = require('./lib/lambdaWrap');
module.exports = { LambdaWrap, wrapError };
module.exports = { LambdaWrap, error };
'use strict';
/**
* Return new error object.
*
* @param {string} message - Error message.
* @param {integer} code - Error code.
*/
const error = (message, code) => {

@@ -4,0 +10,0 @@ const err = new Error(message);

@@ -14,3 +14,3 @@ 'use strict';

Object.assign(headers, TEXT_TYPE);
} else if (typeof data === 'object' && data.statusCode) {
} else if (typeof data === 'object') {
Object.assign(headers, JSON_TYPE);

@@ -21,8 +21,7 @@ } else {

const res = {
statusCode: data.statusCode || 200,
body: JSON.stringify(data),
headers
};
const statusCode = data.statusCode || 200;
const body = JSON.stringify(data.body);
const res = { statusCode, body };
logger.log(res);

@@ -29,0 +28,0 @@

{
"name": "lambda-wrap",
"version": "1.0.1",
"version": "1.0.3",
"description": "",

@@ -12,3 +12,4 @@ "main": "index.js",

"test:coverage:threshold": "node ./node_modules/.bin/istanbul check",
"test:lint": "eslint ./lib/**/*.js ./test/**/*.js"
"test:lint": "eslint ./lib/**/*.js ./test/**/*.js",
"doc:generate": "node ./bin/makeApiDoc.js"
},

@@ -31,2 +32,3 @@ "author": "Pragonauts <lukas.hykl@pragonauts.com> (https://pragonauts.com)",

"istanbul": "^0.4.5",
"jsdoc-to-markdown": "^4.0.1",
"mocha": "^4.0.1",

@@ -33,0 +35,0 @@ "mocha-istanbul": "^0.3.0"

Sorry, the diff of this file is not supported yet

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