Skip to content

null and undefined sorting

Compare
Choose a tag to compare
@justinbmeyer justinbmeyer released this 05 Nov 21:58
· 64 commits to master since this release

Issue: #24

This fixes a bug where sorting a "Schema"ed property that had a null or undefined value was erring. Something like the following was breaking:

var results = todoQueryLogic.filterMembers({
	sort: "due"
}, [
	{
		id: 1,
		due: null
	},
	{
		id: 2,
		due: new Date(2001,0,1).toString()
	},
	{
		id: 3,
		due: new Date(2000,0,1).toString()
	},
	{
		id: 4,
		due: null
	}
]);

Undefined and null values will come first now.