Skip to main content
Module

x/typeorm/src/util/DepGraph.ts>DepGraph

Forked from https://github.com/typeorm/typeorm
Latest
class DepGraph
import { DepGraph } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/util/DepGraph.ts";

Properties

incomingEdges: any
nodes: any
outgoingEdges: any

Methods

addDependency(from: any, to: any)

Add a dependency between two nodes. If either of the nodes does not exist, an Error will be thrown.

addNode(node: any, data?: any)

Add a node to the dependency graph. If a node already exists, this method will do nothing.

dependantsOf(node: any, leavesOnly: any)

get an array containing the nodes that depend on the specified node (transitively).

Throws an Error if the graph has a cycle, or the specified node does not exist.

If leavesOnly is true, only nodes that do not have any dependants will be returned in the array.

dependenciesOf(node: any, leavesOnly: any)

Get an array containing the nodes that the specified node depends on (transitively).

Throws an Error if the graph has a cycle, or the specified node does not exist.

If leavesOnly is true, only nodes that do not depend on any other nodes will be returned in the array.

getNodeData(node: any)

Get the data associated with a node name

hasNode(node: any)

Check if a node exists in the graph

overallOrder(leavesOnly?: any)

Construct the overall processing order for the dependency graph.

Throws an Error if the graph has a cycle.

If leavesOnly is true, only nodes that do not depend on any other nodes will be returned.

removeDependency(from: any, to: any)

Remove a dependency between two nodes.

removeNode(node: any)

Remove a node from the dependency graph. If a node does not exist, this method will do nothing.

setNodeData(node: any, data: any)

Set the associated data for a given node name. If the node does not exist, this method will throw an error