mmkal / handy-redis

A wrapper around node_redis with Promise and TypeScript support.
Apache License 2.0
172 stars 10 forks source link

fix: allow +inf,-inf, ranges in interval args (redis-doc workaround) #240

Closed mmkal closed 4 years ago

mmkal commented 4 years ago

Fixes #30

Now that v2 has a more maintainable "patching" system, this works around https://github.com/redis/redis-doc/issues/1420 - to be removed if a fix is merged there.

This effectively allows string values to be passed as min and max for ZRANGEBYSCORE, ZREMRANGEBYSCORE, ZREVRANGEBYSCORE and ZCOUNT.

Note: in future, it may be possible to use template literal types to only allow strings like (1 rather than any strings, but it's likely too complex and will require a higher typescript version than most users have.