Skip to content

dbkaplun/unsplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unsplay Build Status

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: []
  }]
}]

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published