Comparing version 0.0.0 to 0.0.1
@@ -19,3 +19,3 @@ var path = require('path'); | ||
return path.normalize(cwd) | ||
var res = path.normalize(cwd) | ||
.split(sep) | ||
@@ -28,2 +28,4 @@ .reduce(function (acc,dir,ix) { | ||
; | ||
if (res[0] === res[1]) return [ res[0] ]; | ||
return res; | ||
} |
{ | ||
"name" : "parents", | ||
"version" : "0.0.0", | ||
"version" : "0.0.1", | ||
"description" : "return all the parent directories for a directory", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
@@ -15,1 +15,7 @@ var test = require('tap').test; | ||
}); | ||
test('root', function (t) { | ||
var dirs = parents('/'); | ||
t.same(dirs, [ '/' ]); | ||
t.end(); | ||
}); |
@@ -16,1 +16,7 @@ var test = require('tap').test; | ||
}); | ||
test('win32 c:', function (t) { | ||
var dirs = parents('C:\\', { platform : 'win32' }); | ||
t.same(dirs, [ 'C:' ]); | ||
t.end(); | ||
}); |
5580
69