Skip to content

Commit

Permalink
rename param to opts
Browse files Browse the repository at this point in the history
  • Loading branch information
fboucquez committed Dec 2, 2024
1 parent 53dd7ca commit 7dc2fda
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ecc_lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { TinySecp256k1Interface } from './types';
* If `eccLib` is a new instance, it will be verified before setting it as the active library.
*
* @param eccLib The instance of the ECC library to initialize.
* @param skipVerification Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!
* @param opts Extra initialization options. Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!
*/
export declare function initEccLib(eccLib: TinySecp256k1Interface | undefined, skipVerification?: {
export declare function initEccLib(eccLib: TinySecp256k1Interface | undefined, opts?: {
DANGER_DO_NOT_VERIFY_ECCLIB: boolean;
}): void;
/**
Expand Down
6 changes: 3 additions & 3 deletions src/ecc_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ const _ECCLIB_CACHE = {};
* If `eccLib` is a new instance, it will be verified before setting it as the active library.
*
* @param eccLib The instance of the ECC library to initialize.
* @param skipVerification Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!
* @param opts Extra initialization options. Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!
*/
function initEccLib(eccLib, skipVerification) {
function initEccLib(eccLib, opts) {
if (!eccLib) {
// allow clearing the library
_ECCLIB_CACHE.eccLib = eccLib;
} else if (eccLib !== _ECCLIB_CACHE.eccLib) {
if (!skipVerification?.DANGER_DO_NOT_VERIFY_ECCLIB)
if (!opts?.DANGER_DO_NOT_VERIFY_ECCLIB)
// new instance, verify it
verifyEcc(eccLib);
_ECCLIB_CACHE.eccLib = eccLib;
Expand Down
6 changes: 3 additions & 3 deletions ts_src/ecc_lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ const _ECCLIB_CACHE: { eccLib?: TinySecp256k1Interface } = {};
* If `eccLib` is a new instance, it will be verified before setting it as the active library.
*
* @param eccLib The instance of the ECC library to initialize.
* @param skipVerification Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!
* @param opts Extra initialization options. Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!
*/
export function initEccLib(
eccLib: TinySecp256k1Interface | undefined,
skipVerification?: { DANGER_DO_NOT_VERIFY_ECCLIB: boolean },
opts?: { DANGER_DO_NOT_VERIFY_ECCLIB: boolean },
): void {
if (!eccLib) {
// allow clearing the library
_ECCLIB_CACHE.eccLib = eccLib;
} else if (eccLib !== _ECCLIB_CACHE.eccLib) {
if (!skipVerification?.DANGER_DO_NOT_VERIFY_ECCLIB)
if (!opts?.DANGER_DO_NOT_VERIFY_ECCLIB)
// new instance, verify it
verifyEcc(eccLib!);
_ECCLIB_CACHE.eccLib = eccLib;
Expand Down

0 comments on commit 7dc2fda

Please sign in to comment.