Flatten starting at a specific level
- Dominant language
- JavaScript
- Stars
- 1.8k
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
First thanks for such a great library!
I was wondering if there is a config that will allow me to flatten my JSON file starting at a specific depth instead of always flattening from the root to leaf.
Use case:
Input:
```js
flatten(
{
"foo": {
"bar": {
"a": 1,
"b": 2,
"c": 3
}
},
"amaze": {
"muppet": "wow",
"haw": "maw"
}
}
);
```
Output:
```js
{
"foo": {
"bar.a": 1,
"bar.b": 2,
"bar.c": 3,
},
"amaze": {
"muppet": "wow",
"haw": "maw"
}
}
```
Looking at the current options it seems like this would be the opposite of `maxDepth`. Maybe a `minDepth` option.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.