File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
packages/bloom/lib/commands/top-k Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,19 @@ export type TopKInfoReplyMap = TuplesToMapReply<[
7
7
[ SimpleStringReply < 'decay' > , DoubleReply ]
8
8
] > ;
9
9
10
- export type TkInfoReply = {
10
+ export type TkInfoReply2 = {
11
11
k : NumberReply ;
12
12
width : NumberReply ;
13
13
depth : NumberReply ;
14
14
decay : number ;
15
15
}
16
+
17
+ export type TkInfoReply3 = {
18
+ k : NumberReply ;
19
+ width : NumberReply ;
20
+ depth : NumberReply ;
21
+ decay : DoubleReply ;
22
+ }
16
23
17
24
export default {
18
25
FIRST_KEY_INDEX : 1 ,
@@ -21,35 +28,35 @@ export default {
21
28
return [ 'TOPK.INFO' , key ] ;
22
29
} ,
23
30
transformReply : {
24
- 2 : ( reply : UnwrapReply < Resp2Reply < TopKInfoReplyMap > > ) : TkInfoReply => {
31
+ 2 : ( reply : UnwrapReply < Resp2Reply < TopKInfoReplyMap > > ) : TkInfoReply2 => {
25
32
return {
26
33
k : reply [ 1 ] ,
27
34
width : reply [ 3 ] ,
28
35
depth : reply [ 5 ] ,
29
36
decay : Number ( reply [ 7 ] )
30
37
} ;
31
38
} ,
32
- 3 : ( reply : UnwrapReply < TopKInfoReplyMap > ) : TkInfoReply => {
39
+ 3 : ( reply : UnwrapReply < TopKInfoReplyMap > ) : TkInfoReply3 => {
33
40
if ( reply instanceof Map ) {
34
41
return {
35
42
k : reply . get ( 'k' ) as NumberReply ,
36
43
width : reply . get ( 'width' ) as NumberReply ,
37
44
depth : reply . get ( 'depth' ) as NumberReply ,
38
- decay : Number ( reply . get ( 'decay' ) as DoubleReply )
45
+ decay : reply . get ( 'decay' ) as DoubleReply
39
46
} ;
40
47
} else if ( reply instanceof Array ) {
41
48
return {
42
49
k : reply [ 1 ] ,
43
50
width : reply [ 3 ] ,
44
51
depth : reply [ 5 ] ,
45
- decay : Number ( reply [ 7 ] )
52
+ decay : reply [ 7 ]
46
53
} ;
47
54
} else {
48
55
return {
49
56
k : reply [ 'k' ] ,
50
57
width : reply [ 'width' ] ,
51
58
depth : reply [ 'depth' ] ,
52
- decay : Number ( reply [ 'decay' ] )
59
+ decay : reply [ 'decay' ]
53
60
} ;
54
61
}
55
62
}
You can’t perform that action at this time.
0 commit comments