diff --git a/binheap.js b/binheap.js index fd6e252..c0cf34f 100644 --- a/binheap.js +++ b/binheap.js @@ -58,5 +58,3 @@ class BinHeap { } } -window.BinHeap = BinHeap - diff --git a/dll.js b/dll.js index 1a22d85..422270b 100644 --- a/dll.js +++ b/dll.js @@ -170,5 +170,3 @@ class DLL { toString() { return this.toArray().toString() } } -window.DLL = DLL - diff --git a/graph.js b/graph.js index 0ab3bd9..d39a6b8 100644 --- a/graph.js +++ b/graph.js @@ -5,8 +5,6 @@ class Cxn { } } -window.Cxn = Cxn - class SearchData { constructor(id, dist = Infinity, last = undefined, custom = {}) { this.id = id @@ -39,8 +37,6 @@ class SearchData { } } -window.SearchData = SearchData - class Node { static GLOBAL_ID = 0 @@ -134,5 +130,3 @@ class Node { } } -window.Node = Node - diff --git a/grid.js b/grid.js index 5c587e9..dd99d68 100644 --- a/grid.js +++ b/grid.js @@ -176,5 +176,3 @@ class Grid { print(sep = "\t", ...pts) { console.log(this.toString(sep, pts)) } } -window.Grid = Grid - diff --git a/out.js b/out.js index f50aca2..5f4cef8 100644 --- a/out.js +++ b/out.js @@ -170,8 +170,6 @@ class DLL { toString() { return this.toArray().toString() } } -window.DLL = DLL - class Point { constructor(x, y) { this.x = x @@ -231,7 +229,7 @@ class Point { toString() { return this.x + "," + this.y } } -window.Pt = window.Point = Point +Pt = Point class Grid { constructor(w, h, fill = 0) { @@ -411,8 +409,6 @@ class Grid { print(sep = "\t", ...pts) { console.log(this.toString(sep, pts)) } } -window.Grid = Grid - class BinHeap { constructor(cond = (p, c) => p < c) { this.cond = cond @@ -473,8 +469,6 @@ class BinHeap { } } -window.BinHeap = BinHeap - class Cxn { constructor(dest, weight = 1) { this.dest = dest @@ -482,8 +476,6 @@ class Cxn { } } -window.Cxn = Cxn - class SearchData { constructor(id, dist = Infinity, last = undefined, custom = {}) { this.id = id @@ -516,8 +508,6 @@ class SearchData { } } -window.SearchData = SearchData - class Node { static GLOBAL_ID = 0 @@ -611,8 +601,6 @@ class Node { } } -window.Node = Node - Object.defineProperty(Object.prototype, "copyDeep", { value: function() { return JSON.parse(JSON.stringify(this)) @@ -715,7 +703,7 @@ class PointArray extends Array { } } -window.PtArray = window.PointArray = PointArray +PtArray = PointArray Object.defineProperty(Array.prototype, "pt", { get: function() { @@ -766,7 +754,7 @@ Object.defineProperties(PointArray.prototype, { } }) -window.utils = { +utils = { fetch: (url) => fetch(url).then(e => e.text()), fetchEval: (url) => utils.fetch(url).then(e => eval(e)), signAgnosticInclusiveRange: (a, b, s = Math.sign(a - b)) => Array((a - b) * s + 1).fill().map((_, i) => a - i * s), diff --git a/proto.js b/proto.js index bea17e0..0f3310b 100644 --- a/proto.js +++ b/proto.js @@ -100,7 +100,7 @@ class PointArray extends Array { } } -window.PtArray = window.PointArray = PointArray +PtArray = PointArray Object.defineProperty(Array.prototype, "pt", { get: function() { diff --git a/pt.js b/pt.js index df10c27..5652372 100644 --- a/pt.js +++ b/pt.js @@ -57,5 +57,5 @@ class Point { toString() { return this.x + "," + this.y } } -window.Pt = window.Point = Point +Pt = Point diff --git a/utils.js b/utils.js index 6bc7409..3a80263 100644 --- a/utils.js +++ b/utils.js @@ -1,4 +1,4 @@ -window.utils = { +utils = { fetch: (url) => fetch(url).then(e => e.text()), fetchEval: (url) => utils.fetch(url).then(e => eval(e)), signAgnosticInclusiveRange: (a, b, s = Math.sign(a - b)) => Array((a - b) * s + 1).fill().map((_, i) => a - i * s),