lib/kissy/seed.js
function normalizeArray(parts, allowAboveRoot) {
        // level above root
        var up = 0,
            i = parts.length - 1,
        // splice costs a lot in ie
        // use new array instead
            newParts = [],
            last;

        for (; i >= 0; i--) {
            last = parts[i];
            if (last !== '.') {
                if (last === '..') {
                    up++;
                } else if (up) {
                    up--;
                } else {
                    newParts[newParts.length] = last;
                }
            }
        }

        // if allow above root, has to add ..
        if (allowAboveRoot) {
            for (; up--; up) {
                newParts[newParts.length] = '..';
            }
        }

        newParts = newParts.reverse();

        return newParts;
    }
function normalizeArray(parts, allowAboveRoot) {
        // level above root
        var up = 0,
            i = parts.length - 1,
        // splice costs a lot in ie
        // use new array instead
            newParts = [],
            last;

        for (; i >= 0; i--) {
            last = parts[i];
            if (last !== '.') {
                if (last === '..') {
                    up++;
                } else if (up) {
                    up--;
                } else {
                    newParts[newParts.length] = last;
                }
            }
        }

        // if allow above root, has to add ..
        if (allowAboveRoot) {
            for (; up--; up) {
                newParts[newParts.length] = '..';
            }
        }

        newParts = newParts.reverse();

        return newParts;
    }
function normalizeArray ( parts , allowAboveRoot ) { // level above root var up = 0 , i = parts . length - 1 , // splice costs a lot in ie // use new array instead newParts = [ ] , last ; for ( ; i >= 0 ; i -- ) { last = parts [ i ] ; if ( last !== '.' ) { if ( last === '..' ) { up ++ ; } else if ( up ) { up -- ; } else { newParts [ newParts . length ] = last ; } } } // if allow above root, has to add .. if ( allowAboveRoot ) { for ( ; up -- ; up ) { newParts [ newParts . length ] = '..' ; } } newParts = newParts . reverse ( ) ; return newParts ; }
Remove .. and . in path array
Remove .. and . in path array