Skip to content

Commit

Permalink
clarify logic in toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Mar 2, 2015
1 parent 30cea65 commit 219c244
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cycledash/static/js/QueryLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ function toString(parsedQuery) {
// e.g. {filters:[{type: '<', filterValue:'10', columnName:'A'}]}
if (parsedQuery.filters) {
filters = filters.concat(parsedQuery.filters.map(f => {
if (f.filterValue !== null && f.filterValue !== undefined) {
return `${f.columnName} ${f.type} ${maybeQuote(f.filterValue)}`;
} else {
var type = f.type.toLowerCase();
if (type == 'null' || type == 'not null') {
return `${f.columnName} IS ${f.type}`;
} else {
return `${f.columnName} ${f.type} ${maybeQuote(f.filterValue)}`;
}
}));
}
Expand Down

0 comments on commit 219c244

Please sign in to comment.