Open NeilASega opened 1 year ago
Having investigated some more, I see that this function is in the "ioredis" module not "ioredis-mock" - so I've opened a new issue here: https://github.com/luin/ioredis/issues/1714
I will close this bug now and hope that "ioredis" devs fix it.
Unfortunately the problem has yet to be fixed by "ioredis". You can fix in "ioredis-mock" by adding...
args = args.flat();
...in "processArguments" function before calling the Command.transformer. This is essentially what "ioredis" is doing and hence why the bug does not present itself in their module.
@NeilASega if this is a widespread issue others might come across perhaps you could add a failing unit test to the codebase so that the discussion is easier to understand? I'm having trouble seeing the issue. It sounds like it also exists in redis itself?
There's a bug in msetArgumentTransformer where it assumes that "typeof object" represents a JS object when arrays also return "object" as their type.
Following update fixes it:
Thanks, Neil