@flatten-js/core
Advanced tools
Comparing version 1.3.4 to 1.3.5
{ | ||
"name": "@flatten-js/core", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "Javascript library for 2d geometry", | ||
@@ -73,4 +73,4 @@ "main": "dist/main.cjs.js", | ||
"dependencies": { | ||
"@flatten-js/interval-tree": "^1.0.15" | ||
"@flatten-js/interval-tree": "^1.0.19" | ||
} | ||
} |
@@ -477,2 +477,3 @@ /** | ||
splitToIslands() { | ||
if (this.isEmpty()) return []; // return empty array if polygon is empty | ||
let polygons = this.toArray(); // split into array of one-loop polygons | ||
@@ -479,0 +480,0 @@ /* Sort polygons by area in descending order */ |
@@ -789,2 +789,8 @@ /** | ||
}); | ||
it('splitToIslands should not fail if the polygon is empty', function() { | ||
const polygon = new Polygon(); | ||
const islandsArray = polygon.splitToIslands(); | ||
expect(islandsArray.length).to.equal(0); | ||
}); | ||
describe('#Flatten.Polygon.cut(multiline) methods', function() { | ||
@@ -791,0 +797,0 @@ it('Can cut polygon with line. Case of non-intersection', function() { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5681229
36203