mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 19:41:33 +02:00
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