Skip to content

Commit 3f8fb2c

Browse files
authored
Merge pull request #94 from JesusTheHun/fix-getEdgeProperties
fix: `getEdgeProperties` may return `undefined` if the edge doesn't exists
2 parents d9785de + b071242 commit 3f8fb2c

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)