common-types
Advanced tools
Comparing version 1.20.3 to 1.20.4
@@ -361,2 +361,21 @@ 'use strict'; | ||
/** | ||
* A type guard to ensure the passed in serverless configuration defines a "handler" | ||
* rather than an "image". | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
function isServerlessFunctionHandler(config) { | ||
return config.handler ? true : false; | ||
} | ||
/** | ||
* A type guard to ensure the passed in serverless configuration points to an | ||
* "image" rather than a "handler" | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
function isServerlessFunctionImage(config) { | ||
return config.image ? true : false; | ||
} | ||
/** | ||
* Ways in which missing data can be treated. | ||
@@ -437,4 +456,6 @@ * | ||
exports.isLambdaProxyRequest = isLambdaProxyRequest; | ||
exports.isServerlessFunctionHandler = isServerlessFunctionHandler; | ||
exports.isServerlessFunctionImage = isServerlessFunctionImage; | ||
exports.parseStack = parseStack; | ||
exports.wait = wait; | ||
//# sourceMappingURL=index.js.map |
@@ -13,3 +13,4 @@ import { seconds } from "../aliases"; | ||
*/ | ||
export declare type IServerlessFunction = ({ | ||
export declare type IServerlessFunction = IServerlessFunctionHandler | IServerlessFunctionImage; | ||
export interface IServerlessFunctionHandler extends IServerlessFunctionConfig { | ||
/** | ||
@@ -22,3 +23,4 @@ * the handler function in the form of "/path/to/file.HANDLER_FN" where | ||
handler: string; | ||
} | { | ||
} | ||
export interface IServerlessFunctionImage extends IServerlessFunctionConfig { | ||
/** | ||
@@ -30,3 +32,18 @@ * Image to be used by function, cannot be used when `handler` is defined. | ||
image: string; | ||
}) & { | ||
} | ||
/** | ||
* A type guard to ensure the passed in serverless configuration defines a "handler" | ||
* rather than an "image". | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
export declare function isServerlessFunctionHandler(config: IServerlessFunction): config is IServerlessFunctionHandler; | ||
/** | ||
* A type guard to ensure the passed in serverless configuration points to an | ||
* "image" rather than a "handler" | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
export declare function isServerlessFunctionImage(config: IServerlessFunction): config is IServerlessFunctionImage; | ||
export interface IServerlessFunctionConfig { | ||
/** optional, deployed Lambda name */ | ||
@@ -153,3 +170,3 @@ name?: string; | ||
events?: IServerlessEvent[]; | ||
}; | ||
} | ||
export interface ICloudformationReference { | ||
@@ -156,0 +173,0 @@ Ref: string; |
@@ -357,2 +357,21 @@ /** | ||
/** | ||
* A type guard to ensure the passed in serverless configuration defines a "handler" | ||
* rather than an "image". | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
function isServerlessFunctionHandler(config) { | ||
return config.handler ? true : false; | ||
} | ||
/** | ||
* A type guard to ensure the passed in serverless configuration points to an | ||
* "image" rather than a "handler" | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
function isServerlessFunctionImage(config) { | ||
return config.image ? true : false; | ||
} | ||
/** | ||
* Ways in which missing data can be treated. | ||
@@ -428,3 +447,3 @@ * | ||
export { AWS_REGIONS, HttpStatusCodes, LambdaEventParser, StepFunctionMissingDataTreatment, createBindDeploymentConfig, getBodyFromPossibleLambdaProxyRequest, isLambdaProxyRequest, parseStack, wait }; | ||
export { AWS_REGIONS, HttpStatusCodes, LambdaEventParser, StepFunctionMissingDataTreatment, createBindDeploymentConfig, getBodyFromPossibleLambdaProxyRequest, isLambdaProxyRequest, isServerlessFunctionHandler, isServerlessFunctionImage, parseStack, wait }; | ||
//# sourceMappingURL=index.js.map |
@@ -13,3 +13,4 @@ import { seconds } from "../aliases"; | ||
*/ | ||
export declare type IServerlessFunction = ({ | ||
export declare type IServerlessFunction = IServerlessFunctionHandler | IServerlessFunctionImage; | ||
export interface IServerlessFunctionHandler extends IServerlessFunctionConfig { | ||
/** | ||
@@ -22,3 +23,4 @@ * the handler function in the form of "/path/to/file.HANDLER_FN" where | ||
handler: string; | ||
} | { | ||
} | ||
export interface IServerlessFunctionImage extends IServerlessFunctionConfig { | ||
/** | ||
@@ -30,3 +32,18 @@ * Image to be used by function, cannot be used when `handler` is defined. | ||
image: string; | ||
}) & { | ||
} | ||
/** | ||
* A type guard to ensure the passed in serverless configuration defines a "handler" | ||
* rather than an "image". | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
export declare function isServerlessFunctionHandler(config: IServerlessFunction): config is IServerlessFunctionHandler; | ||
/** | ||
* A type guard to ensure the passed in serverless configuration points to an | ||
* "image" rather than a "handler" | ||
* | ||
* @param config a serverless configuration | ||
*/ | ||
export declare function isServerlessFunctionImage(config: IServerlessFunction): config is IServerlessFunctionImage; | ||
export interface IServerlessFunctionConfig { | ||
/** optional, deployed Lambda name */ | ||
@@ -153,3 +170,3 @@ name?: string; | ||
events?: IServerlessEvent[]; | ||
}; | ||
} | ||
export interface ICloudformationReference { | ||
@@ -156,0 +173,0 @@ Ref: string; |
{ | ||
"name": "common-types", | ||
"version": "1.20.3", | ||
"version": "1.20.4", | ||
"description": "Common types not included in Typescript", | ||
@@ -28,3 +28,3 @@ "repository": "https://github.com/lifegadget/common-types", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^17.0.0", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@types/chai": "^4.2.11", | ||
@@ -31,0 +31,0 @@ "@types/mocha": "^8.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
312322
7468