Skip to content

Commit bab4580

Browse files
committed
Remove 1-line dirname dependency
1 parent 01981d1 commit bab4580

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

functions/filesystem/pathinfo.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function pathinfo(path, options) {
1313
// % note 2: But by way we implemented this function, if you want you can still declare the PATHINFO_*
1414
// % note 2: yourself, and then you can use: pathinfo('/www/index.html', PATHINFO_BASENAME | PATHINFO_EXTENSION);
1515
// % note 2: which makes it fully compliant with PHP syntax.
16-
// - depends on: dirname
1716
// - depends on: basename
1817
// * example 1: pathinfo('/www/htdocs/index.html', 1);
1918
// * returns 1: '/www/htdocs'
@@ -82,7 +81,7 @@ function pathinfo(path, options) {
8281

8382
// Gather path infos
8483
if (options & OPTS.PATHINFO_DIRNAME) {
85-
var dirName = this.dirname(path);
84+
var dirName = path.replace(/\\/g, '/').replace(/\/[^\/]*\/?$/, ''); // dirname
8685
tmp_arr.dirname = dirName === path ? '.' : dirName;
8786
}
8887

0 commit comments

Comments
 (0)