Skip to content

Commit

Permalink
ref+fix: simpler bool check, including 'undefined'
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Mar 14, 2024
1 parent d210ce7 commit 0c35e5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ RpcClient.callspec = {
getPoolInfo: '',
getRawMemPool: 'bool',
getRawChangeAddress: '',
getRawTransaction: 'str int',
getRawTransaction: 'str bool',
getReceivedByAccount: 'str int',
getReceivedByAddress: 'str int',
getSpentInfo: 'obj',
Expand Down Expand Up @@ -377,7 +377,7 @@ function generateRPCMethods(constructor, apiCalls, rpc) {
return parseFloat(arg);
},
bool(arg) {
return (arg === true || arg == '1' || arg == 'true' || arg.toString().toLowerCase() == 'true');
return (String(arg).toLowerCase() === 'true' || arg > 0);
},
obj(arg) {
if (typeof arg === 'string') {
Expand Down

0 comments on commit 0c35e5e

Please sign in to comment.