stipsan / ioredis-mock

Emulates ioredis by performing all operations in-memory.
MIT License
341 stars 125 forks source link

Lua return nil returns undefined instead of null #1043

Open sean256 opened 3 years ago

sean256 commented 3 years ago
const MockRedis = require('ioredis-mock');

const redis = new MockRedis();

(async () => {
    redis.defineCommand('nilTest', { numberOfKeys: 0, lua: 'return nil' });
    const result = await redis.nilTest();
    console.log(result); // outputs undefined instead of null
})();
stipsan commented 3 years ago

Hey @sean256! Thanks for the report 👍

I don't have time to work on this myself but PRs welcome and I'll push out a fix faster than you can say "merge my PR" if anyone steps up 😄