Skip to content

Commit

Permalink
Update README to document new cycle error type
Browse files Browse the repository at this point in the history
  • Loading branch information
jriecken committed Dec 11, 2018
1 parent 79b2060 commit 55f2fcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -18,16 +18,16 @@ Nodes in the graph are just simple strings with optional data associated with th
- `removeNode(name)` - remove a node from the graph
- `hasNode(name)` - check if a node exists in the graph
- `size()` - return the number of nodes in the graph
- `getNodeData(name)` - get the data associated with a node (will throw an Error if the node does not exist)
- `setNodeData(name, data)` - set the data for an existing node (will throw an Error if the node does not exist)
- `addDependency(from, to)` - add a dependency between two nodes (will throw an Error if one of the nodes does not exist)
- `getNodeData(name)` - get the data associated with a node (will throw an `Error` if the node does not exist)
- `setNodeData(name, data)` - set the data for an existing node (will throw an `Error` if the node does not exist)
- `addDependency(from, to)` - add a dependency between two nodes (will throw an `Error` if one of the nodes does not exist)
- `removeDependency(from, to)` - remove a dependency between two nodes
- `clone()` - return a clone of the graph. Any data attached to the nodes will only be *shallow-copied*
- `dependenciesOf(name, leavesOnly)` - get an array containing the nodes that the specified node depends on (transitively). If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned in the array.
- `dependantsOf(name, leavesOnly)` - get an array containing the nodes that depend on the specified node (transitively). If `leavesOnly` is true, only nodes that do not have any dependants will be returned in the array.
- `overallOrder(leavesOnly)` - construct the overall processing order for the dependency graph. If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned.

Dependency Cycles are detected when running `dependenciesOf`, `dependantsOf`, and `overallOrder` and if one is found, an error will be thrown that includes what the cycle was in the message: e.g. `Dependency Cycle Found: a -> b -> c -> a`. If you wish to silence this error, pass `circular: true` when instantiating `DepGraph` (more below).
Dependency Cycles are detected when running `dependenciesOf`, `dependantsOf`, and `overallOrder` and if one is found, a `DepGraphCycleError` will be thrown that includes what the cycle was in the message as well as the `cyclePath` property: e.g. `Dependency Cycle Found: a -> b -> c -> a`. If you wish to silence this error, pass `circular: true` when instantiating `DepGraph` (more below).

## Examples

Expand Down

0 comments on commit 55f2fcf

Please sign in to comment.