Skip to content

Commit

Permalink
ensure no errors on empty index, close #225
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Apr 27, 2023
1 parent 5219378 commit 609fb25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"author": "Vladimir Agafonkin",
"license": "ISC",
"dependencies": {
"kdbush": "^4.0.1"
"kdbush": "^4.0.2"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.2",
Expand Down
7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,10 @@ test('makes sure unclustered point coords are not rounded', () => {

assert.deepEqual(index.getTile(20, 1028744, 656754).features[0].geometry[0], [421, 281]);
});

test('does not throw on zero items', () => {
assert.doesNotThrow(() => {
const index = new Supercluster().load([]);
assert.deepEqual(index.getClusters([-180, -85, 180, 85], 0), []);
});
});
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,10 @@ json-stable-stringify-without-jsonify@^1.0.1:
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==

kdbush@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-4.0.1.tgz#c411c5571d246c7f012ea5980ea720023d663329"
integrity sha512-RlSWHFOf40nU5Be8dZIzdA8j6Jn9IYskSPSZwkDCooGb16uXeUx/6QZuW+krdEToViiK2OAwfW7QWDHY+kAz0A==
kdbush@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-4.0.2.tgz#2f7b7246328b4657dd122b6c7f025fbc2c868e39"
integrity sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==

levn@^0.4.1:
version "0.4.1"
Expand Down

0 comments on commit 609fb25

Please sign in to comment.