File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,19 @@ export function HSET<T extends TRedisHash>(
5252 ) ;
5353}
5454
55- function encodeHashEntries ( hash : RedisHash , values : object ) {
55+ function encodeHashEntries < T extends TRedisHash > (
56+ hash : RedisHash < T > ,
57+ values : object ,
58+ ) {
5659 const entries = Object . entries ( values ) as [ string , RedisValue ] [ ] ;
5760 if ( entries . length === 0 ) {
5861 throw new Error ( "At least one field must be provided" ) ;
5962 }
6063 for ( let i = 0 ; i < entries . length ; i ++ ) {
61- entries [ i ] [ 1 ] = hash . encodeField ( entries [ i ] [ 0 ] , entries [ i ] [ 1 ] ) ;
64+ entries [ i ] [ 1 ] = hash . encodeField (
65+ entries [ i ] [ 0 ] as RedisField < T > ,
66+ entries [ i ] [ 1 ] ,
67+ ) ;
6268 }
6369 return entries ;
6470}
Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ export function XADD<T extends TRedisStreamEntry>(
5454 ...modifiers : Modifiers < [ Require < NOMKSTREAM > , MAXLEN | MINID ] >
5555) : RedisCommand < null > ;
5656
57- export function XADD (
58- stream : RedisStream ,
57+ export function XADD < T extends TRedisStreamEntry > (
58+ stream : RedisStream < T > ,
5959 id : "*" | ( string & { } ) ,
60- data : Value < TRedisStreamEntry > ,
60+ data : Value < T > ,
6161 ...modifiers : Modifiers
6262) : RedisCommand < any > {
6363 return new RedisCommand ( [
You can’t perform that action at this time.
0 commit comments