Support values other than objects in the numKeys filter, returning zero if so.

This commit is contained in:
Paulo Reis 2017-02-21 14:48:21 +00:00
parent 7f6941677d
commit 96c44eec38

View file

@ -2,4 +2,8 @@ define [
"base"
], (App) ->
app.filter "numKeys", () ->
(object) -> Object.keys(object).length
(object) ->
if object?
return Object.keys(object).length
else
return 0