1 Commits

Author SHA1 Message Date
4de052ef0d fix: format undefined fields 2018-11-02 16:31:54 -07:00
2 changed files with 1 additions and 2 deletions

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().catch(handleError), interval * 1000); runInterval(fetchAndIndex, interval * 1000);
} }
run().catch(handleError); run().catch(handleError);

View File

@@ -2,7 +2,6 @@ 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';
}; };