index.js
function(cur, depth, context, collector, subKey) {
        if(depth === context.length) {
            collector.push(cur[subKey]);
            return;
        }
        var value = context[depth];
        if(value.constructor !== Array) {
            var keys = this.precedenceMap[value];
            var n = keys.length;
            for(var j=0; j<n; j++) {
                if(cur[keys[j]] !== undefined) {
                    this._readNoMergeHelper(cur[keys[j]], depth+1, context, collector, subKey);
                }
            }
        } else {
            var seen = {};
            var i = value.length;
            while(i--) {
                keys = this.precedenceMap[value[i]];
                n = keys.length;
                for(j=0; j<n; j++) {
                    if(cur[keys[j]] !== undefined && seen[keys[j]] === undefined) {
                        this._readNoMergeHelper(cur[keys[j]], depth+1, context, collector, subKey);
                        seen[keys[j]] = true;
                    }
                }
            }
        }
    }
function(cur, depth, context, collector, subKey) {
        if(depth === context.length) {
            collector.push(cur[subKey]);
            return;
        }
        var value = context[depth];
        if(value.constructor !== Array) {
            var keys = this.precedenceMap[value];
            var n = keys.length;
            for(var j=0; j<n; j++) {
                if(cur[keys[j]] !== undefined) {
                    this._readNoMergeHelper(cur[keys[j]], depth+1, context, collector, subKey);
                }
            }
        } else {
            var seen = {};
            var i = value.length;
            while(i--) {
                keys = this.precedenceMap[value[i]];
                n = keys.length;
                for(j=0; j<n; j++) {
                    if(cur[keys[j]] !== undefined && seen[keys[j]] === undefined) {
                        this._readNoMergeHelper(cur[keys[j]], depth+1, context, collector, subKey);
                        seen[keys[j]] = true;
                    }
                }
            }
        }
    }
function ( cur , depth , context , collector , subKey ) { if ( depth === context . length ) { collector . push ( cur [ subKey ] ) ; return ; } var value = context [ depth ] ; if ( value . constructor !== Array ) { var keys = this . precedenceMap [ value ] ; var n = keys . length ; for ( var j = 0 ; j < n ; j ++ ) { if ( cur [ keys [ j ] ] !== undefined ) { this . _readNoMergeHelper ( cur [ keys [ j ] ] , depth + 1 , context , collector , subKey ) ; } } } else { var seen = { } ; var i = value . length ; while ( i -- ) { keys = this . precedenceMap [ value [ i ] ] ; n = keys . length ; for ( j = 0 ; j < n ; j ++ ) { if ( cur [ keys [ j ] ] !== undefined && seen [ keys [ j ] ] === undefined ) { this . _readNoMergeHelper ( cur [ keys [ j ] ] , depth + 1 , context , collector , subKey ) ; seen [ keys [ j ] ] = true ; } } } } }
Recurse through the tree collecting configs that apply to the given context.
@param cur {object} the current node.
@param depth {number} current depth in tree.
@param context {array} the context in internal format.
@param collector {array} the array we push configs to.
@param subKey {string} determines if substituted or non-substituted configs are used.
@private
Recurse through the tree collecting configs that apply to the given context .