mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04: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"
|
"base"
|
||||||
], (App) ->
|
], (App) ->
|
||||||
app.filter "numKeys", () ->
|
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