You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

extract.js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract.js

Check or get nested properties on objects in javascript

0.6.1
latest
Source
npmnpm
Version published
Weekly downloads
17
-29.17%
Maintainers
1
Weekly downloads
 
Created
Source

Extract.js

Build Status Coverage Status Code Climate

Check or get nested properties on objects in javascript

Installation

Install the package from npm

npm install --save extract.js

Usage

extract.js is a tiny util library for either extracting or checking properties on a nested object, both dot and bracket notation.

import extract from 'extract.js';
const object = { foo: { bar: 'foobar' }, bar: [{foo: 'foobar'}] }
extract.get(object, 'foo.bar'); // => 'foobar'
extract.get(object, 'bar[0].foo'); // => 'foobar'
extract.get(object, 'foo.bar.foobar'); // => undefined
extract.has(object, 'foo.bar'); // => true
extract.has(object, 'foo.bar.foobar'); // => false

License

MIT. Copyright (c) 2016 Philip Knape.

Keywords

extract

FAQs

Package last updated on 20 Feb 2019

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