1.2.1 • Published 3 years ago

dotprop v1.2.1

Weekly downloads
6,131
License
MIT
Repository
github
Last release
3 years ago

dotprop Build Status

Get property by dot notation. A short and dependable implementation.

var getProp = require('dotprop');

getProp({a: { b: { c: 1}} }, 'a.b.c') // 1
getProp([1,2,3], 2) // 3
getProp({}, 'a.b') // undefined

// recognizes arrays too
getProp({a: { b: { c: 1}} }, ['a', 'b', 'c']) // 1
getProp({a: { 'b.c': 1 }}, ['a', 'b.c']) // 1

Similar

NPM