mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Support values other than objects in the numKeys filter, returning zero if so.
This commit is contained in:
parent
7f6941677d
commit
96c44eec38
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue