src/modules/resolver.js
function(map, terms) {
    for (var i = 0, l = terms.length; i < l; i++) {
        var curTerm = terms[i];
        map = map[curTerm];
        if (!map || curTerm === map) {
            return false; // no change
        } else if (isString(map)) {
            applyChange(terms, map, i);
            return true;
        }
    }
    // if we reach this place, it is a directory
    applyChange(terms, map['.'] || "index.js", terms.length);
    return true;
}
function(map, terms) {
    for (var i = 0, l = terms.length; i < l; i++) {
        var curTerm = terms[i];
        map = map[curTerm];
        if (!map || curTerm === map) {
            return false; // no change
        } else if (isString(map)) {
            applyChange(terms, map, i);
            return true;
        }
    }
    // if we reach this place, it is a directory
    applyChange(terms, map['.'] || "index.js", terms.length);
    return true;
}
function ( map , terms ) { for ( var i = 0 , l = terms . length ; i < l ; i ++ ) { var curTerm = terms [ i ] ; map = map [ curTerm ] ; if ( ! map || curTerm === map ) { return false ; // no change } else if ( isString ( map ) ) { applyChange ( terms , map , i ) ; return true ; } } // if we reach this place, it is a directory applyChange ( terms , map [ '.' ] || "index.js" , terms . length ) ; return true ; }
Apply a module map iteration.
@param {Object} map
@param {Array} terms Note that this array is changed by this function.
@return {Boolean}
Apply a module map iteration .