Skip to content

Commit 2a551dd

Browse files
committed
feat!: question marks are valid path characters on Windows so avoid flagging as a glob when alone
1 parent e41fcd8 commit 2a551dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Takes a string and returns the part of the path before the glob begins. Be aware
4444

4545
The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:
4646

47-
- `?` (question mark)
47+
- `?` (question mark) unless used as a path segment alone
4848
- `*` (asterisk)
4949
- `|` (pipe)
5050
- `(` (opening parenthesis)

test/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ describe('glob-parent', function() {
4747
assert.equal(gp('path/*(to|from)'), 'path');
4848
assert.equal(gp('path/@(to|from)'), 'path');
4949
assert.equal(gp('path/!/foo'), 'path/!');
50-
assert.equal(gp('path/?/foo'), 'path', 'qmarks must be escaped');
50+
assert.equal(gp('path/?/foo'), 'path/?');
5151
assert.equal(gp('path/+/foo'), 'path/+');
5252
assert.equal(gp('path/*/foo'), 'path');
5353
assert.equal(gp('path/@/foo'), 'path/@');
5454
assert.equal(gp('path/!/foo/'), 'path/!/foo');
55-
assert.equal(gp('path/?/foo/'), 'path', 'qmarks must be escaped');
55+
assert.equal(gp('path/?/foo/'), 'path/?/foo');
5656
assert.equal(gp('path/+/foo/'), 'path/+/foo');
5757
assert.equal(gp('path/*/foo/'), 'path');
5858
assert.equal(gp('path/@/foo/'), 'path/@/foo');

0 commit comments

Comments
 (0)