JSPM

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

Access a value in an object or array using a dot-delimited string.

Package Exports

  • jaunt

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

Readme

Jaunt.js Build Status Coverage Status

Access a value in an object or array using a dot-delimited string.

Usage

var obj = {
  foo: {
    bar: ['Hello', 'World']
  }
};

jaunt(obj, 'foo.bar.0'); //=> "Hello"
jaunt(obj, ['foo', 'bar', 1]); //=> "World"

jaunt(obj, 'invalid'); //=> undefined

API

jaunt(obj, path)

Returns the value in obj corresponding to path. Returns undefined if path does not exist.

  • obj is an object or an array.
  • path is a dot-delimited string or an array of keys.

Installation

Install via npm:

$ npm i --save jaunt

Or grab the minified script from the dist directory.

License

MIT license