File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed
ts_src/lib/converter/shared Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,13 @@ function makeConverter(TYPE_BYTE) {
34
34
'leafHashes: Buffer[]; ' +
35
35
'}' ;
36
36
function check ( data ) {
37
- let leafHashesStatus = true ;
38
- if ( data . leafHashes && data . leafHashes . length ) {
39
- leafHashesStatus = data . leafHashes . every (
37
+ return (
38
+ Array . isArray ( data . leafHashes ) &&
39
+ data . leafHashes . every (
40
40
leafHash => Buffer . isBuffer ( leafHash ) && leafHash . length === 32 ,
41
- ) ;
42
- }
43
- return leafHashesStatus && parent . check ( data ) ;
41
+ ) &&
42
+ parent . check ( data )
43
+ ) ;
44
44
}
45
45
return {
46
46
decode,
Original file line number Diff line number Diff line change @@ -49,14 +49,13 @@ export function makeConverter(
49
49
'leafHashes: Buffer[]; ' +
50
50
'}' ;
51
51
function check ( data : any ) : data is TapBip32Derivation {
52
- let leafHashesStatus = true ;
53
- if ( data . leafHashes && data . leafHashes . length ) {
54
- leafHashesStatus = data . leafHashes . every (
52
+ return (
53
+ Array . isArray ( data . leafHashes ) &&
54
+ data . leafHashes . every (
55
55
( leafHash : any ) => Buffer . isBuffer ( leafHash ) && leafHash . length === 32 ,
56
- )
57
- }
58
-
59
- return leafHashesStatus && parent . check ( data )
56
+ ) &&
57
+ parent . check ( data )
58
+ ) ;
60
59
}
61
60
62
61
return {
You can’t perform that action at this time.
0 commit comments