open-location-code-typescript
Advanced tools
Comparing version
@@ -24,2 +24,8 @@ "use strict"; | ||
} | ||
getLatitudeHeight() { | ||
return this.latitudeHi - this.latitudeLo; | ||
} | ||
getLongitudeWidth() { | ||
return this.longitudeHi - this.longitudeLo; | ||
} | ||
} | ||
@@ -160,2 +166,9 @@ /** | ||
; | ||
contains(latitude, longitude) { | ||
const codeArea = OpenLocationCode.decode(this.getCode()); | ||
return codeArea.latitudeLo <= latitude | ||
&& latitude < codeArea.latitudeHi | ||
&& codeArea.longitudeLo <= longitude | ||
&& longitude < codeArea.longitudeHi; | ||
} | ||
/** | ||
@@ -162,0 +175,0 @@ * Encode a location into an Open Location Code. |
@@ -24,2 +24,8 @@ "use strict"; | ||
} | ||
getLatitudeHeight() { | ||
return this.latitudeHi - this.latitudeLo; | ||
} | ||
getLongitudeWidth() { | ||
return this.longitudeHi - this.longitudeLo; | ||
} | ||
} | ||
@@ -160,2 +166,9 @@ /** | ||
; | ||
contains(latitude, longitude) { | ||
const codeArea = OpenLocationCode.decode(this.getCode()); | ||
return codeArea.latitudeLo <= latitude | ||
&& latitude < codeArea.latitudeHi | ||
&& codeArea.longitudeLo <= longitude | ||
&& longitude < codeArea.longitudeHi; | ||
} | ||
/** | ||
@@ -162,0 +175,0 @@ * Encode a location into an Open Location Code. |
{ | ||
"name": "open-location-code-typescript", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Open Location Code Typescript implementation", | ||
@@ -10,3 +10,3 @@ "repository": { | ||
"main": "./dist/index.js", | ||
"types" : "dist/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"author": "Thibaud Giovannetti", | ||
@@ -18,9 +18,10 @@ "scripts": { | ||
"devDependencies": { | ||
"reflect-metadata": "0.1.10", | ||
"tslint": "5.8.0", | ||
"@types/chai": "4.1.3", | ||
"@types/mocha": "2.2.46", | ||
"@types/node": "10.3.1", | ||
"chai": "4.1.2", | ||
"mocha": "4.1.0", | ||
"reflect-metadata": "0.1.10", | ||
"ts-node": "6.0.5", | ||
"tslint": "5.8.0", | ||
"typescript": "2.6.1" | ||
@@ -27,0 +28,0 @@ }, |
@@ -16,2 +16,5 @@ { | ||
], | ||
"typeRoots": [ | ||
"./node_modules/@types" | ||
], | ||
"moduleResolution": "node", | ||
@@ -18,0 +21,0 @@ "experimentalDecorators": true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
200578
33.01%40
122.22%2276
41.28%9
12.5%