mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added support for minor version parameters in bcrypt 2.0 (#25182)
* Updated for bcrypt 2.0 * Added missing @param declaration for minor
This commit is contained in:
parent
1462bc999b
commit
ab7694a033
@ -8,15 +8,24 @@ let error: Error;
|
||||
|
||||
str = bcrypt.genSaltSync();
|
||||
str = bcrypt.genSaltSync(num);
|
||||
str = bcrypt.genSaltSync(num, str);
|
||||
|
||||
bcrypt.genSalt(num, (err: Error, salt: string): void => { error = err; str = salt; })
|
||||
.then(salt => str = salt)
|
||||
.catch(err => error = err);
|
||||
|
||||
bcrypt.genSalt(num, str, (err: Error, salt: string): void => { error = err; str = salt; })
|
||||
.then(salt => str = salt)
|
||||
.catch(err => error = err);
|
||||
|
||||
bcrypt.genSalt(num)
|
||||
.then(salt => str = salt)
|
||||
.catch(err => error = err);
|
||||
|
||||
bcrypt.genSalt(num, str)
|
||||
.then(salt => str = salt)
|
||||
.catch(err => error = err);
|
||||
|
||||
bcrypt.genSalt((err: Error, salt: string): void => { error = err; str = salt; })
|
||||
.then(salt => str = salt)
|
||||
.catch(err => error = err);
|
||||
|
||||
22
types/bcrypt/index.d.ts
vendored
22
types/bcrypt/index.d.ts
vendored
@ -1,20 +1,32 @@
|
||||
// Type definitions for bcrypt 1.0
|
||||
// Type definitions for bcrypt 2.0
|
||||
// Project: https://www.npmjs.org/package/bcrypt
|
||||
// Definitions by: Peter Harris <https://github.com/codeanimal>, Ayman Nedjmeddine <https://github.com/IOAyman>
|
||||
// Definitions by: Peter Harris <https://github.com/codeanimal>
|
||||
// Ayman Nedjmeddine <https://github.com/IOAyman>
|
||||
// David Stapleton <https://github.com/dstapleton92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/**
|
||||
* @param rounds The cost of processing the data. Default 10.
|
||||
* @param rounds The cost of processing the data. Default 10.
|
||||
* @param minor The minor version of bcrypt to use. Either 'a' or 'b'. Default 'b'.
|
||||
*/
|
||||
export declare function genSaltSync(rounds?: number): string;
|
||||
export declare function genSaltSync(rounds?: number, minor?: string): string;
|
||||
|
||||
/**
|
||||
* @param rounds The cost of processing the data. Default 10.
|
||||
* @param callback A callback to be fire once the sald has been generated. Uses eio making it asynchronous.
|
||||
* @return A promise to be either resolved with the generated salt or rejected with an Error
|
||||
*/
|
||||
export declare function genSalt(rounds: number, callback?: (err: Error, salt: string) => void): Promise<string>;
|
||||
export declare function genSalt(rounds?: number, callback?: (err: Error, salt: string) => void): Promise<string>;
|
||||
|
||||
/**
|
||||
* @param rounds The cost of processing the data. Default 10.
|
||||
* @param minor The minor version of bcrypt to use. Either 'a' or 'b'. Default 'b'.
|
||||
* @param callback A callback to be fire once the sald has been generated. Uses eio making it asynchronous.
|
||||
* @return A promise to be either resolved with the generated salt or rejected with an Error
|
||||
*/
|
||||
export declare function genSalt(rounds?: number, minor?: string, callback?: (err: Error, salt: string) => void): Promise<string>;
|
||||
|
||||
/**
|
||||
* @param callback A callback to be fire once the sald has been generated. Uses eio making it asynchronous.
|
||||
* @return A promise to be either resolved with the generated salt or rejected with an Error
|
||||
|
||||
Loading…
Reference in New Issue
Block a user