Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Who is down for a minDepth option? #99

Open
sunknudsen opened this issue Mar 18, 2020 · 2 comments
Open

Who is down for a minDepth option? #99

sunknudsen opened this issue Mar 18, 2020 · 2 comments

Comments

@sunknudsen
Copy link

This would complement maxDepth in a coherent way.

minDepth

Number of nested objects to skip before flattening others.

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 } }
// }
@waji-io
Copy link

waji-io commented May 13, 2020

Would love to see this option as well.

@qu-y
Copy link

qu-y commented Mar 3, 2021

I'm looking for this option as well. I intend to convert my data to csv, and need to keep first level as headers, but the default flatten everything using the index 0,data 1.data ... etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants