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

Add Support for arrays #6

Open
blak3r opened this issue Feb 1, 2018 · 1 comment
Open

Add Support for arrays #6

blak3r opened this issue Feb 1, 2018 · 1 comment

Comments

@blak3r
Copy link

blak3r commented Feb 1, 2018

If you have an array of objects nested, I think it should still include these.

var testObj = {
    level1: {
        prop1_1: "abc",
        level2: {
            prop2_1: "abc",
            level3: {
                prop3_1: "abc",
                array3_2: [ {
                    prop3_2_1: "abc",
                }],
            }
        }
    }
}

var deepKeys = require('deep-keys');

console.log( deepKeys(testObj).join("\n") );

Output

level1.prop1_1
level1.level2.prop2_1
level1.level2.level3.prop3_1
level1.level2.level3.array3_2

Expected Output

level1.prop1_1
level1.level2.prop2_1
level1.level2.level3.prop3_1
level1.level2.level3.array3_2.0.props3_2_1
@renanlecaro
Copy link

renanlecaro commented Jan 14, 2019

It would break existing uses cases for the lib.
You can install my forked version (that treats arrays as objects) this way :
npm install renanlecaro/deep-keys#master

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

No branches or pull requests

3 participants