Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
fix: fix broken return type (#247)
Browse files Browse the repository at this point in the history
This function returns a string but without the return type it gets marked as 'any'
  • Loading branch information
achingbrain authored Mar 10, 2022
1 parent 125d33c commit afa5b6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pbkdf2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const hashName = {
/**
* Computes the Password-Based Key Derivation Function 2.
*/
export default function pbkdf2 (password: string, salt: string, iterations: number, keySize: number, hash: string) {
export default function pbkdf2 (password: string, salt: string, iterations: number, keySize: number, hash: string): string {
if (hash !== 'sha1' && hash !== 'sha2-256' && hash !== 'sha2-512') {
const types = Object.keys(hashName).join(' / ')
throw errcode(new Error(`Hash '${hash}' is unknown or not supported. Must be ${types}`), 'ERR_UNSUPPORTED_HASH_TYPE')
Expand Down

0 comments on commit afa5b6d

Please sign in to comment.