Skip to content

Commit

Permalink
Import PathResult from node-dijkstra
Browse files Browse the repository at this point in the history
  • Loading branch information
warerebel committed Apr 5, 2022
1 parent de96381 commit 5a1ee30
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/openLRDecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Mongo } from "./mongo";
import { buildLinkLookups, getGraph } from "./graph";
import type { linkLookup, node } from "./nodes";
import type { LRPObject } from "./LRP";
import type {PathResult} from "node-dijkstra";
import type Graph from "node-dijkstra";

export interface OpenLRDecodeOptions {
Expand Down Expand Up @@ -43,7 +42,7 @@ async function buildGraph(decodedOpenLR: LRPObject, collectionName: string) {
function getPath(nodes: string[], graph: Graph) {
const paths = [];
for (let i = 0; i < (nodes.length - 1); i++) {
paths.push(graph.path(nodes[i], nodes[i + 1], { cost: true }) as PathResult);
paths.push(graph.path(nodes[i], nodes[i + 1], { cost: true }) as Graph.PathResult);
}
const result = { path: [] as string[], cost: 0 };
for (const index in paths) {
Expand Down

0 comments on commit 5a1ee30

Please sign in to comment.