Skip to content

Commit

Permalink
style: enforce explicit function return types
Browse files Browse the repository at this point in the history
  • Loading branch information
screendriver committed Oct 9, 2022
1 parent 07b8a3d commit e16e1ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"node": true
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off"
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true
}
]
}
}
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function verifySecret(
reqOrBody: IncomingMessage | string,
secret: string,
xHubSignature?: string | string[]
) {
): Promise<boolean> {
let body: string;
let signature: string | string[] | undefined;
if (typeof reqOrBody === "string") {
Expand All @@ -18,5 +18,6 @@ export async function verifySecret(
body = await text(reqOrBody);
signature = reqOrBody.headers["x-hub-signature"];
}

return verify(body, secret, signature);
}

0 comments on commit e16e1ae

Please sign in to comment.