import { IProjectNode } from '../projects/get-projects' ; export class EdgeManager { private _dependencyEdgeHash : Record < string , number > ; constructor ( ) { this . _dependencyEdgeHash = { } ; } reduceOneEdge ( project ) { if ( ! ( project . name in this . _dependencyEdgeHash ) ) { this . _dependencyEdgeHash [ project . name ] = project . dependencyEdge ; } this . _dependencyEdgeHash [ project . name ] -- ; } reduceEdges ( project , edges ) { if ( ! ( project . name in this . _dependencyEdgeHash ) ) { this . _dependencyEdgeHash [ project . name ] = project . dependencyEdge ; } this . _dependencyEdgeHash [ project . name ] -= edges ; } getEdge ( project ) { if ( project . name in this . _dependencyEdgeHash ) { return this . _dependencyEdgeHash [ project . name ] ; } return NaN ; } setEdge ( project ) { this . _dependencyEdgeHash [ project . name ] = project . dependencyEdge ; } }