When set set("hello", undefined), get("hello") return null.
Reason as follow:
if value.v? part will be compile to :
_unwrap(value, asClone = true) {
if (!this.options.useClones) {
asClone = false;
}
//***** when value.v is undefined, will not go in to the if body, return null directly
if (value.v != null) {
if (asClone) {
return clone(value.v);
} else {
return value.v;
}
}
return null;
}
Reactions are currently unavailable
node-cache/_src/lib/node_cache.coffee
Line 642 in 3d6ef83
When set set("hello", undefined), get("hello") return null.
Reason as follow:
if value.v? part will be compile to :
_unwrap(value, asClone = true) { if (!this.options.useClones) { asClone = false; } //***** when value.v is undefined, will not go in to the if body, return null directly if (value.v != null) { if (asClone) { return clone(value.v); } else { return value.v; } } return null; }