Skip to content

Commit

Permalink
geohash -> gh
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Mar 24, 2024
1 parent 40f7509 commit f8385aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ describe('generateTags()', () => {
[ 'g', '19.094', 'lon' ],
[ 'g', '19.09', 'lon' ],
[ 'g', '19', 'lon' ],
[ 'G', 'geohash' ],
[ 'g', 'u2mwdd8q4', 'geohash' ],
[ 'g', 'u2mwdd8q', 'geohash' ],
[ 'g', 'u2mwdd8', 'geohash' ],
[ 'g', 'u2mwdd', 'geohash' ],
[ 'g', 'u2mwd', 'geohash' ],
[ 'g', 'u2mw', 'geohash' ],
[ 'g', 'u2m', 'geohash' ],
[ 'g', 'u2', 'geohash' ],
[ 'g', 'u', 'geohash' ],
[ 'G', 'gh' ],
[ 'g', 'u2mwdd8q4', 'gh' ],
[ 'g', 'u2mwdd8q', 'gh' ],
[ 'g', 'u2mwdd8', 'gh' ],
[ 'g', 'u2mwdd', 'gh' ],
[ 'g', 'u2mwd', 'gh' ],
[ 'g', 'u2mw', 'gh' ],
[ 'g', 'u2m', 'gh' ],
[ 'g', 'u2', 'gh' ],
[ 'g', 'u', 'gh' ],
[ 'G', 'countryCode' ],
[ 'g', 'HU', 'countryCode' ],
[ 'g', 'HUN', 'countryCode' ],
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ const generateTags = (input: InputData, opts: Options): GeoTags[] => {
fullGeohash = input.geohash
}
if(fullGeohash && fullGeohash.length > 0 && opts.legacy === false) {
tags.push(['G', 'geohash' ]);
tags.push(['G', 'gh' ]);
}
for (let i = fullGeohash.length; i > 0; i--) {
const partialGeohash = fullGeohash.substring(0, i);
const tag: Geohash = ['g', partialGeohash ]
if(!opts.legacy) tag.push('geohash')
if(!opts.legacy) tag.push('gh')
tags.push(tag);
}
}
Expand Down

0 comments on commit f8385aa

Please sign in to comment.