Skip to content

Commit b071242

Browse files
committed
fix: getEdgeProperties may return undefined if the edge doesn't exist
(cherry picked from commit 99e3d29)
1 parent d9785de commit b071242

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Graph.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ export class Graph<Node = string, LinkProps = never> {
106106
}
107107

108108
/**
109-
* Get the properties of the given edge or undefined if none are set.
109+
* Get the properties of the given edge or undefined if the edge doesn't exist .
110110
*/
111-
getEdgeProperties(source: Node, target: Node): LinkProps {
112-
return this.edgeProperties.get(source)?.get(target) as LinkProps;
111+
getEdgeProperties(source: Node, target: Node): LinkProps | undefined {
112+
return this.edgeProperties.get(source)?.get(target);
113113
}
114114

115115
/**

0 commit comments

Comments
 (0)