rjrodger/patrun

Falsy values and strange behaviour with list()

CExTNick opened this issue · 2 comments

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

thanks - will need to investigate

yep, bug - about to be fixed!
thank you!