Skip to content

Commit 2265a49

Browse files
OttoAllmendingerllm-git
andcommitted
feat(utxo-core): replace lodash type checks with native JavaScript
Replace lodash type checking helpers with standard JavaScript type checks for improved performance and reduced dependencies. Issue: BTC-0 Co-authored-by: llm-git <[email protected]>
1 parent 62776df commit 2265a49

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/utxo-core/src/bip32utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as utxolib from '@bitgo/utxo-lib';
2-
import * as _ from 'lodash';
32
import * as bitcoinMessage from 'bitcoinjs-message';
43
import { BIP32Interface } from '@bitgo/utxo-lib';
54
/**
@@ -17,7 +16,7 @@ export function signMessage(
1716
throw new Error(`must provide privateKey`);
1817
}
1918
}
20-
if (!_.isObject(network) || !_.isString(network.messagePrefix)) {
19+
if (network === null || typeof network !== 'object' || typeof network.messagePrefix !== 'string') {
2120
throw new Error(`invalid argument 'network'`);
2221
}
2322
const compressed = true;
@@ -37,7 +36,7 @@ export function verifyMessage(
3736
if (!Buffer.isBuffer(publicKey)) {
3837
publicKey = publicKey.publicKey;
3938
}
40-
if (!_.isObject(network) || !_.isString(network.messagePrefix)) {
39+
if (network === null || typeof network !== 'object' || typeof network.messagePrefix !== 'string') {
4140
throw new Error(`invalid argument 'network'`);
4241
}
4342

0 commit comments

Comments
 (0)