Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
run() {
// Building the tree
const tree = new VPTree(this.distance, this.items);
// Retrieving the clusters
const clusters = [],
visited = new Set();
for (let i = 0, l = this.items.length; i < l; i++) {
const item = this.items[i];
if (visited.has(item))
continue;
const neighbors = tree.neighbors(this.radius, item);
const cluster = new Array(neighbors.length);
for (let j = 0, m = neighbors.length; j < m; j++) {