graph: Naturalize graph

node v10.15.0
version: 1.0.2
endpointsharetweet
const { BemGraph } = require('@bem/sdk.graph'); const BemCell = require('@bem/sdk.cell'); const graph = new BemGraph(); graph.vertex({ block: 'a' }) .dependsOn({ block: 'b', elem: 'el' }); graph.vertex({ block: 'b' }); graph.dependenciesOf({block: 'a'}); // => [ // { "entity": {"block": "b", elem: "el"}}, // { "entity": {"block": "a"}} // ]
After the graph was naturalized.
graph.naturalize(); graph.dependenciesOf({block: 'a'}); // => [ // { "entity": {"block": "b"}}, // { "entity": {"block": "b", elem: "el"}}, // { "entity": {"block": "a"}} // ]
Loading…

no comments

    sign in to comment