Here is some Javascript (coffescript) code:
.filter "scFilter", () ->
(collection, search) ->
return collection unless search
regexp = createAccentRegexp(search)
doesMatch = (txt) -> (''+txt).match(regexp)
collection.filter (el) ->
if typeof el == 'object'
return true for att, value of el when (typeof(value) === 'string' || typeof(value) === 'number') and doesMatch(value) and att !== '$$hashKey'
else
doesMatch(el)
I am looking to modify the line "return true for att, value of el when typeof(value) is 'string' and doesMatch(value) and att isnt '$$hashKey'" so that it can filter both number and string values.