Falsy values and strange behaviour with list()
CExTNick opened this issue · 2 comments
CExTNick commented
When inserting empty strings as keys, list() fails to list the added values even though findexact() will find them. Is the following behaviour expected?
var patrun = require('patrun');
var pat;
pat = patrun();
pat.add({
group: null,
subgroup: null,
key: 'value'
}, {a: 'a'});
console.log(pat.list().length); // 1
pat = patrun();
pat.add({
group: '',
subgroup: '',
key: 'value'
}, {a: 'a'});
console.log(pat.list().length); //0
rjrodger commented
thanks - will need to investigate
rjrodger commented
yep, bug - about to be fixed!
thank you!