1.0.5 • Published 9 years ago

unsplay v1.0.5

Weekly downloads
381
License
MIT
Repository
github
Last release
9 years ago

unsplay

Compute a tree from an array of objects with IDs and parent IDs

Installation

$ npm install unsplay

Usage

>> var unsplay = require('unsplay');
>> unsplay([{id: 0}, {id: 1, pid: 0}], 'id', 'pid');
[{
  item: {id: 0},
  children: [{
    item: {id: 1, pid: 0},
    children: []
  }]
}]
1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago