We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There're certainly situations where I could use this method:
var src = { "a": true, "b": { "ba": true, "bb": true } } var arr = _.deepKeys(src); // returns ["a", "b.ba", "b.bb"]
This is my quick implementation which I needed:
function deepKeys(obj, path) { path = path || []; if (_.isArray(obj)) { path.push('0'); obj = obj[0]; } return _.reduce(obj, function (result, value, key) { if (_.isPlainObject(value) || _.isArray(value)) { return result.concat(deepKeys(value, path.concat(key))); } result.push(path.concat(key).join(".")); return result; }, []); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
There're certainly situations where I could use this method:
This is my quick implementation which I needed:
The text was updated successfully, but these errors were encountered: