D
Deno

help

npm:redis – everything returns `string`?

Aabi2/12/2023
Every command I try to use from npm:redis seems to have inferred return type string. Look at the screenshot. Surely this command should be returning string[]. Is this not supposed to be working automatically? Anyone tried this?
Aabi2/12/2023
The GitHub README says:
Replies will be transformed into useful data structures:
await client.hGetAll('key'); // { field1: 'value1', field2: 'value2' }
await client.hVals('key'); // ['value1', 'value2']
await client.hGetAll('key'); // { field1: 'value1', field2: 'value2' }
await client.hVals('key'); // ['value1', 'value2']
AAapoAlas2/12/2023
This seems like a bug in the types of the NPM package. Can you check the type definition of the hVals function in VS Code?
Aabi2/12/2023
i tried, but it was really obscure. tbh i ended up just using /x/redis and it works a lot better 😛 thank you!

Looking for more? Join the community!