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

aws-lambda-helper

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-lambda-helper - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

7

lib/index.js

@@ -82,3 +82,8 @@ 'use strict';

return AwsHelper._Lambda.invoke(p, cb);
return AwsHelper._Lambda.invoke(p, function (err, data) {
if (err) return cb(err);
var payload = JSON.parse(data.Payload);
if (payload.errorMessage) return cb(payload);
return cb(null, payload);
});
};

@@ -85,0 +90,0 @@

2

package.json
{
"name": "aws-lambda-helper",
"version": "2.2.0",
"version": "2.3.0",
"description": "Collection of helper methods for lambda",

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

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

assert.deepEqual(p, params);
cb(null, 'totes worked');
cb(null, {Payload: '{"totes": "worked"}'});
});

@@ -58,3 +58,3 @@

assert(err === null);
assert(data === 'totes worked');
assert.deepEqual(data, { 'totes': 'worked' });
done();

@@ -82,3 +82,3 @@ });

assert.deepEqual(p, params);
cb(null, 'totes worked');
cb(null, {Payload: '{"totes": "worked"}'});
});

@@ -95,3 +95,3 @@

assert(err === null);
assert(data === 'totes worked');
assert.deepEqual(data, { 'totes': 'worked' });
done();

@@ -101,2 +101,13 @@ });

it('should return error to the callback when the result contains an errorMessage', function (done) {
simple.mock(AwsHelper._Lambda, 'invoke').callbackWith(null, {Payload: '{"errorMessage": "some error"}'});
var p = {
FunctionName: 'a name'
};
AwsHelper.Lambda.invoke(p, function (err, data) {
assert.deepEqual(err, {'errorMessage': 'some error'});
done();
});
});
it('should create a Lambda object when not initiated', function (done) {

@@ -103,0 +114,0 @@ var context = {

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