3 Commits

Author SHA1 Message Date
58d405396e 2.0.1 2018-11-02 16:49:58 -07:00
f7523ae5e2 fix: exit on errors 2018-11-02 16:37:09 -07:00
024a43e20b fix: format undefined fields 2018-11-02 16:37:09 -07:00
4 changed files with 7 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
### Changelog ### Changelog
#### [v2.0.1](https://git.w33ble.com/w33ble/adsb-index/compare/v2.0.0...v2.0.1) (2 November 2018)
- fix: format undefined fields [`024a43e`](https://git.w33ble.com/w33ble/adsb-index/commit/024a43e20b7ebcf79ef5625df2021a41fa9b2ce9)
- fix: exit on errors [`f7523ae`](https://git.w33ble.com/w33ble/adsb-index/commit/f7523ae5e20414dfec597050051566adbba9a310)
### [v2.0.0](https://git.w33ble.com/w33ble/adsb-index/compare/v1.0.1...v2.0.0) (2 November 2018) ### [v2.0.0](https://git.w33ble.com/w33ble/adsb-index/compare/v1.0.1...v2.0.0) (2 November 2018)
- feat: add ads-b exchange source [`9f0da54`](https://git.w33ble.com/w33ble/adsb-index/commit/9f0da54ccfc639ec6367ea85ec39bea117fd3108) - feat: add ads-b exchange source [`9f0da54`](https://git.w33ble.com/w33ble/adsb-index/commit/9f0da54ccfc639ec6367ea85ec39bea117fd3108)
- feat: use ads-b exchange data [`89261d0`](https://git.w33ble.com/w33ble/adsb-index/commit/89261d0010315ad248dcfdcf25916d952de648d8) - feat: use ads-b exchange data [`89261d0`](https://git.w33ble.com/w33ble/adsb-index/commit/89261d0010315ad248dcfdcf25916d952de648d8)

View File

@@ -42,7 +42,7 @@ async function run() {
// scheduled running // scheduled running
if (interval === 0) return; if (interval === 0) return;
logger.debug(`Starting interval (${interval}s)...`); logger.debug(`Starting interval (${interval}s)...`);
runInterval(fetchAndIndex, interval * 1000); runInterval(() => fetchAndIndex().catch(handleError), interval * 1000);
} }
run().catch(handleError); run().catch(handleError);

View File

@@ -1,6 +1,6 @@
{ {
"name": "adsb-index", "name": "adsb-index",
"version": "2.0.0", "version": "2.0.1",
"private": true, "private": true,
"description": "ADS-B indexing script", "description": "ADS-B indexing script",
"bin": "bin/index.js", "bin": "bin/index.js",

View File

@@ -2,6 +2,7 @@ import fetch from './fetch.mjs';
const formatNumber = str => str && Number(`${str}`.replace(/[^0-9.-]/, '')); const formatNumber = str => str && Number(`${str}`.replace(/[^0-9.-]/, ''));
const formatString = str => { const formatString = str => {
if (str == null) return 'N/A';
if (typeof str !== 'string') return str; if (typeof str !== 'string') return str;
return str && str.length && str !== 'undefined' ? str.trim() : 'N/A'; return str && str.length && str !== 'undefined' ? str.trim() : 'N/A';
}; };