object-nest
Assign some property nestly
Last updated 5 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install object-nest 
SYNC missed versions from official npm registry.

object-nest Build Status

Assign some property nestly

Installation

npm install --save object-nest

Example

const objectNest = require('object-nest');
// assign an object nestly
var obj = { a: 1 };
obj = objectNest(obj, 'b.c.d', 'hello');
// return Object
{
  a: 1,
  b: {
    c: {
      d: 'hello'
    }
  }
}
//create a new object nestly
obj = objectNest(null, 'a.b.c.d', 'hi');
// obj.a.b.c.d => 'hi'

License

MIT © EGOIST

Current Tags

  • 0.1.2                                ...           latest (5 years ago)

3 Versions

  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |