gtfs 4.13.0 → 4.13.1
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/bin/gtfs-export.js +19 -20
- package/dist/bin/gtfs-export.js.map +1 -1
- package/dist/bin/gtfs-import.js +52 -55
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +37 -39
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +122 -125
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/gtfs-export.js
CHANGED
|
@@ -210,8 +210,6 @@ var model3 = {
|
|
|
210
210
|
{
|
|
211
211
|
name: "attribution_id",
|
|
212
212
|
type: "text",
|
|
213
|
-
primary: true,
|
|
214
|
-
required: true,
|
|
215
213
|
prefix: true
|
|
216
214
|
},
|
|
217
215
|
{
|
|
@@ -3271,23 +3269,6 @@ var models_default = models;
|
|
|
3271
3269
|
// src/lib/db.ts
|
|
3272
3270
|
import Database from "better-sqlite3";
|
|
3273
3271
|
import untildify2 from "untildify";
|
|
3274
|
-
|
|
3275
|
-
// src/lib/utils.ts
|
|
3276
|
-
import sqlString from "sqlstring-sqlite";
|
|
3277
|
-
import Long from "long";
|
|
3278
|
-
function setDefaultConfig(initialConfig) {
|
|
3279
|
-
const defaults = {
|
|
3280
|
-
sqlitePath: ":memory:",
|
|
3281
|
-
ignoreDuplicates: false,
|
|
3282
|
-
gtfsRealtimeExpirationSeconds: 0
|
|
3283
|
-
};
|
|
3284
|
-
return {
|
|
3285
|
-
...defaults,
|
|
3286
|
-
...initialConfig
|
|
3287
|
-
};
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
// src/lib/db.ts
|
|
3291
3272
|
var dbs = {};
|
|
3292
3273
|
function setupDb(sqlitePath) {
|
|
3293
3274
|
const db = new Database(untildify2(sqlitePath));
|
|
@@ -3299,7 +3280,7 @@ function setupDb(sqlitePath) {
|
|
|
3299
3280
|
}
|
|
3300
3281
|
function openDb(config = null) {
|
|
3301
3282
|
if (config) {
|
|
3302
|
-
const { sqlitePath, db } =
|
|
3283
|
+
const { sqlitePath = ":memory:", db } = config;
|
|
3303
3284
|
if (db) {
|
|
3304
3285
|
return db;
|
|
3305
3286
|
}
|
|
@@ -3308,6 +3289,9 @@ function openDb(config = null) {
|
|
|
3308
3289
|
}
|
|
3309
3290
|
return setupDb(sqlitePath);
|
|
3310
3291
|
}
|
|
3292
|
+
if (Object.keys(dbs).length === 0) {
|
|
3293
|
+
return setupDb(":memory:");
|
|
3294
|
+
}
|
|
3311
3295
|
if (Object.keys(dbs).length === 1) {
|
|
3312
3296
|
const filename = Object.keys(dbs)[0];
|
|
3313
3297
|
return dbs[filename];
|
|
@@ -3332,6 +3316,21 @@ import {
|
|
|
3332
3316
|
} from "lodash-es";
|
|
3333
3317
|
import { feature, featureCollection } from "@turf/helpers";
|
|
3334
3318
|
|
|
3319
|
+
// src/lib/utils.ts
|
|
3320
|
+
import sqlString from "sqlstring-sqlite";
|
|
3321
|
+
import Long from "long";
|
|
3322
|
+
function setDefaultConfig(initialConfig) {
|
|
3323
|
+
const defaults = {
|
|
3324
|
+
sqlitePath: ":memory:",
|
|
3325
|
+
ignoreDuplicates: false,
|
|
3326
|
+
gtfsRealtimeExpirationSeconds: 0
|
|
3327
|
+
};
|
|
3328
|
+
return {
|
|
3329
|
+
...defaults,
|
|
3330
|
+
...initialConfig
|
|
3331
|
+
};
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3335
3334
|
// src/lib/export.ts
|
|
3336
3335
|
import path2 from "node:path";
|
|
3337
3336
|
import { writeFile } from "node:fs/promises";
|