15 lines
256 B
JavaScript
15 lines
256 B
JavaScript
'use strict';
|
|
|
|
module.exports = function(tasks) {
|
|
return Object.keys(tasks)
|
|
.reduce(function(prev, task) {
|
|
prev.nodes.push({
|
|
label: task,
|
|
nodes: tasks[task].dep,
|
|
});
|
|
return prev;
|
|
}, {
|
|
nodes: [],
|
|
});
|
|
};
|