Skip to content

Commit 32d5783

Browse files
committed
add question mark character to strictRegex
1 parent 1eda787 commit 32d5783

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
var isExtglob = require('is-extglob');
99
var chars = { '{': '}', '(': ')', '[': ']'};
10-
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
10+
var strictRegex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
1111
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
1212

1313
module.exports = function isGlob(str, options) {

test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ describe('isGlob', function() {
1919
assert(isGlob('!*.js'));
2020
assert(isGlob('!foo'));
2121
assert(isGlob('!foo.js'));
22+
assert(isGlob('foo?'));
23+
assert(isGlob('foo?.js'));
24+
assert(isGlob('bar?/foo.js'));
25+
assert(isGlob('bar?/foo?.js'));
2226
assert(isGlob('**/abc.js'));
2327
assert(isGlob('abc/*.js'));
2428
assert(isGlob('@.(?:abc)'));

0 commit comments

Comments
 (0)