Who is down for a minDepth option?
sunknudsen opened this issue · comments
Sun Knudsen commented
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 } }
// }
Jörn Ishikawa commented
Would love to see this option as well.
Quy commented
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