New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dijkstras-algorithm-ts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dijkstras-algorithm-ts - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

20

dist/dijkstrasAlgorithm.js

@@ -30,10 +30,6 @@ "use strict";

continue;
edgeScoreFromCurrentToTargetNode =
nonDirectedGraphMap[prevNode][targetNode];
const sumScoreFromCurrentNodeToTargetNode = resultsTable[prevNode].shortestDistanceFromNodeX +
edgeScoreFromCurrentToTargetNode;
if (sumScoreFromCurrentNodeToTargetNode <
resultsTable[targetNode].shortestDistanceFromNodeX) {
resultsTable[targetNode].shortestDistanceFromNodeX =
sumScoreFromCurrentNodeToTargetNode;
edgeScoreFromCurrentToTargetNode = nonDirectedGraphMap[prevNode][targetNode];
const sumScoreFromCurrentNodeToTargetNode = resultsTable[prevNode].shortestDistanceFromNodeX + edgeScoreFromCurrentToTargetNode;
if (sumScoreFromCurrentNodeToTargetNode < resultsTable[targetNode].shortestDistanceFromNodeX) {
resultsTable[targetNode].shortestDistanceFromNodeX = sumScoreFromCurrentNodeToTargetNode;
resultsTable[targetNode].previousVertex = prevNode;

@@ -64,5 +60,3 @@ }

}
return getShortestPathArrRecursive(destinationNode).concat([
destinationNode,
]);
return getShortestPathArrRecursive(destinationNode).concat([destinationNode]);
}

@@ -82,7 +76,5 @@ exports.getShortestPath = getShortestPath;

// @ts-ignore
return nodesPathArr
.shift()
.concat(getShortedPathArrowedFormattedStringRecursive(nodesPathArr));
return nodesPathArr.shift().concat(getShortedPathArrowedFormattedStringRecursive(nodesPathArr));
}
exports.getShortedPathArrowedFormattedString = getShortedPathArrowedFormattedString;
//# sourceMappingURL=dijkstrasAlgorithm.js.map

@@ -58,9 +58,3 @@ "use strict";

test("test shortest path to c from a", () => {
expect((0, dijkstrasAlgorithm_1.getShortestPath)(djistrasResultsLookUpTableFromA, "c")).toEqual([
"a",
"b",
"d",
"f",
"c",
]);
expect((0, dijkstrasAlgorithm_1.getShortestPath)(djistrasResultsLookUpTableFromA, "c")).toEqual(["a", "b", "d", "f", "c"]);
});

@@ -67,0 +61,0 @@ test("test shortest path to c from a in directional arrow string format", () => {

{
"name": "dijkstras-algorithm-ts",
"version": "1.0.3",
"version": "1.0.4",
"author": "christopher.pkm@gmail.com",

@@ -50,3 +50,3 @@ "description": "typescript implementation of the greedy first search djikstra's shortest path algorithm, compatible with javascript projects too of course",

"preversion": "npm run lint",
"version": "npm run format && git add .",
"version": "npm run format",
"postversion": "git push && git push --tags"

@@ -53,0 +53,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc