Browse Source

Merge pull request #134 from lukeapage/master

Fix directories having '.'
better-aggressive
Rich Harris 10 years ago
parent
commit
10948957d8
  1. 4
      src/utils/path.js

4
src/utils/path.js

@ -35,12 +35,10 @@ export function relative ( from, to ) {
toParts.shift(); toParts.shift();
} }
while ( toParts[0] && toParts[0][0] === '.' ) { while ( toParts[0] === '.' || toParts[0] === '..' ) {
const toPart = toParts.shift(); const toPart = toParts.shift();
if ( toPart === '..' ) { if ( toPart === '..' ) {
fromParts.pop(); fromParts.pop();
} else if ( toPart !== '.' ) {
throw new Error( `Unexpected path part (${toPart})` );
} }
} }

Loading…
Cancel
Save