Support for regex queries in presets

This commit is contained in:
Zaid Abdulla committed 2013-07-29 21:08:03 +03:00
1 parent 1aed17374f
commit 0b596487a5
2 files changed
+6 -1

No files matched your search

+5 -1
View File
@@ -9,10 +9,14 @@ test = (obj, query) ->
value = common.getParamValueFromPath(obj, k)
if common.typeOf(v) isnt common.OBJECT_TYPE
# TODO comparing array to regex, array to array, and object to object
if common.typeOf(value) is common.ARRAY_TYPE
res = value.indexOf(v) != -1
else
res = v == value
if common.typeOf(v) is common.REGEXP_TYPE
res = v.test(value)
else
res = v == value
else
for k2,v2 of v
switch k2