Skip to content

Commit 0b2f81b

Browse files
authored
Merge pull request #47 from onicagroup/issue40
Issue #40 - Type error in LambdaUtils and in example
2 parents ca970bd + ced14e9 commit 0b2f81b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/source/lambda_utils.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ General use
7272
export const hello = LambdaUtils.wrapApiHandler(async (event: LambdaUtils.APIGatewayProxyEvent) => {
7373
// These event objects are now always defined, so don't need to check for undefined. 🙂
7474
const who = event.pathParameters.who;
75-
const points = parseInt(event.queryStringParameters.points || 0);
75+
let points = Number(event.queryStringParameters.points || '0');
7676
7777
if (points > 0) {
7878
let message = 'Hello ' + who;

lambda-utils/lib/lambda-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import {Logger} from "@sailplane/logger";
1010

1111
const logger = new Logger('lambda-utils');
1212

13-
/** Define the async version of ProxyHandler */
14-
export type AsyncProxyHandler = (event: APIGatewayEvent, context: Context) => Promise<any>;
15-
1613
/**
1714
* Casted interface for APIGatewayProxyEvents as converted through the middleware
1815
*/
@@ -33,6 +30,9 @@ export interface APIGatewayProxyEvent extends AWS_APIGatewayProxyEvent {
3330
queryStringParameters: { [name: string]: string };
3431
}
3532

33+
/** Define the async version of ProxyHandler */
34+
export type AsyncProxyHandler = (event: APIGatewayProxyEvent, context: Context) => Promise<any>;
35+
3636
/**
3737
* Middleware to handle any otherwise unhandled exception by logging it and generating
3838
* an HTTP 500 response.

0 commit comments

Comments
 (0)