Skip to content

TIME command return type is incorrect #1874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
strmer15 opened this issue Jan 25, 2022 · 0 comments
Closed

TIME command return type is incorrect #1874

strmer15 opened this issue Jan 25, 2022 · 0 comments
Labels

Comments

@strmer15
Copy link

When I updated our codebase to 4.0.2, one piece of code broke:

  const redisTime = await redis.TIME()
  return redisTime.getTime()

Typescript complains about the getTime call saying This expression is not callable. Type '{}' has no call signatures.ts(2349) and when I hover over it, getTime is defined as an object and not a function anymore.

My workaround is to cast it to Date, but something seems to have gone wrong with this return type. Seems like having TimeReply extend Date isn't working correctly in Typescript?

Environment:

  • Typescript Version: 4.4.4
  • Node.js Version: 12.20.8
  • Redis Server Version: N/A
  • Node Redis Version: 4.0.2
  • Platform: Mac OS 11.6.2
@strmer15 strmer15 added the Bug label Jan 25, 2022
leibale added a commit to leibale/node-redis that referenced this issue Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant