We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2a91d1 commit 8cfb0baCopy full SHA for 8cfb0ba
index.js
@@ -5,11 +5,12 @@ var isglob = require('is-glob');
5
var pathDirname = require('path-dirname');
6
7
module.exports = function globParent(str) {
8
- // preserves full path in case of trailing path separator
9
- str += 'a';
10
-
11
// replace braces/brackets sections with *
12
str = str.replace(/(^|[^\\])(\{([^{}]*?)}|\[([^\[\]]*?)\])/g, '$1*');
+ if (/[\}\}]$/.test(str)) str += '/';
+
+ // preserves full path in case of trailing path separator
13
+ str += 'a';
14
15
// remove path parts that are globby
16
do {str = pathDirname.posix(str)} while (isglob(str));
0 commit comments