Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.05 KB

Readme.md

File metadata and controls

44 lines (29 loc) · 1.05 KB

get-prop

Build status Git tag NPM version Code style

Get nested property from object.

Installation

$ npm install @f/get-prop

Usage

var getProp = require('@f/get-prop')

var obj = {foo: {bar: 'baz'}}
getProp('foo.bar', obj) // => 'baz'

API

getProp(path, obj)

  • path - array or dot seperated string specifying path
  • obj - obj to retrieve property from

Returns: property

License

MIT