js/lib/query/query.js
function (operator, field) {
            if (!this.query.where) {
                return null;
            }

            function findExpression(expressions) {
                var expression,
                    ret = null;
                for (var i = 0; i < expressions.length; i++) {
                    expression = expressions[i];
                    if (expression instanceof Where) {
                        ret = findExpression(expression.expressions);
                    } else if (expression instanceof Comparator) {
                        if (expression.operator == operator && expression.field == field) {
                            ret = expression;
                        }
                    }
                    if (ret) {
                        return ret;
                    }

                }
                return ret;
            }

            return findExpression(this.query.where.expressions);
        }
function (operator, field) {
            if (!this.query.where) {
                return null;
            }

            function findExpression(expressions) {
                var expression,
                    ret = null;
                for (var i = 0; i < expressions.length; i++) {
                    expression = expressions[i];
                    if (expression instanceof Where) {
                        ret = findExpression(expression.expressions);
                    } else if (expression instanceof Comparator) {
                        if (expression.operator == operator && expression.field == field) {
                            ret = expression;
                        }
                    }
                    if (ret) {
                        return ret;
                    }

                }
                return ret;
            }

            return findExpression(this.query.where.expressions);
        }
function ( operator , field ) { if ( ! this . query . where ) { return null ; } function findExpression ( expressions ) { var expression , ret = null ; for ( var i = 0 ; i < expressions . length ; i ++ ) { expression = expressions [ i ] ; if ( expression instanceof Where ) { ret = findExpression ( expression . expressions ) ; } else if ( expression instanceof Comparator ) { if ( expression . operator == operator && expression . field == field ) { ret = expression ; } } if ( ret ) { return ret ; } } return ret ; } return findExpression ( this . query . where . expressions ) ; }
Tries to find a expression for an operator and a field
@param {String} operator
@param {String} field
@returns {*}
Tries to find a expression for an operator and a field