hughsk / hughsk/flat

Flatten does not flatten empty objects or arrays

Open
#74 20 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.8k
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Issue:

Suppose I have the following object

`{
"foo": {
"bar": "hello-world"
},
"data": {},
"tests": []
}`

I would expect this object to be flattened if I need it for some sort of operation which does not support complex objects.
Perhaps it would be flattened in this way
`{
"foo.bar": "hello-world",
"data": "{}",
"tests": "[]"
}`

Or, perhaps there is a better way to do this; but, what actually occurs is the following

`{
"foo.bar": "hello-world",
"data": {},
"tests": []
}`

Where, in reality, this has not been flattened. There still exists nested objects, they are just empty.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.