From db4298df4bae882100b33aae6526759e1e004e35 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Wed, 23 Sep 2015 16:08:41 +0100 Subject: [PATCH] Fix directories having '.' Fixes #133 --- src/utils/path.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils/path.js b/src/utils/path.js index 4f55ba8..1ea179f 100644 --- a/src/utils/path.js +++ b/src/utils/path.js @@ -35,12 +35,10 @@ export function relative ( from, to ) { toParts.shift(); } - while ( toParts[0] && toParts[0][0] === '.' ) { + while ( toParts[0] === '.' || toParts[0] === '..' ) { const toPart = toParts.shift(); if ( toPart === '..' ) { fromParts.pop(); - } else if ( toPart !== '.' ) { - throw new Error( `Unexpected path part (${toPart})` ); } }