@hebcal/geo-sqlite 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v4.5.
|
|
1
|
+
/*! @hebcal/geo-sqlite v4.5.2 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -318,6 +318,7 @@ class GeoDb {
|
|
|
318
318
|
admin1: res.State,
|
|
319
319
|
asciiname: res.CityMixedCase,
|
|
320
320
|
country: 'United States',
|
|
321
|
+
cc: 'US',
|
|
321
322
|
latitude: res.Latitude,
|
|
322
323
|
longitude: res.Longitude,
|
|
323
324
|
timezone: core.Location.getUsaTzid(res.State, res.TimeZone, res.DayLightSaving),
|
|
@@ -371,13 +372,15 @@ class GeoDb {
|
|
|
371
372
|
|
|
372
373
|
const geoMatches = geoRows.map(res => {
|
|
373
374
|
const loc = this.lookupGeoname(res.geonameid);
|
|
374
|
-
const
|
|
375
|
+
const cc = loc.getCountryCode();
|
|
376
|
+
const country = this.countryNames.get(cc) || '';
|
|
375
377
|
const admin1 = loc.admin1 || '';
|
|
376
378
|
const obj = {
|
|
377
379
|
id: res.geonameid,
|
|
378
380
|
value: loc.name,
|
|
379
381
|
admin1,
|
|
380
382
|
country,
|
|
383
|
+
cc,
|
|
381
384
|
latitude: loc.latitude,
|
|
382
385
|
longitude: loc.longitude,
|
|
383
386
|
timezone: loc.getTzid(),
|
|
@@ -417,6 +420,7 @@ class GeoDb {
|
|
|
417
420
|
admin1: loc.admin1,
|
|
418
421
|
asciiname: loc.getShortName(),
|
|
419
422
|
country: 'United States',
|
|
423
|
+
cc: 'US',
|
|
420
424
|
latitude: loc.latitude,
|
|
421
425
|
longitude: loc.longitude,
|
|
422
426
|
timezone: loc.getTzid(),
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v4.5.
|
|
1
|
+
/*! @hebcal/geo-sqlite v4.5.2 */
|
|
2
2
|
import Database from 'better-sqlite3';
|
|
3
3
|
import { Location, Locale } from '@hebcal/core';
|
|
4
4
|
import '@hebcal/cities';
|
|
@@ -306,6 +306,7 @@ class GeoDb {
|
|
|
306
306
|
admin1: res.State,
|
|
307
307
|
asciiname: res.CityMixedCase,
|
|
308
308
|
country: 'United States',
|
|
309
|
+
cc: 'US',
|
|
309
310
|
latitude: res.Latitude,
|
|
310
311
|
longitude: res.Longitude,
|
|
311
312
|
timezone: Location.getUsaTzid(res.State, res.TimeZone, res.DayLightSaving),
|
|
@@ -359,13 +360,15 @@ class GeoDb {
|
|
|
359
360
|
|
|
360
361
|
const geoMatches = geoRows.map(res => {
|
|
361
362
|
const loc = this.lookupGeoname(res.geonameid);
|
|
362
|
-
const
|
|
363
|
+
const cc = loc.getCountryCode();
|
|
364
|
+
const country = this.countryNames.get(cc) || '';
|
|
363
365
|
const admin1 = loc.admin1 || '';
|
|
364
366
|
const obj = {
|
|
365
367
|
id: res.geonameid,
|
|
366
368
|
value: loc.name,
|
|
367
369
|
admin1,
|
|
368
370
|
country,
|
|
371
|
+
cc,
|
|
369
372
|
latitude: loc.latitude,
|
|
370
373
|
longitude: loc.longitude,
|
|
371
374
|
timezone: loc.getTzid(),
|
|
@@ -405,6 +408,7 @@ class GeoDb {
|
|
|
405
408
|
admin1: loc.admin1,
|
|
406
409
|
asciiname: loc.getShortName(),
|
|
407
410
|
country: 'United States',
|
|
411
|
+
cc: 'US',
|
|
408
412
|
latitude: loc.latitude,
|
|
409
413
|
longitude: loc.longitude,
|
|
410
414
|
timezone: loc.getTzid(),
|