You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a typeScript project, When assigning a constant to the result of rPopLPush command, TS type the constant to number
In reality, it's a string (the value of element being popped)
(async () => {
const client = createClient(options) as RedisClientType;
await client.connect();
await client.lPush("pendingList", "my cool value");
const res = await client.rPopLPush("pendingList", "doneList"); // res: number | null
console.log(res); // my cool value
})();
Is it because of the declaration of RPOPLPUSH.d.ts ? export declare function transformReply(): number | null;
Should it be string | null or RedisCommandArgument | null
Do you want me to make a PR ?
With a typeScript project, When assigning a constant to the result of rPopLPush command, TS type the constant to
number
In reality, it's a string (the value of element being popped)
Redis tell the same
https://redis.io/commands/rpoplpush#return-value
Short reproduction:
Is it because of the declaration of RPOPLPUSH.d.ts ?
export declare function transformReply(): number | null;
Should it be
string | null
orRedisCommandArgument | null
Do you want me to make a PR ?
Environment:
The text was updated successfully, but these errors were encountered: