src/where.js
function handleExpr (node, options) {
  let expr

  if (node.type === 'unary_expr') {
    expr = `${node.operator} ${traverse(node.expr, options)}`
  } else if (node.operator === '=' && node.left.value === 1 && node.right.value === 1) {
    // a special case related to arcgis server
    return '1=1'
  } else if (node.operator === 'BETWEEN') {
    expr = traverse(node.left, options) + ' ' + (node.operator) + ' ' + (traverse(node.right.value[0], options)) + 'AND' + (traverse(node.right.value[1], options))
  } else {
    // store the column node for value decoding

    if (node.left.type === 'column_ref') {
      node.right.columnNode = node.left
    }

    if (node.right.type === 'column_ref') {
      node.left.columnNode = node.right
    }

    expr = `${traverse(node.left, options)} ${node.operator} ${traverse(node.right, options)}`
  }

  if (node.parentheses) {
    expr = `(${expr})`
  }

  return expr
}
function handleExpr (node, options) {
  let expr

  if (node.type === 'unary_expr') {
    expr = `${node.operator} ${traverse(node.expr, options)}`
  } else if (node.operator === '=' && node.left.value === 1 && node.right.value === 1) {
    // a special case related to arcgis server
    return '1=1'
  } else if (node.operator === 'BETWEEN') {
    expr = traverse(node.left, options) + ' ' + (node.operator) + ' ' + (traverse(node.right.value[0], options)) + 'AND' + (traverse(node.right.value[1], options))
  } else {
    // store the column node for value decoding

    if (node.left.type === 'column_ref') {
      node.right.columnNode = node.left
    }

    if (node.right.type === 'column_ref') {
      node.left.columnNode = node.right
    }

    expr = `${traverse(node.left, options)} ${node.operator} ${traverse(node.right, options)}`
  }

  if (node.parentheses) {
    expr = `(${expr})`
  }

  return expr
}
function handleExpr ( node , options ) { let expr if ( node . type === 'unary_expr' ) { expr = ` ${ node . operator } ${ traverse ( node . expr , options ) } ` } else if ( node . operator === '=' && node . left . value === 1 && node . right . value === 1 ) { // a special case related to arcgis server return '1=1' } else if ( node . operator === 'BETWEEN' ) { expr = traverse ( node . left , options ) + ' ' + ( node . operator ) + ' ' + ( traverse ( node . right . value [ 0 ] , options ) ) + 'AND' + ( traverse ( node . right . value [ 1 ] , options ) ) } else { // store the column node for value decoding if ( node . left . type === 'column_ref' ) { node . right . columnNode = node . left } if ( node . right . type === 'column_ref' ) { node . left . columnNode = node . right } expr = ` ${ traverse ( node . left , options ) } ${ node . operator } ${ traverse ( node . right , options ) } ` } if ( node . parentheses ) { expr = ` ${ expr } ` } return expr }
Convert an expression node to its string representation.
@param  {object} node    AST expression node
@param  {object} options winnow options
@return {string}         expression string
Convert an expression node to its string representation .