Skip to content

Commit

Permalink
feat: use path-dirname ponyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 authored and phated committed Jan 27, 2021
1 parent 65249f9 commit cdbea5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cdbea5f

Please sign in to comment.