Skip to content

Commit a98874f

Browse files
mrmlncphated
authored andcommitted
fix: unescape exclamation mark (#26)
1 parent 4aad91d commit a98874f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var slash = '/';
88
var backslash = /\\/g;
99
var enclosure = /[\{\[].*[\/]*.*[\}\]]$/;
1010
var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
11-
var escaped = /\\([\*\?\|\[\]\(\)\{\}])/g;
11+
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
1212

1313
/**
1414
* @param {string} str

Diff for: test/index.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ describe('glob-parent', function() {
7878
assert.equal(gp('[bar]/'), '.');
7979
assert.equal(gp('./\\[bar]'), './[bar]');
8080
assert.equal(gp('\\[bar]/'), '[bar]');
81+
assert.equal(gp('\\!dir/*'), '!dir');
8182
assert.equal(gp('[bar\\]/'), '.');
8283
assert.equal(gp('path/foo \\[bar]/'), 'path/foo [bar]');
8384
assert.equal(gp('path/\\{foo,bar}/'), 'path/{foo,bar}');

0 commit comments

Comments
 (0)