UNPKG

@enter-at/lambda-handlers

Version:

An opinionated Typescript package that facilitates specifying AWS Lambda handlers including input validation, error handling and response formatting.

19 lines (18 loc) 506 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CORSHeader = void 0; class CORSHeader { origin; credentials; constructor(origin = "*", credentials = false) { this.origin = origin; this.credentials = credentials; } create() { return { "Access-Control-Allow-Origin": this.origin, ...(this.credentials && { "Access-Control-Allow-Credentials": true }), }; } } exports.CORSHeader = CORSHeader;