Support values other than objects in the numKeys filter, returning zero if so.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user