Skip to content
Snippets Groups Projects
Verified Commit ccacc2ca authored by kPherox's avatar kPherox
Browse files

Fix to parse for non atom object

parent d686c853
No related branches found
No related tags found
1 merge request!29Fix parse object type config
......@@ -112,7 +112,9 @@ export const parseTuples = (tuples, key) => {
} else if (item.tuple[1] && typeof item.tuple[1] === 'object' && 'tuple' in item.tuple[1]) {
accum[item.tuple[0].substr(1)] = item.tuple[1]['tuple'].join('.')
} else if (item.tuple[1] && typeof item.tuple[1] === 'object') {
accum[item.tuple[0].substr(1)] = parseObject(item.tuple[1])
nonAtomsObjects.includes(item.tuple[0])
? accum[item.tuple[0].substr(1)] = parseNonAtomObject(item.tuple[1])
: accum[item.tuple[0].substr(1)] = parseObject(item.tuple[1])
} else {
key === 'mrf_user_allowlist'
? accum[item.tuple[0]] = item.tuple[1]
......@@ -129,6 +131,13 @@ const parseNonAtomTuples = (tuples) => {
}, {})
}
const parseNonAtomObject = (object) => {
return Object.keys(object).reduce((acc, item) => {
acc[item] = object[item]
return acc
}, {})
}
const parseObject = (object) => {
return Object.keys(object).reduce((acc, item) => {
acc[item.substr(1)] = object[item]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment