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

buildkite-graph

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buildkite-graph - npm Package Compare versions

Comparing version

to
1.3.0

57

dist/sortedSteps.js

@@ -19,38 +19,39 @@ "use strict";

function sortedSteps(e) {
var e_1, _a, e_2, _b;
var e_1, _a;
var steps = unwrapSteps_1.unwrapSteps(e.steps);
var sortOp = new topological_sort_1.default(new Map(steps.map(function (step) { return [step, step]; })));
try {
for (var steps_1 = __values(steps), steps_1_1 = steps_1.next(); !steps_1_1.done; steps_1_1 = steps_1.next()) {
var step = steps_1_1.value;
try {
for (var _c = (e_2 = void 0, __values(step.dependencies)), _d = _c.next(); !_d.done; _d = _c.next()) {
var dependency = _d.value;
if (steps.indexOf(dependency) === -1) {
// a dependency has not been added to the graph explicitly,
// so we add it implicitly
sortOp.addNode(dependency, dependency);
steps.push(dependency);
// maybe we want to rather throw here?
// Unsure...there could be a strict mode where we:
// throw new Error(`Step not part of the graph: '${dependency}'`);
}
for (var i = 0; i < steps.length; i++) {
var step = steps[i];
try {
for (var _b = (e_1 = void 0, __values(step.dependencies)), _c = _b.next(); !_c.done; _c = _b.next()) {
var dependency = _c.value;
if (steps.indexOf(dependency) === -1) {
// a dependency has not been added to the graph explicitly,
// so we add it implicitly
sortOp.addNode(dependency, dependency);
steps.push(dependency);
// maybe we want to rather throw here?
// Unsure...there could be a strict mode where we:
// throw new Error(`Step not part of the graph: '${dependency}'`);
}
if (dependency !== step) {
// not a self-reference, we just add the edge as usual
sortOp.addEdge(dependency, step);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
else {
// self-reference, so we need to add a wait step in between later
if (i !== 0) {
// we only do this if it is not the very first step
sortOp.addEdge(steps[i - 1], step);
}
}
finally { if (e_2) throw e_2.error; }
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (steps_1_1 && !steps_1_1.done && (_a = steps_1.return)) _a.call(steps_1);
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
finally { if (e_1) throw e_1.error; }
}

@@ -57,0 +58,0 @@ return Array.from(sortOp.sort().values()).map(function (i) { return i.node; });

@@ -27,3 +27,4 @@ "use strict";

var dependentStep = allSteps.indexOf(dependency);
if (dependentStep !== -1 && dependentStep > lastWaitStep) {
if (dependency === step ||
(dependentStep !== -1 && dependentStep > lastWaitStep)) {
lastWaitStep = allSteps.push(null) - 1;

@@ -30,0 +31,0 @@ break dep;

{
"name": "buildkite-graph",
"version": "1.2.0",
"version": "1.3.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts",