For the following script,
import picomatch from 'picomatch';
console.log('# glob="/foo/(a)", target="/foo/a"');
console.log(
'without extglob (expected: false)',
picomatch('/foo/(a)', { noextglob: true })('/foo/a')
);
console.log(
'with extglob (expected: false)',
picomatch('/foo/(a)', { noextglob: false })('/foo/a')
);
console.log();
console.log('# glob="/foo/(a)?", target="/foo/a"');
console.log(
'without extglob (expected: false)',
picomatch('/foo/(a)?', { noextglob: true })('/foo/a')
);
console.log(
'with extglob (expected: false)',
picomatch('/foo/(a)?', { noextglob: false })('/foo/a')
);
console.log();
I get the following output:
# glob="/foo/(a)", target="/foo/a"
without extglob (expected: false) true
with extglob (expected: false) true
# glob="/foo/(a)?", target="/foo/a"
without extglob (expected: false) true
with extglob (expected: false) true
All returns true but I think they should return false because ( and ) doesn't have a special meaning (without prefixes like ? for extglobs).
(stackblitz)
I also tested with bash 5.2.21 and it had the behavior I expected.
For the following script,
I get the following output:
All returns
truebut I think they should returnfalsebecause(and)doesn't have a special meaning (without prefixes like?for extglobs).(stackblitz)
I also tested with bash 5.2.21 and it had the behavior I expected.