JSPM

@bemoje/o-get

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q31816F
  • License MIT

Get an object property, with dot-notation support for deeply nested properties.

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

NPM version

Travis CI

dependencies

Dependencies

dependencies

Stats

NPM downloads Forks

Buy Me A Beer donate button PayPal donate button

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