Preprocessing bugfix

This commit is contained in:
Bán Dénes 2023-01-30 14:57:24 +01:00
parent c45523f38a
commit 480c362c1e
3 changed files with 24 additions and 1 deletions

View file

@ -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++
}