Closed kamiljano closed 3 years ago
Thanks for looking into it, but better not to use or
operator for this case, for instance these cases will return wrong result (null
), while the values are being perfectly valid:
0 || null // null
"" || null // null
best way to check if key actually exists is using the in
operator or object.hasOwnProperty(key)
:
if (mockInstance.storage[hash].value.hasOwnProperty(key)) {
return mockInstance.storage[hash].value[key];
}
return null;
well that is a fair point. I'll fix it
et voilla
fixing: https://github.com/yeahoffline/redis-mock/issues/152