dep.js
Parse shallow depends to deep depends.
Install
$ npm install --save dep.js
Usage
var dep = require('dep.js'),
assert = require('assert');
var items = [
{value: 'a', depends: ['b', 'c']},
{value: 'b', depends: ['c']},
{value: 'c', depends: ['d']},
{value: 'd', depends: []}
];
assert.deepEqual(
dep(items),
[
{value: 'a', depends: ['b', 'c'], deepDepends: ['d', 'c', 'b']},
{value: 'b', depends: ['c'], deepDepends: ['d', 'c']},
{value: 'c', depends: ['d'], deepDepends: ['d']},
{value: 'd', depends: [], deepDepends: []}
]
);
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.
License
Copyright (c) 2015 Zhonglei Qiu. Licensed under the MIT license.