Skip to content

Commit

Permalink
Revert 2b7c0bb and instead add a ts-ignore statement
Browse files Browse the repository at this point in the history
Adds back the existing error message that was removed
  • Loading branch information
wolfy1339 committed Aug 25, 2020
1 parent 90eaa87 commit 3825b15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sign/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { createHmac } from "crypto";

export function sign(secret: string, payload: string | object): string {
// @ts-ignore throw friendly error message when required options are missing
if (!secret || !payload) {
throw new TypeError("secret & payload required");
}

payload =
typeof payload === "string" ? payload : toNormalizedJsonString(payload);
return "sha1=" + createHmac("sha1", secret).update(payload).digest("hex");
Expand Down

0 comments on commit 3825b15

Please sign in to comment.