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
Smallest possible implementation: only 120 bytes.
There's possibly smaller version:
export dlv = (obj, key) => (key.split ? key.split('.') : key).reduce((a,b)=>b?a?.[b]:a,obj)
The text was updated successfully, but these errors were encountered:
Or even smaller (71b):
export default (obj, key) => (key.split?.('.') || key).reduce((a,b)=>a?.[b],obj)
Sorry, something went wrong.
Optional chaining support: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
that's not the point
export default (obj, key) => (key.map?key:key.split('.')).reduce((a,b)=>a?a[b]:a,obj)
No branches or pull requests
There's possibly smaller version:
The text was updated successfully, but these errors were encountered: