mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 17:22:55 -05:00
* Compile build folder * Fix build compile issues (#22813) * Revert changes * Update gulp-shell * Test * Update * Update modifiers * Try reverting minimist * Generates linux deb artifact (#22922) * Remove deb files that were brought in with the latest merge. * Add debian back to linux gulp file * Remove async from anonymous function. * Remove run core integration tests build step in pipeline * Revert "Remove async from anonymous function." This reverts commit 7ad1ce2942954fce58939b9965343b46b9311a7e. * Revert "Add debian back to linux gulp file" This reverts commit 96b7c0f0995c8024ef67ed886da34255a5caa325. * Revert "Remove deb files that were brought in with the latest merge." This reverts commit bf3aae233b8da1f9111a149a96d77cc78d376094. * Removes dependency checks * Fix dependency gen errors * Reenable "Build Deb" step * Reenable publish deb * Run core integration tests * Revert "Run core integration tests" This reverts commit 7cafbada194feebe771862af796fb3416b5dd686. * Revert "Try reverting minimist" This reverts commit 38fd843c1d5c33318a92f4bbc7057e951c5a9f71. * Disable code coverage step intermin --------- Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> Co-authored-by: Lewis Sanchez <87730006+lewis-sanchez@users.noreply.github.com>
125 lines
4.2 KiB
JavaScript
125 lines
4.2 KiB
JavaScript
"use strict";
|
|
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.graph = exports.strings = exports.collections = void 0;
|
|
var collections;
|
|
(function (collections) {
|
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
function lookup(collection, key) {
|
|
if (hasOwnProperty.call(collection, key)) {
|
|
return collection[key];
|
|
}
|
|
return null;
|
|
}
|
|
collections.lookup = lookup;
|
|
function insert(collection, key, value) {
|
|
collection[key] = value;
|
|
}
|
|
collections.insert = insert;
|
|
function lookupOrInsert(collection, key, value) {
|
|
if (hasOwnProperty.call(collection, key)) {
|
|
return collection[key];
|
|
}
|
|
else {
|
|
collection[key] = value;
|
|
return value;
|
|
}
|
|
}
|
|
collections.lookupOrInsert = lookupOrInsert;
|
|
function forEach(collection, callback) {
|
|
for (const key in collection) {
|
|
if (hasOwnProperty.call(collection, key)) {
|
|
callback({
|
|
key: key,
|
|
value: collection[key]
|
|
});
|
|
}
|
|
}
|
|
}
|
|
collections.forEach = forEach;
|
|
function contains(collection, key) {
|
|
return hasOwnProperty.call(collection, key);
|
|
}
|
|
collections.contains = contains;
|
|
})(collections = exports.collections || (exports.collections = {}));
|
|
var strings;
|
|
(function (strings) {
|
|
/**
|
|
* The empty string. The one and only.
|
|
*/
|
|
strings.empty = '';
|
|
strings.eolUnix = '\r\n';
|
|
function format(value, ...rest) {
|
|
return value.replace(/({\d+})/g, function (match) {
|
|
const index = Number(match.substring(1, match.length - 1));
|
|
return String(rest[index]) || match;
|
|
});
|
|
}
|
|
strings.format = format;
|
|
})(strings = exports.strings || (exports.strings = {}));
|
|
var graph;
|
|
(function (graph) {
|
|
function newNode(data) {
|
|
return {
|
|
data: data,
|
|
incoming: {},
|
|
outgoing: {}
|
|
};
|
|
}
|
|
graph.newNode = newNode;
|
|
class Graph {
|
|
constructor(_hashFn) {
|
|
this._hashFn = _hashFn;
|
|
this._nodes = {};
|
|
// empty
|
|
}
|
|
traverse(start, inwards, callback) {
|
|
const startNode = this.lookup(start);
|
|
if (!startNode) {
|
|
return;
|
|
}
|
|
this._traverse(startNode, inwards, {}, callback);
|
|
}
|
|
_traverse(node, inwards, seen, callback) {
|
|
const key = this._hashFn(node.data);
|
|
if (collections.contains(seen, key)) {
|
|
return;
|
|
}
|
|
seen[key] = true;
|
|
callback(node.data);
|
|
const nodes = inwards ? node.outgoing : node.incoming;
|
|
collections.forEach(nodes, (entry) => this._traverse(entry.value, inwards, seen, callback));
|
|
}
|
|
inertEdge(from, to) {
|
|
const fromNode = this.lookupOrInsertNode(from);
|
|
const toNode = this.lookupOrInsertNode(to);
|
|
fromNode.outgoing[this._hashFn(to)] = toNode;
|
|
toNode.incoming[this._hashFn(from)] = fromNode;
|
|
}
|
|
removeNode(data) {
|
|
const key = this._hashFn(data);
|
|
delete this._nodes[key];
|
|
collections.forEach(this._nodes, (entry) => {
|
|
delete entry.value.outgoing[key];
|
|
delete entry.value.incoming[key];
|
|
});
|
|
}
|
|
lookupOrInsertNode(data) {
|
|
const key = this._hashFn(data);
|
|
let node = collections.lookup(this._nodes, key);
|
|
if (!node) {
|
|
node = newNode(data);
|
|
this._nodes[key] = node;
|
|
}
|
|
return node;
|
|
}
|
|
lookup(data) {
|
|
return collections.lookup(this._nodes, this._hashFn(data));
|
|
}
|
|
}
|
|
graph.Graph = Graph;
|
|
})(graph = exports.graph || (exports.graph = {}));
|