mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 08:06:22 +08:00
33 lines
584 B
TypeScript
33 lines
584 B
TypeScript
/* Add tests for your definition file here */
|
|
|
|
import * as sequencify from 'sequencify';
|
|
|
|
var items: sequencify.TaskMap = {
|
|
a: {
|
|
name: 'a',
|
|
dep: []
|
|
// other properties as needed
|
|
},
|
|
b: {
|
|
name: 'b',
|
|
dep: ['a']
|
|
},
|
|
c: {
|
|
name: 'c',
|
|
dep: ['a']
|
|
},
|
|
d: {
|
|
name: 'd',
|
|
dep: ['c']
|
|
},
|
|
};
|
|
|
|
var names = ['d', 'b', 'c', 'a']; // The names of the items you want arranged, need not be all
|
|
|
|
var results: string[] = [];
|
|
|
|
sequencify(items, names, results);
|
|
|
|
console.log(results);
|
|
// ['a','b','c','d'];
|