Use early return

This commit is contained in:
IagoLast 2018-06-13 09:38:24 +02:00
parent 0cf6605b8d
commit ae7e7578db

View File

@ -35,7 +35,9 @@ function _castColumnToEpoch(columnName) {
} }
function getColumnsWithWrappedDates(query) { function getColumnsWithWrappedDates(query) {
if (query) { if(!query){
return;
}
if (query.match(/\b_cdb_epoch_transformation\b/)) { if (query.match(/\b_cdb_epoch_transformation\b/)) {
const columns = []; const columns = [];
const fieldMatcher = /\bdate_part\('epoch', "([^"]+)"\) as "([^"]+)"/gmi; const fieldMatcher = /\bdate_part\('epoch', "([^"]+)"\) as "([^"]+)"/gmi;
@ -49,7 +51,6 @@ function getColumnsWithWrappedDates(query) {
return columns; return columns;
} }
} }
}
module.exports = { module.exports = {
wrapDates, wrapDates,