graph: Get a dependencies for the list of cells
const { BemGraph } = require('@bem/sdk.graph');
const graph = new BemGraph();
graph.vertex({ block: 'a' })
.linkWith({ block: 'b' });
graph.vertex({ block: 'c' })
.dependsOn({ block: 'd'});
const cells = [
{ block: 'a'},
{ block: 'c'}
]
graph.dependenciesOf(cells);
// => [
// { "entity": {"block": "a"}},
// { "entity": {"block": "d"}},
// { "entity": {"block": "c"}}
// { "entity": {"block": "b"}}
// ]
no comments