mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-13 22:22:58 +00:00
Make sure table.prepareObject() doesn't removes non empty arrays
This commit is contained in:
parent
e390efd46e
commit
26c69d183d
@ -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]
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user