Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
while (true) {
var bbox = turfBBox(currentFeature);
var search = tree.search({
minX: bbox[0],
minY: bbox[1],
maxX: bbox[2],
maxY: bbox[3]
});
if (search.length > 0) {
var polys = search.map(function (item) {
removed[item.index] = true;
tree.remove({index: item.index}, filterByIndex);
return item.geojson;
});
polys.push(currentFeature);
currentFeature = union.apply(this, polys);
}
// Done
if (search.length === 0) break;
}
results.push(currentFeature);
});