diff --git a/package.json b/package.json index 0d2dda5..7848ef1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynamodb-geo", - "version": "0.4.0", + "version": "0.4.1", "description": "A javascript port of awslabs/dynamodb-geo, for dynamodb geospatial querying", "scripts": { "prepublish": "tsc -d", @@ -16,7 +16,7 @@ "dependencies": { "@types/decimal.js": "^0.0.30", "@types/long": ">=3", - "nodes2ts": "^1.1.10" + "nodes2ts": "^2.0.0" }, "devDependencies": { "@types/chai": "^4.0.0", diff --git a/src/GeoDataManager.ts b/src/GeoDataManager.ts index 305fcbd..5e6f6f6 100644 --- a/src/GeoDataManager.ts +++ b/src/GeoDataManager.ts @@ -339,7 +339,7 @@ export class GeoDataManager { const latitude = coordinates[this.config.longitudeFirst ? 1 : 0]; const latLng: S2LatLng = S2LatLng.fromDegrees(latitude, longitude); - return (centerLatLng.getEarthDistance(latLng) as any).toNumber() <= radiusInMeter; + return centerLatLng.getEarthDistance(latLng) <= radiusInMeter; }); } diff --git a/src/s2/S2Util.ts b/src/s2/S2Util.ts index fe91837..a977935 100644 --- a/src/s2/S2Util.ts +++ b/src/s2/S2Util.ts @@ -33,8 +33,8 @@ export class S2Util { const lngReferenceLatLng = S2LatLng.fromDegrees(centerPoint.latitude, centerPoint.longitude + lngReferenceUnit); - const latForRadius = radiusInMeter / (centerLatLng.getEarthDistance(latReferenceLatLng) as any).toNumber(); - const lngForRadius = radiusInMeter / (centerLatLng.getEarthDistance(lngReferenceLatLng) as any).toNumber(); + const latForRadius = radiusInMeter / centerLatLng.getEarthDistance(latReferenceLatLng); + const lngForRadius = radiusInMeter / centerLatLng.getEarthDistance(lngReferenceLatLng); const minLatLng = S2LatLng.fromDegrees(centerPoint.latitude - latForRadius, centerPoint.longitude - lngForRadius); diff --git a/yarn.lock b/yarn.lock index 1ea5c00..bc37a01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,10 +126,6 @@ debug@2.6.8: dependencies: ms "2.0.0" -decimal.js@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-6.0.0.tgz#4fd58d0637f36fdbc1aba1320bc3f2cee83ca0f2" - deep-eql@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" @@ -279,9 +275,10 @@ lodash@^4.0.0: version "4.17.19" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" -long@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== make-error@^1.1.1: version "1.3.4" @@ -328,12 +325,12 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -nodes2ts@^1.1.10: - version "1.1.10" - resolved "https://registry.yarnpkg.com/nodes2ts/-/nodes2ts-1.1.10.tgz#7828e1343ca7d41d1658d83352452740a29c2773" +nodes2ts@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/nodes2ts/-/nodes2ts-2.0.0.tgz#7ff815313257d9eba696eecb63482ed3754d1954" + integrity sha512-847uDvD2P19xsN7BNPbeUqaZCxA3OBmlHCIqpAsy/JCnGI90XZeZTFtHueK6GZjn/CNaBG2sA42aI0qQvLAJig== dependencies: - decimal.js "^6.0.0" - long "^3.2.0" + long "^4.0.0" once@^1.3.0: version "1.4.0"