Skip to content

Commit

Permalink
feat!: question marks are valid path characters on Windows so avoid f…
Browse files Browse the repository at this point in the history
…lagging as a glob when alone
  • Loading branch information
phated committed Jan 27, 2021
1 parent e41fcd8 commit 2a551dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Takes a string and returns the part of the path before the glob begins. Be aware

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

- `?` (question mark)
- `?` (question mark) unless used as a path segment alone
- `*` (asterisk)
- `|` (pipe)
- `(` (opening parenthesis)
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ describe('glob-parent', function() {
assert.equal(gp('path/*(to|from)'), 'path');
assert.equal(gp('path/@(to|from)'), 'path');
assert.equal(gp('path/!/foo'), 'path/!');
assert.equal(gp('path/?/foo'), 'path', 'qmarks must be escaped');
assert.equal(gp('path/?/foo'), 'path/?');
assert.equal(gp('path/+/foo'), 'path/+');
assert.equal(gp('path/*/foo'), 'path');
assert.equal(gp('path/@/foo'), 'path/@');
assert.equal(gp('path/!/foo/'), 'path/!/foo');
assert.equal(gp('path/?/foo/'), 'path', 'qmarks must be escaped');
assert.equal(gp('path/?/foo/'), 'path/?/foo');
assert.equal(gp('path/+/foo/'), 'path/+/foo');
assert.equal(gp('path/*/foo/'), 'path');
assert.equal(gp('path/@/foo/'), 'path/@/foo');
Expand Down

0 comments on commit 2a551dd

Please sign in to comment.