@hebcal/geo-sqlite 3.8.0 → 3.9.0
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 +14 -4
- package/dist/index.mjs +14 -4
- package/package.json +15 -23
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v3.
|
|
1
|
+
/*! @hebcal/geo-sqlite v3.9.0 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var Database = require('better-sqlite3');
|
|
7
7
|
var core = require('@hebcal/core');
|
|
8
|
+
require('@hebcal/cities');
|
|
8
9
|
var pino = require('pino');
|
|
9
10
|
var events = require('events');
|
|
10
11
|
var fs = require('fs');
|
|
@@ -291,6 +292,12 @@ class GeoDb {
|
|
|
291
292
|
if (geonameid) {
|
|
292
293
|
return this.lookupGeoname(geonameid);
|
|
293
294
|
} else {
|
|
295
|
+
const location = core.Location.lookup(cityName);
|
|
296
|
+
|
|
297
|
+
if (location) {
|
|
298
|
+
return location;
|
|
299
|
+
}
|
|
300
|
+
|
|
294
301
|
if (this.logger) this.logger.warn(`GeoDb: unknown city=${cityName}`);
|
|
295
302
|
return null;
|
|
296
303
|
}
|
|
@@ -450,9 +457,12 @@ class GeoDb {
|
|
|
450
457
|
async function buildGeonamesSqlite(dbFilename, countryInfotxt, cities5000txt, citiesPatch, admin1CodesASCIItxt, ILtxt) {
|
|
451
458
|
const logger = pino__default["default"]({
|
|
452
459
|
// level: argv.quiet ? 'warn' : 'info',
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
460
|
+
transport: {
|
|
461
|
+
target: 'pino-pretty',
|
|
462
|
+
options: {
|
|
463
|
+
translateTime: 'SYS:standard',
|
|
464
|
+
ignore: 'pid,hostname'
|
|
465
|
+
}
|
|
456
466
|
}
|
|
457
467
|
});
|
|
458
468
|
const db = new Database__default["default"](dbFilename);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/*! @hebcal/geo-sqlite v3.
|
|
1
|
+
/*! @hebcal/geo-sqlite v3.9.0 */
|
|
2
2
|
import Database from 'better-sqlite3';
|
|
3
3
|
import { Location, Locale } from '@hebcal/core';
|
|
4
|
+
import '@hebcal/cities';
|
|
4
5
|
import pino from 'pino';
|
|
5
6
|
import events from 'events';
|
|
6
7
|
import fs from 'fs';
|
|
@@ -279,6 +280,12 @@ class GeoDb {
|
|
|
279
280
|
if (geonameid) {
|
|
280
281
|
return this.lookupGeoname(geonameid);
|
|
281
282
|
} else {
|
|
283
|
+
const location = Location.lookup(cityName);
|
|
284
|
+
|
|
285
|
+
if (location) {
|
|
286
|
+
return location;
|
|
287
|
+
}
|
|
288
|
+
|
|
282
289
|
if (this.logger) this.logger.warn(`GeoDb: unknown city=${cityName}`);
|
|
283
290
|
return null;
|
|
284
291
|
}
|
|
@@ -438,9 +445,12 @@ class GeoDb {
|
|
|
438
445
|
async function buildGeonamesSqlite(dbFilename, countryInfotxt, cities5000txt, citiesPatch, admin1CodesASCIItxt, ILtxt) {
|
|
439
446
|
const logger = pino({
|
|
440
447
|
// level: argv.quiet ? 'warn' : 'info',
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
448
|
+
transport: {
|
|
449
|
+
target: 'pino-pretty',
|
|
450
|
+
options: {
|
|
451
|
+
translateTime: 'SYS:standard',
|
|
452
|
+
ignore: 'pid,hostname'
|
|
453
|
+
}
|
|
444
454
|
}
|
|
445
455
|
});
|
|
446
456
|
const db = new Database(dbFilename);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/geo-sqlite",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hebcal"
|
|
@@ -28,10 +28,11 @@
|
|
|
28
28
|
"geo-sqlite.d.ts"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hebcal/
|
|
31
|
+
"@hebcal/cities": "^3.1.1",
|
|
32
|
+
"@hebcal/core": "^3.33.3",
|
|
32
33
|
"better-sqlite3": "^7.5.0",
|
|
33
|
-
"pino": "^7.
|
|
34
|
-
"pino-pretty": "^7.5.
|
|
34
|
+
"pino": "^7.8.0",
|
|
35
|
+
"pino-pretty": "^7.5.1"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "rollup -c",
|
|
@@ -45,34 +46,25 @@
|
|
|
45
46
|
],
|
|
46
47
|
"require": [
|
|
47
48
|
"@babel/register",
|
|
48
|
-
"
|
|
49
|
+
"regenerator-runtime/runtime"
|
|
49
50
|
],
|
|
50
|
-
"babel": {
|
|
51
|
-
"testOptions": {
|
|
52
|
-
"presets": [
|
|
53
|
-
"@babel/env"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
51
|
"inherit": true,
|
|
58
52
|
"verbose": true
|
|
59
53
|
},
|
|
60
54
|
"license": "BSD-2-Clause",
|
|
61
55
|
"devDependencies": {
|
|
62
|
-
"@
|
|
63
|
-
"@babel/core": "^7.16.12",
|
|
64
|
-
"@babel/polyfill": "^7.12.1",
|
|
56
|
+
"@babel/core": "^7.17.5",
|
|
65
57
|
"@babel/preset-env": "^7.16.11",
|
|
66
|
-
"@babel/register": "^7.
|
|
67
|
-
"@rollup/plugin-babel": "^5.3.
|
|
68
|
-
"@rollup/plugin-commonjs": "^21.0.
|
|
58
|
+
"@babel/register": "^7.17.0",
|
|
59
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
60
|
+
"@rollup/plugin-commonjs": "^21.0.2",
|
|
69
61
|
"@rollup/plugin-json": "^4.1.0",
|
|
70
62
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
71
|
-
"ava": "^
|
|
72
|
-
"eslint": "^8.
|
|
63
|
+
"ava": "^4.0.1",
|
|
64
|
+
"eslint": "^8.9.0",
|
|
73
65
|
"eslint-config-google": "^0.14.0",
|
|
74
|
-
"jsdoc": "^3.6.
|
|
75
|
-
"jsdoc-to-markdown": "^7.1.
|
|
76
|
-
"rollup": "^2.
|
|
66
|
+
"jsdoc": "^3.6.10",
|
|
67
|
+
"jsdoc-to-markdown": "^7.1.1",
|
|
68
|
+
"rollup": "^2.68.0"
|
|
77
69
|
}
|
|
78
70
|
}
|