Implement support for argument and reply transformers
See original GitHub issueReplace stopgap solutions: https://github.com/stipsan/ioredis-mock/blob/cffd1cfc03466442d7bb076dc1385b3af8852c46/src/commands/hmset.js#L9-L18 https://github.com/stipsan/ioredis-mock/blob/cffd1cfc03466442d7bb076dc1385b3af8852c46/src/command.js#L16-L17
with a proper Command.setArgumentTransformer
and Command.setReplyTransformer
interfaces.
As well as including the same default transformers found here:
https://github.com/luin/ioredis/blob/b216e4eb61d05ff639b162f23751acb111dde6e8/lib/command.js#L264-L277
https://github.com/luin/ioredis/blob/b216e4eb61d05ff639b162f23751acb111dde6e8/lib/command.js#L279-L289
https://github.com/luin/ioredis/blob/b216e4eb61d05ff639b162f23751acb111dde6e8/lib/command.js#L291-L300
The interface for defining them needs to be 100% compatible with this: https://github.com/luin/ioredis#transforming-arguments--replies
It looks like it means we need to implement it as singletons but this should be properly investigated. It’s very important that the mock does not behave differently than the real ioredis on this.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
That’s one of the goals, exactly!
I’ll make sure to praise you in our next changelog. You’ve been extremely responsive!