New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aws-lambda-helper

Package Overview
Dependencies
Maintainers
3
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 1.0.1 to 1.0.2

coverage/coverage.json

12

package.json
{
"name": "aws-lambda-helper",
"version": "1.0.1",
"version": "1.0.2",
"description": "Collection of helper methods for lambda",
"main": "index.js",
"main": "src/index.js",
"scripts": {

@@ -18,11 +18,13 @@ "nocov": "node ./node_modules/.bin/mocha --compilers js:babel-register test/*/*.js",

},
"license": "GPL-2.0",
"homepage": "https://github.com/tcdl/aws-lambda-helper",
"devDependencies": {
"eslint": "^1.10.3",
"eslint-config-semistandard": "^5.0.0",
"babel-cli": "^6.4.5",
"babel-istanbul": "^0.6.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-preset-es2015": "^6.3.13",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-register": "^6.4.3",
"eslint": "^1.10.3",
"eslint-config-semistandard": "^5.0.0",
"mocha": "^2.4.5"

@@ -29,0 +31,0 @@ },

# aws-lambda-helper
Collection of helper methods for lambda
## Installation
`$ npm install aws-lambda-helper --save`
## Usage
`const helper = require('aws-lambda-helper');`
### getEnvironment
Function to get environment from context object
Example:
```
const context = {
invokedFunctionArn: 'arn:123:abs:prod'
};
helper.getEnvironment(context, function (err, env) {
console.log(env);
//print 'prod'
});
```
### validateWithSchema
Function to validate input data with defined schema
```
import payloadSchema from '../schemas/validationSchema';
const data = {
a: 1,
b: 'Hello World'
};
helper.validateWithSchema(data, payloadSchema, function (err, valid) {
console.log(valid);
//print 'true'
});
```

@@ -25,9 +25,7 @@ 'use strict';

var validation = _tv2.default.validateResult(event, payloadSchema, true);
if (!validation.valid) return cb(validation.error);
if (!validation.valid) return cb(validation.error, false);
cb(null, true);
}
exports.default = {
getEnvironment: getEnvironment,
validateWithSchema: validateWithSchema
};
exports.default = { getEnvironment: getEnvironment, validateWithSchema: validateWithSchema };
module.exports = exports['default'];
'use strict';
import assert from 'assert';
import helper from '../../lib/index';
import helper from '../../lib';
import payloadSchema from '../fixtures/validationSchema';

@@ -21,3 +21,3 @@

assert.equal(err.message, 'Missing required property: param4');
assert.equal(data, undefined);
assert.equal(data, false);
done();

@@ -24,0 +24,0 @@ });

Sorry, the diff of this file is not supported yet

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