Preprocessing bugfix
This commit is contained in:
parent
c45523f38a
commit
480c362c1e
3 changed files with 24 additions and 1 deletions
|
@ -42,11 +42,14 @@ const traverse = exports.traverse = (config, root, breadcrumbs, op) => {
|
|||
}
|
||||
return result
|
||||
} else if (a.type(config)() == 'array') {
|
||||
// needed so that arrays can set output the same way as objects within ops
|
||||
const dummy = {}
|
||||
const result = []
|
||||
let index = 0
|
||||
for (const val of config) {
|
||||
breadcrumbs.push(`[${index}]`)
|
||||
result[index] = traverse(val, root, breadcrumbs, op)
|
||||
op(dummy, 'dummykey', traverse(val, root, breadcrumbs, op), root, breadcrumbs)
|
||||
result[index] = dummy.dummykey
|
||||
breadcrumbs.pop()
|
||||
index++
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue