userCache
userCache copied to clipboard
Ignores the cache if required field exists but is falsy
The return value of _getField()
is usually defined by:
if (!doc[field[i]]) {
return; // === undefined
}
and then the existance of the field is determined by:
if (typeof _getField(cache, item) === "undefined") {
innocent = false;
}}
This will cause the cache to be missed if a required field exists but is falsy. E.g.:
doc = {admin: false}; // or null fails as well
field = 'admin';
_getField(doc, field); // undefined, the cache will be ignored :-(