File tree Expand file tree Collapse file tree 2 files changed +32
-6
lines changed Expand file tree Collapse file tree 2 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -2114,7 +2114,20 @@ export const COMMANDS: Record<keyof C.ICommandAPIs, ICommand> = {
21142114 'args' : [ key , start , stop , 'WITHSCORES' ]
21152115 } ;
21162116 } ,
2117- process : U . pairList2NullableStringDict
2117+ process : ( items : Array < [ number , Buffer ] > ) : Array < { member : string ; score : number ; } > => {
2118+
2119+ const ret : Array < { member : string ; score : number ; } > = [ ] ;
2120+
2121+ for ( let i = 0 ; i < items . length ; i = i + 2 ) {
2122+
2123+ ret . push ( {
2124+ 'member' : items [ i ] [ 1 ] . toString ( ) ,
2125+ 'score' : parseFloat ( items [ i + 1 ] [ 1 ] . toString ( ) )
2126+ } ) ;
2127+ }
2128+
2129+ return ret ;
2130+ }
21182131 } ,
21192132
21202133 /**
@@ -2129,7 +2142,20 @@ export const COMMANDS: Record<keyof C.ICommandAPIs, ICommand> = {
21292142 'args' : [ key , start , stop , 'WITHSCORES' ]
21302143 } ;
21312144 } ,
2132- process : U . pairList2NullableBufferDict
2145+ process : ( items : Array < [ number , Buffer ] > ) : Array < { member : Buffer ; score : number ; } > => {
2146+
2147+ const ret : Array < { member : Buffer ; score : number ; } > = [ ] ;
2148+
2149+ for ( let i = 0 ; i < items . length ; i = i + 2 ) {
2150+
2151+ ret . push ( {
2152+ 'member' : items [ i ] [ 1 ] ,
2153+ 'score' : parseFloat ( items [ i + 1 ] [ 1 ] . toString ( ) )
2154+ } ) ;
2155+ }
2156+
2157+ return ret ;
2158+ }
21332159 } ,
21342160
21352161 /**
Original file line number Diff line number Diff line change @@ -1225,25 +1225,25 @@ export interface ICommandAPIs {
12251225 * Command: zAdd
12261226 * @see https://redis.io/commands/zAdd
12271227 */
1228- zAdd ( key : string , field : string , value : string | Buffer ) : Promise < boolean > ;
1228+ zAdd ( key : string , member : string , score : string | Buffer ) : Promise < boolean > ;
12291229
12301230 /**
12311231 * Command: zRem
12321232 * @see https://redis.io/commands/zRem
12331233 */
1234- zRem ( key : string , values : Array < string | Buffer > ) : Promise < number > ;
1234+ zRem ( key : string , members : Array < string | Buffer > ) : Promise < number > ;
12351235
12361236 /**
12371237 * Command: zRange
12381238 * @see https://redis.io/commands/zRange
12391239 */
1240- zRangeWithScores ( key : string , start : number , stop : number ) : Promise < Record < string , string > > ;
1240+ zRangeWithScores ( key : string , start : number , stop : number ) : Promise < Array < { member : string ; score : number ; } > > ;
12411241
12421242 /**
12431243 * Command: zRange
12441244 * @see https://redis.io/commands/zRange
12451245 */
1246- zRangeWithScores$ ( key : string , start : number , stop : number ) : Promise < Record < string , Buffer > > ;
1246+ zRangeWithScores$ ( key : string , start : number , stop : number ) : Promise < Array < { member : Buffer ; score : number ; } > > ;
12471247
12481248 /**
12491249 * Command: pfAdd
You can’t perform that action at this time.
0 commit comments