1
0
mirror of https://github.com/danog/fast-srp.git synced 2024-11-26 20:04:49 +01:00

Replace function name check with instanceof so that it works after minification (#2)

This commit is contained in:
Andre Hsu 2021-01-11 00:57:35 +08:00 committed by GitHub
parent 0644fb274b
commit b27158dac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,8 +17,8 @@ function assertIsBuffer(arg: Buffer, argname = "arg"): void {
assert_(Buffer.isBuffer(arg), `Type error: ${argname} must be a buffer`);
}
function assertIsBigInteger(arg: BigInteger, argname?: string): void {
assert_(arg.constructor.name === "BigInteger", `Type error: ${argname} must be a BigInteger`);
function assertIsBigInteger(arg: BigInteger, argname = "arg"): void {
assert_(arg instanceof BigInteger, `Type error: ${argname} must be a BigInteger`);
}
/**