From 84fba89fc85c214ff869381ff3b95d15b004f053 Mon Sep 17 00:00:00 2001 From: Alexander Tesfamichael Date: Tue, 7 Jul 2020 16:29:19 +0200 Subject: [PATCH] Make weight parameter type optional --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 1e0ea85..cbeba9e 100644 --- a/index.ts +++ b/index.ts @@ -111,7 +111,7 @@ function Graph(serialized?: Serialized) { // Adds an edge from node u to node v. // Implicitly adds the nodes if they were not already added. - function addEdge(u: NodeId, v: NodeId, weight: EdgeWeight) { + function addEdge(u: NodeId, v: NodeId, weight?: EdgeWeight) { addNode(u); addNode(v); adjacent(u).push(v);