0.0.4 • Published 8 years ago

obdots v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

obdots

Create dot-path strings of nested objects

Overview

Obdots generates dot-path strings of nested objects to that can be used to pass into packages like Dotty.

Obdots was created to be used in conjunction with a package like Dotty to simplify the setting of state in a React application.

Installation

Here's a link to the npm page.

npm install obdots

Usage

If an object has multiple properties at any given level, the first found is used to generate the dot-path string. Values are not returned in the path. Arrays are treated as values.

var obdots = require("obdots");

var object = {
  a: {
    b: {
      x: "y",
    },
    c: {
      x: "z",
    },
  },
};

console.log(obdots(object)); // a.b.x

License

MIT License. A copy is included with the source.

Contact

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago