Moving from maps of maps to a more sophisticated graph class for includes

This commit is contained in:
Noah Santschi-Cooney 2018-08-01 18:38:21 +01:00
parent 18c0e2ef5c
commit c95367739f
3 changed files with 49 additions and 31 deletions

View file

@ -23,4 +23,9 @@ export class Graph {
}
this.nodes.set(parent, par)
}
public get(uri: string): Node {
if (!this.nodes.has(uri)) this.nodes.set(uri, {parents: new Map(), children: new Map()})
return this.nodes.get(uri)
}
}