Skip to content

Commit

Permalink
Building for release
Browse files Browse the repository at this point in the history
  • Loading branch information
rustedgrail committed Aug 15, 2024
1 parent 6c5035b commit 380d5ef
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphlib",
"version": "2.2.3",
"version": "2.2.4",
"main": [
"dist/graphlib.core.js"
],
Expand Down
38 changes: 19 additions & 19 deletions dist/graphlib.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function components(g) {
var cmpt;

function dfs(v) {
if (visited.hasOwnProperty(v)) return;
if (Object.hasOwn(visited, v)) return;
visited[v] = true;
cmpt.push(v);
g.successors(v).forEach(dfs);
Expand Down Expand Up @@ -104,7 +104,7 @@ function postOrderDfs(v, navigation, visited, acc) {
if (curr[1]) {
acc.push(curr[0]);
} else {
if (!visited.hasOwnProperty(curr[0])) {
if (!Object.hasOwn(visited, curr[0])) {
visited[curr[0]] = true;
stack.push([curr[0], true]);
forEachRight(navigation(curr[0]), w => stack.push([w, false]));
Expand All @@ -117,7 +117,7 @@ function preOrderDfs(v, navigation, visited, acc) {
var stack = [v];
while (stack.length > 0) {
var curr = stack.pop();
if (!visited.hasOwnProperty(curr)) {
if (!Object.hasOwn(visited, curr)) {
visited[curr] = true;
acc.push(curr);
forEachRight(navigation(curr), w => stack.push(w));
Expand Down Expand Up @@ -351,7 +351,7 @@ function prim(g, weightFunc) {
var init = false;
while (pq.size() > 0) {
v = pq.removeMin();
if (parents.hasOwnProperty(v)) {
if (Object.hasOwn(parents, v)) {
result.setEdge(v, parents[v]);
} else if (init) {
throw new Error("Input graph is not connected: " + g);
Expand Down Expand Up @@ -383,7 +383,7 @@ function tarjan(g) {
stack.push(v);

g.successors(v).forEach(function(w) {
if (!visited.hasOwnProperty(w)) {
if (!Object.hasOwn(visited, w)) {
dfs(w);
entry.lowlink = Math.min(entry.lowlink, visited[w].lowlink);
} else if (visited[w].onStack) {
Expand All @@ -404,7 +404,7 @@ function tarjan(g) {
}

g.nodes().forEach(function(v) {
if (!visited.hasOwnProperty(v)) {
if (!Object.hasOwn(visited, v)) {
dfs(v);
}
});
Expand All @@ -419,11 +419,11 @@ function topsort(g) {
var results = [];

function visit(node) {
if (stack.hasOwnProperty(node)) {
if (Object.hasOwn(stack, node)) {
throw new CycleException();
}

if (!visited.hasOwnProperty(node)) {
if (!Object.hasOwn(visited, node)) {
stack[node] = true;
visited[node] = true;
g.predecessors(node).forEach(visit);
Expand Down Expand Up @@ -480,7 +480,7 @@ class PriorityQueue {
* Returns `true` if **key** is in the queue and `false` if not.
*/
has(key) {
return this._keyIndices.hasOwnProperty(key);
return Object.hasOwn(this._keyIndices, key);
}

/**
Expand Down Expand Up @@ -518,7 +518,7 @@ class PriorityQueue {
add(key, priority) {
var keyIndices = this._keyIndices;
key = String(key);
if (!keyIndices.hasOwnProperty(key)) {
if (!Object.hasOwn(keyIndices, key)) {
var arr = this._arr;
var index = arr.length;
keyIndices[key] = index;
Expand Down Expand Up @@ -666,9 +666,9 @@ class Graph {

constructor(opts) {
if (opts) {
this._isDirected = opts.hasOwnProperty("directed") ? opts.directed : true;
this._isMultigraph = opts.hasOwnProperty("multigraph") ? opts.multigraph : false;
this._isCompound = opts.hasOwnProperty("compound") ? opts.compound : false;
this._isDirected = Object.hasOwn(opts, "directed") ? opts.directed : true;
this._isMultigraph = Object.hasOwn(opts, "multigraph") ? opts.multigraph : false;
this._isCompound = Object.hasOwn(opts, "compound") ? opts.compound : false;
}

if (this._isCompound) {
Expand Down Expand Up @@ -797,7 +797,7 @@ class Graph {
* Complexity: O(1).
*/
setNode(v, value) {
if (this._nodes.hasOwnProperty(v)) {
if (Object.hasOwn(this._nodes, v)) {
if (arguments.length > 1) {
this._nodes[v] = value;
}
Expand Down Expand Up @@ -830,7 +830,7 @@ class Graph {
* Detects whether graph has a node with specified name or not.
*/
hasNode(v) {
return this._nodes.hasOwnProperty(v);
return Object.hasOwn(this._nodes, v);
}

/**
Expand All @@ -841,7 +841,7 @@ class Graph {
*/
removeNode(v) {
var self = this;
if (this._nodes.hasOwnProperty(v)) {
if (Object.hasOwn(this._nodes, v)) {
var removeEdge = e => self.removeEdge(self._edgeObjs[e]);
delete this._nodes[v];
if (this._isCompound) {
Expand Down Expand Up @@ -1119,7 +1119,7 @@ class Graph {
}

var e = edgeArgsToId(this._isDirected, v, w, name);
if (this._edgeLabels.hasOwnProperty(e)) {
if (Object.hasOwn(this._edgeLabels, e)) {
if (valueSpecified) {
this._edgeLabels[e] = value;
}
Expand Down Expand Up @@ -1184,7 +1184,7 @@ class Graph {
var e = (arguments.length === 1
? edgeObjToId(this._isDirected, arguments[0])
: edgeArgsToId(this._isDirected, v, w, name));
return this._edgeLabels.hasOwnProperty(e);
return Object.hasOwn(this._edgeLabels, e);
}

/**
Expand Down Expand Up @@ -1390,7 +1390,7 @@ function read(json) {
}

},{"./graph":16}],19:[function(require,module,exports){
module.exports = '2.2.3';
module.exports = '2.2.4';

},{}]},{},[1])(1)
});
Loading

0 comments on commit 380d5ef

Please sign in to comment.