-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add support for all hash field expiration commands #2742
base: v5
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking good, but:
- I've made some changes, please review them..
- Seems like
HGETF
andHSETF
are missing
change look fine |
transformArguments(key: RedisArgument, fields: RedisVariadicArgument) { | ||
return pushVariadicArgument(['HPERSIST', key], fields); | ||
}, | ||
transformReply: undefined as unknown as () => ArrayReply<NumberReply> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoule we create an "enum" for the reply just like in HPEXIRE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created an enum
wondering why you didn't do an enum like response for HEXPIRETIME? |
I see why, as it returns a negative number on "error" (enum) and any positive number on "success", and can't capture that conception in typescript. |
otherwise changes looks fine, and I messed up initial tests, thanks for fixing. |
We can make an enum for type x = 1 | 2 | number; I think that some users will find the enum useful.. |
so I tried something like that, but it seemed like it ended up being shown as just number (as number is a superset of 1/2) |
It's possible, but a bit more complicated than that and even if we don't use that in the return type, I think that some users will still find the enum useful (something like |
I agree, but I can't seem to get omit to work with NumberReply as NumerReply expects a number subtype, but Omit doesn't seem to return an number that can be used by it, and when I created a type manually without NumberReply, it didn't seem to make a difference in practice, was still just number. but yes, I created the enum to use, just unsure how to expose it to the user. export const HASH_FIELD_EXPIRETIME = { |
Description
adds the has field expiration commands - for testing purposes, need a docker container that has it in it.
Checklist
npm test
pass with this change (including linting)?