Conversation
|
On second thought, I pushed a commit to re-add the It's not showing up on this PR yet. I am going to close and re-open this PR to see if I can get it to refresh. I assume it's an issue on GitHub's end. |
that worked 🙂 |
|
@gr2m, can you take a look at this when you have a minute? |
|
I updated the CI so that tests should run on PRs as well now 👍🏼 |
gr2m
left a comment
There was a problem hiding this comment.
Thanks!
If you want, it would be great to add type tests using https://github.com/SamVerschueren/tsd to avoid future regressions. Up to you! This is good to merge as is
Oh, that's interesting. I'll take a look at that sometime. thanks for merging!
|
|
🎉 This PR is included in version 3.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR fixes the types in
index.d.ts.Currently, the type signature for
createLambdaFunctionreturns a type ofAPIGatewayProxyHandlerwhich doesn't match its implementation.See the source code for
APIGatewayProxyHandlerhere:APIGatewayProxyHandler(which ultimately usesHandler, below) - https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b384d9e82713dc8400a1289eeb9be7f2fc467390/types/aws-lambda/trigger/api-gateway-proxy.d.ts#L12Handler- https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b384d9e82713dc8400a1289eeb9be7f2fc467390/types/aws-lambda/handler.d.ts#L83-L88void | Promise<APIGatewayProxyResult>. both of these items don't matchlambda-function.js, which only requires two arguments and returns a type ofPromise<APIGatewayProxyResult>Instead of using
APIGatewayProxyHandler, I switched the return type to simply be a function which accepts a singleAPIGatewayProxyEventargument and returns aPromise<APIGatewayProxyResult>type.This change also means the unused
contextargument increateLambdaFunctioncan be removed.