Package Exports
- @bemoje/o-get
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bemoje/o-get) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@bemoje/o-get
Get an object property, with dot-notation support for deeply nested properties.
Version
Travis CI
Dependencies
Stats
Donate
Installation
npm install @bemoje/o-get
npm install --save @bemoje/o-get
npm install --save-dev @bemoje/o-get
Usage
import oGet from '@bemoje/o-get'
const user = {
id: 2,
name: 'john',
country: {
id: 52,
short: 'DK',
long: 'Denmark',
},
}
oGet(user, 'name')
//=> 'john'
oGet(user, 'country.id')
//=> 52
oGet(user, 'country.long')
//=> 'Denmark'
Tests
Uses Jest to test module functionality. Run tests to get coverage details.
npm run test
API
oGet
Get an object property, with dot-notation support for deeply nested properties.
Parameters
Returns
any The nested property