hughsk / hughsk/flat

Who is down for a minDepth option?

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

Description

This would complement `maxDepth` in a coherent way.

# minDepth

Number of nested objects to skip before flattening others.

```javascript
var flatten = require('flat')

flatten({
key1: {
keyA: 'valueI'
},
key2: {
keyB: 'valueII'
},
key3: { a: { b: { c: 2 } } }
}, { minDepth: 1 })

// {
// key1: { keyA: 'valueI' },
// key2: { keyB: 'valueII' },
// key3: { a: { 'b.c': 2 } }
// }
```

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.