parse: honor noglobstar on the leading **/ fast path - #205
Open
lenamonj wants to merge 1 commit into
Open
Conversation
The fast-path cases for `**/*` and friends wrap the leading `**/` in an optional group regardless of `noglobstar`, so `**/*` matched a single-segment path that `*/*` rejects under the same option. Skip the fast path for a leading `**/` when noglobstar is set and let the full parser build it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lenamonj
force-pushed
the
fix-noglobstar-fastpath
branch
from
September 1, 2026 23:42
58cd2a4 to
7267d5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
{ noglobstar: true },isMatch('a', '**/*')istruewhileisMatch('a', '*/*')isfalse;'**/*.js'matchesx.jsthe same way.noglobstaris documented as disabling**, so a leading**/should be one required segment.Cause: the fast-path
create()cases for**/*,**/*.jsand**/.*wrap the leading**/in(?:...)?whatever the option says. The**case alone was fixed for #20; the prefixed forms were not.Change: skip the fast path for a leading
**/whennoglobstaris set, so the full parser builds it (as it already does for**next to a literal extension). Four lines, plus a test.Verified:
npm test1999 passing (the new test fails onmaster).Found by an automated code-review loop I run; the fix and this description were prepared with Claude and verified by hand.