1.2.0 • Published 1 year ago

dotprop v1.2.0

Weekly downloads
6,320
License
unlicensed
Repository
github
Last release
1 year 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

NPM