diff --git a/index.js b/index.js index 61615f1..3e3a656 100644 --- a/index.js +++ b/index.js @@ -2,9 +2,10 @@ var path = require('path'); var isglob = require('is-glob'); +var pathDirname = require('path-dirname'); module.exports = function globParent(str) { str += 'a'; // preserves full path in case of trailing path separator - do {str = path.dirname(str)} while (isglob(str)); + do {str = pathDirname.posix(str)} while (isglob(str)); return str; }; diff --git a/package.json b/package.json index 86cfb24..bb750a6 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ }, "homepage": "https://github.com/es128/glob-parent", "dependencies": { - "is-glob": "^3.1.0" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" }, "devDependencies": { "coveralls": "^2.11.2",