_validateContition(condition) {
        //check condition statement array length
        if (condition.length != 3) {
            throw new SyntaxError('Condition is corrupted. Condition array should have 3 items [column, operand, value].', condition);
        }

        //type check for condition statement
        if (isNaN(condition[2]) && !Array.isArray(condition[2]) && typeof condition[2] !== 'string' && typeof condition[2] !== 'object') {
            throw new SyntaxError("Unknown condition value data type: " + (typeof condition[2]));
        }

        //the IN statement should have array with it and vise versa
        let operand = condition[1].trim().toLowerCase();
        if (['in', 'not in'].includes(operand) && !Array.isArray(condition[2])) {
            throw new SyntaxError("Condition array value should only passed with an 'in'");
        }

        if (!['in', 'not in'].includes(operand) && Array.isArray(condition[2])) {
            throw new SyntaxError(`Invalid input passed with operand: ${operand}`);
        }

        if (typeof condition[2] === 'string' && condition[2] !== 'null') {
            //santize string
            condition[2] = condition[2].replace(/'/g, "''");

            //wrap string values in single quotes
            if (this.allowedHtml.includes(condition[0])) {
                condition[2] = "'" + condition[2] + "'";
            } else {
                condition[2] = "'" + escapeHtml(condition[2]) + "'";
            }
        }

        if (Array.isArray(condition[2]) && ['in', 'not in'].includes(operand)) {
            if (typeof condition[2][0] == 'string')
                condition[2] = condition[2].map(item => "'" + item + "'");
            condition[2] = '(' + condition[2].join() + ')';
        }

        if (typeof condition[2] === 'object' && condition[2].type === 'RAW_QUERY') {
            condition[2] = condition[2].query;
        }

        return condition;
    }
/**
     * validate conitions values
     * @param {array} condition 
     */
validate conitions values
@param {array} condition
validate conitions values @param { array } condition
_validateContition(condition) {
        if (condition.length != 3) {
            throw new SyntaxError('Condition is corrupted. Condition array should have 3 items [column, operand, value].', condition);
        }
        if (isNaN(condition[2]) && !Array.isArray(condition[2]) && typeof condition[2] !== 'string' && typeof condition[2] !== 'object') {
            throw new SyntaxError("Unknown condition value data type: " + (typeof condition[2]));
        }
        let operand = condition[1].trim().toLowerCase();
        if (['in', 'not in'].includes(operand) && !Array.isArray(condition[2])) {
            throw new SyntaxError("Condition array value should only passed with an 'in'");
        }
        if (!['in', 'not in'].includes(operand) && Array.isArray(condition[2])) {
            throw new SyntaxError(`Invalid input passed with operand: ${operand}`);
        }
        if (typeof condition[2] === 'string' && condition[2] !== 'null') {
            condition[2] = condition[2].replace(/'/g, "''");
            if (this.allowedHtml.includes(condition[0])) {
                condition[2] = "'" + condition[2] + "'";
            } else {
                condition[2] = "'" + escapeHtml(condition[2]) + "'";
            }
        }
        if (Array.isArray(condition[2]) && ['in', 'not in'].includes(operand)) {
            if (typeof condition[2][0] == 'string')
                condition[2] = condition[2].map(item => "'" + item + "'");
            condition[2] = '(' + condition[2].join() + ')';
        }
        if (typeof condition[2] === 'object' && condition[2].type === 'RAW_QUERY') {
            condition[2] = condition[2].query;
        }
        return condition;
    }
_validateContition ( condition ) { if ( condition . length != 3 ) { throw new SyntaxError ( 'Condition is corrupted. Condition array should have 3 items [column, operand, value].' , condition ) ; } if ( isNaN ( condition [ 2 ] ) && ! Array . isArray ( condition [ 2 ] ) && typeof condition [ 2 ] !== 'string' && typeof condition [ 2 ] !== 'object' ) { throw new SyntaxError ( "Unknown condition value data type: " + ( typeof condition [ 2 ] ) ) ; } let operand = condition [ 1 ] . trim ( ) . toLowerCase ( ) ; if ( [ 'in' , 'not in' ] . includes ( operand ) && ! Array . isArray ( condition [ 2 ] ) ) { throw new SyntaxError ( "Condition array value should only passed with an 'in'" ) ; } if ( ! [ 'in' , 'not in' ] . includes ( operand ) && Array . isArray ( condition [ 2 ] ) ) { throw new SyntaxError ( ` ${ operand } ` ) ; } if ( typeof condition [ 2 ] === 'string' && condition [ 2 ] !== 'null' ) { condition [ 2 ] = condition [ 2 ] . replace ( / ' / g , "''" ) ; if ( this . allowedHtml . includes ( condition [ 0 ] ) ) { condition [ 2 ] = "'" + condition [ 2 ] + "'" ; } else { condition [ 2 ] = "'" + escapeHtml ( condition [ 2 ] ) + "'" ; } } if ( Array . isArray ( condition [ 2 ] ) && [ 'in' , 'not in' ] . includes ( operand ) ) { if ( typeof condition [ 2 ] [ 0 ] == 'string' ) condition [ 2 ] = condition [ 2 ] . map ( item => "'" + item + "'" ) ; condition [ 2 ] = '(' + condition [ 2 ] . join ( ) + ')' ; } if ( typeof condition [ 2 ] === 'object' && condition [ 2 ] . type === 'RAW_QUERY' ) { condition [ 2 ] = condition [ 2 ] . query ; } return condition ; }
validate conitions values
 @param {array} condition
validate conitions values @param { array } condition
//check condition statement array length //type check for condition statement //the IN statement should have array with it and vise versa //santize string //wrap string values in single quotes