0.0.4 • Published 6 years ago

dotted-object v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

dotted-object

Standard - JavaScript Style Guide

A small, single-feature module to use a string with a dot notation to extract values from an object.

npm i dotted-object [--save]
const dotted = require('dotted-object')

const obj = {
  data: {
    geo: {
      lat: 44.335,
      lon: 52.983
    }
  }
}

const value = dotted('data.geo.lat', obj)

/*
 To use a custom divider, use the thrid argument:
  const value = dotted('data:geo:lat', obj, ':')
 */

console.log(value) // => Outputs 44.335

TypeScript type definition included!

Standard - JavaScript Style Guide

License

Copyright 2017 Michiel van der Velde.

This software is licensed under the MIT License.

0.0.4

6 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago