package clientds;

import ufront.db.Object;
import haxe.ds.*;

class ClientDsUtil
{
	public static function filterByCriteria(l:Iterable<Object>, criteria:{})
	{
		var matches = new IntMap<Object>();
		for (obj in l)
		{
			var match = true;
			for (field in Reflect.fields(criteria))
			{
				var criteriaValue = Reflect.field(criteria, field);
				var objValue = Reflect.getProperty(obj, field);
				if (criteriaValue != objValue)
				{
					match = false;
					break;
				}
			}
			if (match) matches.set(obj.id, obj);
		}
		return matches;
	}
}
package clientds;

import ufront.db.Object;
import haxe.ds.*;
import Dynamics;

class ClientDsUtil
{
	public static function filterByCriteria(l:Iterable<Object>, criteria:{})
	{
		var matches = new IntMap<Object>();
		for (obj in l)
		{
			var match = true;
			for (field in Reflect.fields(criteria))
			{
				var criteriaValue = Reflect.field(criteria, field);
				var objValue = Reflect.getProperty(obj, field);
				if (Dynamics.same(criteriaValue,objValue) == false)
				{
					match = false;
					break;
				}
			}
			if (match) matches.set(obj.id, obj);
		}
		return matches;
	}
}
Fix for searching for a Date (or other objects with different equality semantics)
Fix for searching for a Date (or other objects with different equality semantics)

ufront/ufront-clientds