build/doc-builder/theme/fixtures/documents/probe.js
function execQuery( obj, qu, shortCircuit, stopOnFirst ) {
	var arrayResults = [];
	var keyResults = [];
	sys.each( obj, function ( record, key ) {
		var expr, result, test, _i, _len;

		for ( _i = 0, _len = qu.length; _i < _len; _i++ ) {
			expr = qu[_i];
			if ( expr.splitPath ) {
				test = reachin( expr.splitPath, record, expr.operation );
			}
			result = operations[expr.operation]( expr, test, record );
			if ( result ) {
				arrayResults.push( record );
				keyResults.push( key );
			}
			if ( !result && shortCircuit ) {
				break;
			}
		}
		if ( arrayResults.length > 0 && stopOnFirst ) {
			return false;
		}
	} );
	return {
		arrayResults : arrayResults,
		keyResults   : keyResults
	};
}
function execQuery( obj, qu, shortCircuit, stopOnFirst ) {
	var arrayResults = [];
	var keyResults = [];
	sys.each( obj, function ( record, key ) {
		var expr, result, test, _i, _len;

		for ( _i = 0, _len = qu.length; _i < _len; _i++ ) {
			expr = qu[_i];
			if ( expr.splitPath ) {
				test = reachin( expr.splitPath, record, expr.operation );
			}
			result = operations[expr.operation]( expr, test, record );
			if ( result ) {
				arrayResults.push( record );
				keyResults.push( key );
			}
			if ( !result && shortCircuit ) {
				break;
			}
		}
		if ( arrayResults.length > 0 && stopOnFirst ) {
			return false;
		}
	} );
	return {
		arrayResults : arrayResults,
		keyResults   : keyResults
	};
}
function execQuery ( obj , qu , shortCircuit , stopOnFirst ) { var arrayResults = [ ] ; var keyResults = [ ] ; sys . each ( obj , function ( record , key ) { var expr , result , test , _i , _len ; for ( _i = 0 , _len = qu . length ; _i < _len ; _i ++ ) { expr = qu [ _i ] ; if ( expr . splitPath ) { test = reachin ( expr . splitPath , record , expr . operation ) ; } result = operations [ expr . operation ] ( expr , test , record ) ; if ( result ) { arrayResults . push ( record ) ; keyResults . push ( key ) ; } if ( ! result && shortCircuit ) { break ; } } if ( arrayResults . length > 0 && stopOnFirst ) { return false ; } } ) ; return { arrayResults : arrayResults , keyResults : keyResults } ; }
Executes a query by traversing a document and evaluating each record
@private
@param {array|object} obj The object to query
@param {object} qu The query to execute
@param {?boolean} shortCircuit When true, the condition that matches the query stops evaluation for that record, otherwise all conditions have to be met
@param {?boolean} stopOnFirst When true all evaluation stops after the first record is found to match the conditons
Executes a query by traversing a document and evaluating each record