Comparing version 3.7.1 to 3.7.2
@@ -8,2 +8,6 @@ # Change Log | ||
## [3.7.2] - 2021-04-29 | ||
### Fixed | ||
- Accept integer input to `h3GetResolution` (#113) | ||
## [3.7.1] - 2021-03-10 | ||
@@ -10,0 +14,0 @@ ### Fixed |
@@ -60,2 +60,3 @@ 'use strict'; | ||
['h3GetBaseCell', NUMBER, [H3_LOWER, H3_UPPER]], | ||
['h3GetResolution', NUMBER, [H3_LOWER, H3_UPPER]], | ||
['maxFaceCount', NUMBER, [H3_LOWER, H3_UPPER]], | ||
@@ -62,0 +63,0 @@ ['h3GetFaces', null, [H3_LOWER, H3_UPPER, POINTER]], |
@@ -58,2 +58,3 @@ /* | ||
['h3GetBaseCell', NUMBER, [H3_LOWER, H3_UPPER]], | ||
['h3GetResolution', NUMBER, [H3_LOWER, H3_UPPER]], | ||
['maxFaceCount', NUMBER, [H3_LOWER, H3_UPPER]], | ||
@@ -60,0 +61,0 @@ ['h3GetFaces', null, [H3_LOWER, H3_UPPER, POINTER]], |
@@ -120,3 +120,3 @@ /* | ||
*/ | ||
function h3IndexToSplitLong(h3Index) { | ||
export function h3IndexToSplitLong(h3Index) { | ||
if ( | ||
@@ -164,3 +164,3 @@ Array.isArray(h3Index) && | ||
*/ | ||
function splitLongToh3Index(lower, upper) { | ||
export function splitLongToh3Index(lower, upper) { | ||
return hexFrom32Bit(upper) + zeroPad(8, hexFrom32Bit(lower)); | ||
@@ -585,6 +585,8 @@ } | ||
export function h3GetResolution(h3Index) { | ||
if (typeof h3Index !== 'string') { | ||
const [lower, upper] = h3IndexToSplitLong(h3Index); | ||
if (!H3.h3IsValid(lower, upper)) { | ||
// Compatability with stated API | ||
return -1; | ||
} | ||
return parseInt(h3Index.charAt(1), BASE_16); | ||
return H3.h3GetResolution(lower, upper); | ||
} | ||
@@ -591,0 +593,0 @@ |
{ | ||
"name": "h3-js", | ||
"version": "3.7.1", | ||
"version": "3.7.2", | ||
"description": "Pure-Javascript version of the H3 library, a hexagon-based geographic grid system", | ||
@@ -5,0 +5,0 @@ "author": "Nick Rabinowitz <nickr@uber.com>", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5161773
51467