gtfs 3.6.0 → 3.6.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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.6.1] - 2022-11-08
9
+
10
+ ### Updated
11
+
12
+ - Support for querying null values as part of an array
13
+
8
14
  ## [3.6.0] - 2022-08-08
9
15
 
10
16
  ### Added
package/README.md CHANGED
@@ -93,6 +93,10 @@ try {
93
93
  <td><img src="https://github.com/BlinkTagInc/gtfs-tts/raw/main/docs/images/gtfs-tts-logo.svg" alt="GTFS-TTS" width="200"></td>
94
94
  <td><a href="https://github.com/blinktaginc/gtfs-tts">GTFS-Text-to-Speech</a> app tests GTFS stop name pronunciation for text-to-speech. It uses `node-gtfs` for loading stop names from GTFS data.</td>
95
95
  </tr>
96
+ <tr>
97
+ <td><img src="https://github.com/BlinkTagInc/transit-arrivals-widget/raw/master/docs/images/transit-arrivals-widget-logo.svg" alt="Transit Arrivals Widget" width="200"></td>
98
+ <td><a href="https://github.com/BlinkTagInc/transit-arrivals-widget">Transit Arrivals Widget</a> creates a realtime transit arrivals tool from GTFS and GTFS-RT data.</td>
99
+ </tr>
96
100
  </table>
97
101
 
98
102
  ## Command-Line Usage
package/lib/db.js CHANGED
@@ -26,7 +26,7 @@ export async function setupDb(db) {
26
26
  if (!db) {
27
27
  if (Object.keys(dbs).length > 1) {
28
28
  throw new Error(
29
- 'Multiple database connections. Pass the db you want to close as a parameter to `setupDb`.'
29
+ 'Multiple database connections. Pass the db you want to setup as a parameter to `setupDb`.'
30
30
  );
31
31
  }
32
32
 
package/lib/utils.js CHANGED
@@ -81,9 +81,16 @@ export function formatJoinClause(joinObject) {
81
81
 
82
82
  export function formatWhereClause(key, value) {
83
83
  if (Array.isArray(value)) {
84
- return `${sqlString.escapeId(key)} IN (${value
84
+ let whereClause = `${sqlString.escapeId(key)} IN (${value
85
+ .filter((v) => v !== null)
85
86
  .map((v) => sqlString.escape(v))
86
87
  .join(', ')})`;
88
+
89
+ if (value.includes(null)) {
90
+ whereClause = `(${whereClause} OR ${sqlString.escapeId(key)} IS NULL)`;
91
+ }
92
+
93
+ return whereClause;
87
94
  }
88
95
 
89
96
  if (value === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Import GTFS transit data into SQLite and query routes, stops, times, fares and more",
5
5
  "keywords": [
6
6
  "transit",
@@ -35,6 +35,7 @@
35
35
  "Jean-François Vial <jeff@modulaweb.fr>",
36
36
  "wdalrymple",
37
37
  "Ivan Yulaev",
38
+ "Ivy Rose",
38
39
  "Adam Pitchie",
39
40
  "Daniel Demidov",
40
41
  "gerlacdt",
@@ -72,11 +73,11 @@
72
73
  },
73
74
  "dependencies": {
74
75
  "@turf/helpers": "^6.5.0",
75
- "csv-parse": "^5.3.0",
76
- "csv-stringify": "^6.2.0",
76
+ "csv-parse": "^5.3.2",
77
+ "csv-stringify": "^6.2.1",
77
78
  "gtfs-realtime-bindings": "^0.0.6",
78
79
  "lodash-es": "^4.17.21",
79
- "long": "^5.2.0",
80
+ "long": "^5.2.1",
80
81
  "node-fetch": "^3.2.10",
81
82
  "pluralize": "^8.0.0",
82
83
  "pretty-error": "^4.0.0",
@@ -84,22 +85,22 @@
84
85
  "recursive-copy": "^2.0.14",
85
86
  "sanitize-filename": "^1.6.3",
86
87
  "sqlite": "^4.1.2",
87
- "sqlite3": "^5.0.11",
88
+ "sqlite3": "^5.1.2",
88
89
  "sqlstring-sqlite": "^0.1.1",
89
90
  "strip-bom-stream": "^5.0.0",
90
91
  "tmp-promise": "^3.0.3",
91
92
  "untildify": "^4.0.0",
92
93
  "unzipper": "^0.10.11",
93
- "yargs": "^17.5.1",
94
+ "yargs": "^17.6.2",
94
95
  "yoctocolors": "^1.0.0"
95
96
  },
96
97
  "devDependencies": {
97
98
  "dtslint": "^4.2.1",
98
- "eslint": "^8.21.0",
99
+ "eslint": "^8.27.0",
99
100
  "eslint-config-prettier": "^8.5.0",
100
- "eslint-config-xo": "^0.41.0",
101
- "husky": "^8.0.1",
102
- "mocha": "^10.0.0",
101
+ "eslint-config-xo": "^0.43.1",
102
+ "husky": "^8.0.2",
103
+ "mocha": "^10.1.0",
103
104
  "prettier": "^2.7.1",
104
105
  "pretty-quick": "^3.1.3",
105
106
  "should": "^13.2.3"