Skip to content

Commit

Permalink
style: remove trailing whitespace (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Nov 3, 2024
1 parent 9e94065 commit 986596f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion .taprc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
files:
- test/**/*.test.js

30 changes: 15 additions & 15 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,76 +13,76 @@ declare namespace Tokens {
*/
secret(callback: SecretCallback): void;
secret(): Promise<string>;

/**
* Create a new secret key synchronously.
*/
secretSync(): string;
}

export interface TokensSimple extends TokensBase {
/**
* Create a new CSRF token.
*/
create(secret: string): string;

/**
* Verify if a given token is valid for a given secret.
*/
verify(secret: string, token: string): boolean;
}

export interface TokensUserinfo extends TokensBase {
/**
* Create a new CSRF token.
*/
create(secret: string, userInfo: string): string;

/**
* Verify if a given token is valid for a given secret.
*/
verify(secret: string, token: string, userInfo: string): boolean;
}

export type SecretCallback = (err: Error | null, secret: string) => void;

export interface Options {
/**
* The algorithm used to generate the token
* @default sha256
*/
algorithm?: string;

/**
* The string length of the salt
*
*
* @default 8
*/
saltLength?: number;
/**
* The byte length of the secret key
*
*
* @default 18
*/
secretLength?: number;

/**
* The maximum milliseconds of validity of this token. 0 disables the check.
*
*
* @default 0
*/
validity?: number;

/**
* Require userInfo on create() and verify()
*
*
* @default false
*/
userInfo?: boolean;

/**
* The HMAC key used to generate the cryptographic HMAC hash
*
*
*/
hmacKey?: string | ArrayBuffer | Buffer | TypedArray | DataView | CryptoKey;
}
Expand Down

0 comments on commit 986596f

Please sign in to comment.