New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

getvalue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getvalue

Get a nested value from an object by path

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

Getvalue

NPM version NPM downloads Build status Test coverage

Get a nested value from an object by path.

Installation

npm install getvalue --save

Usage

Arguments

  • object (Object) The object to query
  • path (Array) The path of the property to get
  • (Optional) defaultValue (any) The value returned for undefined resolved values

Example

import { get } from 'getvalue'

const obj = { a: { b: { c: 10 } } }

get(obj, ['a', 'b', 'c']) //=> 10
get(obj, ['not', 'here']) //=> undefined
get(obj, ['or', 'here'], 1) //=> 1

License

Apache 2.0

Keywords

get

FAQs

Package last updated on 18 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts