Skip to content

ctrombley/ua-dotpathlookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ua-dotpathlookup

A simple function to convert a dot notation string to its corresponding value on an object, written as part of a technical evaluation.

var dotpath = require('ua-dotpathlookup')
var find = dotpath('part.key.attribute')

var found = find({part: {key: {attribute: "woop woop"} }})
console.log(found) // outputs "woop woop"

var not_found = find({}) || find() || find(null)
console.log(not_found) // outputs undefined

LICENSE

MIT

About

A simple function to convert a dot notation string to its corresponding value on an object, written as part of a technical evaluation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published