abi
abi2y ago

npm:redis – everything returns `string`?

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?
3 Replies
abi
abi2y ago
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']
AapoAlas
AapoAlas2y ago
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?
abi
abi2y ago
i tried, but it was really obscure. tbh i ended up just using /x/redis and it works a lot better 😛 thank you!