Skip to content

Commit c46b58d

Browse files
authored
Merge pull request thomas4019#10 from kane-mason/feature/nested-array-project-fix
Non nested array fields can be handled normally
2 parents 009eb13 + da39734 commit c46b58d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

select.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ function convertRecur(fieldName, input, arrayFields, prefix, prefixStrip) {
77
var entries = []
88
for (var key in input) {
99
entries.push('\'' + key + '\'')
10-
if (!arrayFields.includes(prefix + key)) {
10+
const nestedArrayField = arrayFields.includes(prefix + key) && typeof input[key] === 'object'
11+
if (!nestedArrayField) {
1112
entries.push(convertRecur(fieldName, input[key], arrayFields, prefix + key + '.' , prefixStrip))
1213
} else {
1314
const path = util.pathToText([fieldName].concat((prefix + key).replace(new RegExp('^' + prefixStrip), '').split('.')), false)

0 commit comments

Comments
 (0)