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

aws-lambda-handlers-ajv

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-lambda-handlers-ajv

AJV validator for the AWS lambda handlers

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Yup validation for AWS Lambda Handlers

Validation helper bundling AJV used for aws-lambda-handlers

Installation

npm i aws-lambda-handlers-ajv

Usage

import ajvValidation from 'aws-lambda-handlers-ajv';
import { LambdaFactoryManager } from 'aws-lambda-handlers';

const mgr = new LambdaFactoryManager();
// ...Compose mgr with other methods at wish

const mgrWithValidation = ajvValidation( mgr );

export default mgrWithValidation;

The validator can then be used for runtime schema validation

import mgr from '/path/to/manager'

const schema = {
    type: "object",
    properties: {
        keyStr: {
            type: "string"
        },
        keyNum: {
            type: "number"
        }
    }
} as const;

const { handler } = mgr
    .apiGatewayWrapperFactory('handler')
    .setTsInputType<JTDDataType<typeof schema>>()
    .validateInput("ajv", schema) // <== Note this line here
    .wrapFunc( async () => {
        //... Function logic
    })

Keywords

FAQs

Package last updated on 30 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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