Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

topological-sort

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

topological-sort - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

11

index.js

@@ -37,8 +37,6 @@ 'use strict';

this._sortedKeysStack = [];
this._pickNodes = new Set;
const output = new Map;
for (const [key] of this._nodes) {
this._pickNodes.add(key);
this._exploreNode(key, [key], true);
this._exploreNode(key, [key]);
}

@@ -53,5 +51,6 @@

_exploreNode(nodeKey, explorePath, skipCurrentNodeCheck = false) {
if (!skipCurrentNodeCheck) {
assert(!this._pickNodes.has(nodeKey), `Node ${nodeKey} forms circular dependency: ${explorePath.join(' -> ')}`);
_exploreNode(nodeKey, explorePath) {
// we should check circular dependencies starting from node 2
if (explorePath.length > 1) {
assert(nodeKey !== explorePath[0], `Node ${nodeKey} forms circular dependency: ${explorePath.join(' -> ')}`);
}

@@ -58,0 +57,0 @@

{
"name": "topological-sort",
"version": "0.1.0",
"version": "0.1.1",
"description": "Topological sort implemented in Javascript",

@@ -5,0 +5,0 @@ "main": "index.js",

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