Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Feb 15, 2024
1 parent 848b864 commit c286cca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function checkKey(key: Hex, type: "public" | "private") {
// TweetNaCl.js private key (includes public key)
// split the private key from the public key
export function parsePrivateKey(privateKey?: string) {
if ( !privateKey ) return;
if (!privateKey) return;
if (typeof privateKey === "string" && privateKey.length === 128) {
return privateKey.slice(0, 64);
}
Expand Down
4 changes: 2 additions & 2 deletions src/postWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export async function postWebhook(url: string, body: string, secretKey?: Hex, op
const timestamp = createTimestamp();
const headers = new Headers([
["content-type", "application/json"],
["x-signature-timestamp", String(timestamp)]
["x-signature-timestamp", String(timestamp)],
]);

// optional signature
if ( secretKey) {
if (secretKey) {
headers.set("x-signature-ed25519", sign(timestamp, body, secretKey));
}

Expand Down

0 comments on commit c286cca

Please sign in to comment.