graph: Specify a technology for the created vertex
const { BemGraph } = require('@bem/sdk.graph');
const graph = new BemGraph();
graph.vertex({ block: 'a' })
.dependsOn({ block: 'b' });
graph.vertex({ block: 'a' }, 'css')
.dependsOn({ block: 'c' });
graph.dependenciesOf({ block: 'a'});
// => [
// {"entity":{"block":"b"}},
// {"entity":{"block":"a"}},
// ]
graph.dependenciesOf({ block: 'a'}, 'js');
// => [
// {"entity":{"block":"b"},"tech":"js"},
// {"entity":{"block":"a"},"tech":"js"}
// ]
graph.dependenciesOf({ block: 'a'}, 'css');
// => [
// {"entity":{"block":"c"},"tech":"css"},
// {"entity":{"block":"b"},"tech":"css"},
// {"entity":{"block":"a"},"tech":"css"}
// ]
no comments