Skip to content

Commit 9caca07

Browse files
committed
fixes #20
1 parent 766bcb0 commit 9caca07

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/parse.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ parse.fastpaths = (input, options) => {
959959
}
960960

961961
const globstar = (opts) => {
962+
if (opts.noglobstar === true) return star;
962963
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
963964
};
964965

test/options.noglobstar.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
require('mocha');
4+
const assert = require('assert').strict;
5+
const { isMatch } = require('..');
6+
7+
describe('options.noglobstar', () => {
8+
it('should disable extglob support when options.noglobstar is true', () => {
9+
assert(isMatch('a/b/c', '**', { noglobstar: false }));
10+
assert(!isMatch('a/b/c', '**', { noglobstar: true }));
11+
assert(isMatch('a/b/c', 'a/**', { noglobstar: false }));
12+
assert(!isMatch('a/b/c', 'a/**', { noglobstar: true }));
13+
});
14+
});

0 commit comments

Comments
 (0)