Make sure table.prepareObject() doesn't removes non empty arrays

This commit is contained in:
Juan Cruz Viotti 2014-11-19 10:29:59 -04:00
parent e390efd46e
commit 26c69d183d
2 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,7 @@ exports.prepareObject = (object) ->
return not startsWithLetter(key)
for key, value of object
if _.isObject(value)
if _.isObject(value) and not _.isArray(value)
object[key] = exports.prepareObject(value)
displayKey = KEY_DISPLAY_MAP[key]

View File

@ -56,3 +56,7 @@ describe 'Table:', ->
'Git Repository': 'git@git.staging.resin.io:jviotti/helloresin.git'
Commit: '1234'
'Device Type': 'raspberry-pi'
it 'should not remove not empty arrays', ->
object = { array: [ 1, 2, 3 ] }
expect(table.prepareObject(object)).to.deep.equal(object)