-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
Flattened arrays with indexes that don't start at 0 can't easily be unflattened.
Example:
const testData = {
'complexObject.1.node.id': 'my-test-id',
}
const data = unflatten(testData) as object
console.log(JSON.stringify(data))
The output is:
{ "complexObject": [null, { "node": { "id": "my-test-id" } }] }Is there a way to retrieve an unflattened version of testData that does not contain a "null" item? The result I'm trying to achieve is:
{ "complexObject": [{ "node": { "id": "my-test-id" } }] }The reason my indexes don't start at 0 is because the algorithm I'm building is filtering items in arrays, so it is expected to have non sequential indexes / indexes not starting at 0 in the initial flattened structure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels