Skip to content

Commit 1e85855

Browse files
committed
Fix return types
1 parent 2899ad2 commit 1e85855

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
},
1919
"devDependencies": {
2020
"@types/aws-lambda": "^8.10.76",
21+
"@types/http-errors": "^1.8.0",
2122
"@types/jest": "^26.0.23",
2223
"@types/node": "^15.0.1",
2324
"@types/webpack": "^5.28.0",

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function ShallotAWS<
109109
event: TEvent,
110110
context: Context,
111111
callback: Callback<TResult>
112-
) => {
112+
): Promise<TResult | void> => {
113113
const request: ShallotAWSRequest<TEvent, TResult> = {
114114
event,
115115
context,
@@ -140,7 +140,9 @@ export function ShallotAWS<
140140
* @param middleware the middleware to apply
141141
* @return the handler with middleware applied
142142
*/
143-
ShallotAWSHandler.use = (middleware: ShallotAWSMiddleware) => {
143+
ShallotAWSHandler.use = (
144+
middleware: ShallotAWSMiddleware
145+
): ShallotAWSHandler<TEvent, TResult> => {
144146
if (middleware.before != null) {
145147
middlewares.before.push(middleware.before);
146148
}
@@ -158,7 +160,7 @@ export function ShallotAWS<
158160
middlewares.finally.push(middleware.finally);
159161
}
160162

161-
return ShallotAWSHandler;
163+
return ShallotAWSHandler as ShallotAWSHandler<TEvent, TResult>;
162164
};
163165

164166
return ShallotAWSHandler as ShallotAWSHandler<TEvent, TResult>;

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,11 @@
678678
dependencies:
679679
"@types/node" "*"
680680

681+
"@types/http-errors@^1.8.0":
682+
version "1.8.0"
683+
resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.0.tgz#682477dbbbd07cd032731cb3b0e7eaee3d026b69"
684+
integrity sha512-2aoSC4UUbHDj2uCsCxcG/vRMXey/m17bC7UwitVm5hn22nI8O8Y9iDpA76Orc+DWkQ4zZrOKEshCqR/jSuXAHA==
685+
681686
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
682687
version "2.0.3"
683688
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"

0 commit comments

Comments
 (0)