isPlainObject

This commit is contained in:
Ben Ogle 2014-09-25 14:50:52 -07:00
parent 3a8f842de3
commit fcf2143e70

View File

@ -624,7 +624,7 @@ class Config
extractDefaultsFromSchema: (schema) ->
if schema.default?
schema.default
else if schema.type is 'object' and schema.properties? and typeof schema.properties is "object"
else if schema.type is 'object' and schema.properties? and isPlainObject(schema.properties)
defaults = {}
properties = schema.properties or {}
defaults[key] = @extractDefaultsFromSchema(value) for key, value of properties