JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 750
  • Score
    100M100P100Q100701F
  • License UNLICENSED

get a value from an object within other objects safely

Package Exports

  • deep-value

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 (deep-value) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

deep-value

npm version dependencies Build Status Pledge To Arupex! lifetimeDownloadCount

#Install

npm install deep-value --save

#Bower

bower install deep-value --save

#How to Use (node):

var deep = require('deep-value');

console.log('Checking, ' deep({ my : { value : 7} }, 'my.value'));  // 7

console.log('Checking, ' deep({ my : {} }, 'my.value'));            // undefined

console.log('Checking, ' deep({ notMine : {} }, 'my.value'));       // undefined

#How to use (Browser):

var deep = arupex_deep_value;

Array Accessor

Finds the element in an array that follows the correct values and returns the value from it you want, if you dont want a value from it but want the whole object dont include a last key

console.log('Checking, ' deep({ notMine : [{ i : 1 , b : 2},{ i : 2, b : 2},{ i : 2, b : 1, v : 2}] }, 'notMine.@i==2,@b==1.v'));       // 2

console.log('Checking, ' deep({ notMine : [{ i : 1 , b : 2},{ i : 2, b : 2},{ i : 2, b : 1, v : 2}] }, 'notMine.@i==2,@b==1'));       // { i : 2, b : 1, v : 2}