-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
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:
(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 ?
Environment:
- Node.js Version: v14.18.2
- Redis Server Version: 6.2.6
- Node Redis Version: redis@4.0.3
- Platform: Ubuntu 20.04.3 LTS