src/seeq.js
/**
 * Check existence of each name from the list on specified resources
 * or search for each string  on specified resources.
 * 
 * Result of checking/searching will be passed into callback as object.
 * Each field of the object is a name that was checked/searched.
 * Value of result's field is object that is returned by {@link module:seeq.searchName searchName} function.
 * 
 * <code>null</code> will be passed into callback when no name is specified to check/search.
 * 
 * @param {Array | String} names
 *      The list of names or a name that should be checked/searched.
 * @param {Function} callback
 *      Function that should be called to process operation's result.
 * @param {Object} [settings]
 *      Operation settings. See {@link module:seeq.searchName searchName} for details.
 * @alias module:seeq.search
 */
Check existence of each name from the list on specified resources
or search for each string  on specified resources.

Result of checking/searching will be passed into callback as object.
Each field of the object is a name that was checked/searched.
Value of result's field is object that is returned by  module:seeq.searchName searchName function.

null will be passed into callback when no name is specified to check/search.

@param {Array | String} names
The list of names or a name that should be checked/searched.
@param {Function} callback
Function that should be called to process operation's result.
@param {Object} [settings]
Operation settings. See  module:seeq.searchName searchName for details.
Check existence of each name from the list on specified resources or search for each string on specified resources . Result of checking / searching will be passed into callback as object . Each field of the object is a name that was checked / searched . Value of result ' s field is object that is returned by module : seeq . searchName searchName function . null will be passed into callback when no name is specified to check / search . @param { Array | String } names The list of names or a name that should be checked / searched . @param { Function } callback Function that should be called to process operation ' s result . @param { Object } [ settings ] Operation settings . See module : seeq . searchName searchName for details .
function search(names, callback, settings) {
    var progressCallback = settings && settings.progressCallback,
        resultMap = {},
        nI, nK;
    function searchNameProgress(data) {
        data.number += data.total * nI;
        data.total *= nK;
        progressCallback(data);
    }
    function resultCallback(result) {
        resultMap[ names[nI] ] = result;
        nI++;
        if (nI < nK) {
            searchName(names[nI], resultCallback, settings);
        }
        else {
            callback(resultMap);
        }
    }
    if (names && typeof names === "string") {
        names = [names];
    }
    if (names && (nK = names.length)) {
        if (progressCallback) {
            settings = mixing({progressCallback: searchNameProgress}, settings, {except: "progressCallback"});
        }
        searchName(names[nI = 0], resultCallback, settings);
    }
    else {
        callback(null);
    }
}
function search ( names , callback , settings ) { var progressCallback = settings && settings . progressCallback , resultMap = { } , nI , nK ; function searchNameProgress ( data ) { data . number += data . total * nI ; data . total *= nK ; progressCallback ( data ) ; } function resultCallback ( result ) { resultMap [ names [ nI ] ] = result ; nI ++ ; if ( nI < nK ) { searchName ( names [ nI ] , resultCallback , settings ) ; } else { callback ( resultMap ) ; } } if ( names && typeof names === "string" ) { names = [ names ] ; } if ( names && ( nK = names . length ) ) { if ( progressCallback ) { settings = mixing ( { progressCallback : searchNameProgress } , settings , { except : "progressCallback" } ) ; } searchName ( names [ nI = 0 ] , resultCallback , settings ) ; } else { callback ( null ) ; } }
Check existence of each name from the list on specified resources
 or search for each string  on specified resources.
Check existence of each name from the list on specified resources or search for each string on specified resources .
/*jshint boss:true*/ // Notify about operation progress // Gather results for each name // Get results for the next name // Return collected data // Get results for the first name