2026 05 13 package api amd repo polish fixes#7
Merged
Conversation
`tmplPrefix.covers(deeperConcrete)` returned true (a wildcard prefix covers any path under its domain) but `tmplPrefix.match(deeperConcrete)` returned null — the parent/child branch was gated off when wildcards were present, and patternMatches only handled whole-path matches. Unify the two: when one side has wildcards and matchesPrefix succeeds on the longer side against the wildcard-bearing side as the prefix, return covers / covered-by. This also subsumes the previous patternMatches-based whole-match check (matchesPrefix with wildcards in the prefix is strictly more general), so patternMatches is dropped. Literal parent/child remains gated on both sides being wildcard-free. Tests: - tmpl.each().match(concrete[0].name) → covers (was null) - tmpl.deep().match(deeper.path) → covers (was null) - all prior match() relations unchanged Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/impl/base-path-impl.ts">
<violation number="1" location="src/impl/base-path-impl.ts:70">
P2: `match()` now reports `covers`/`covered-by` even when both paths are wildcard templates. Guard these branches so they only apply when the opposite side is concrete.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
`(*).covers(**)` and `(a.*.x).covers(a.**.x)` previously returned true because `prefix[p] !== WILDCARD` short-circuited the equality check against `full[f] === DEEP_WILDCARD`, silently treating `**` as a single segment. `**` represents 0..N segments, so a single-segment element (literal or `*`) in the prefix cannot cover it. Propagated to `.match()` (reported `"covers"`/`"covered-by"`) and `.startsWith()` for the same shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 2.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary by cubic
Aligns
.match()with.covers()for wildcard prefix coverage and fixes*vs**prefix checks. Also adds a Google Search Console verification file.Bug Fixes
.match()now returns "covers" when a wildcard template prefixes a deeper concrete path, and "covered-by" in reverse.(*).covers(**)and(a.*.x).covers(a.**.x)now return false. Propagated to.match()and.startsWith().*vs**mismatches.Refactors
patternMatchesutility and unified logic on prefix checks plus wildcard detection.Written for commit 49b53f3. Summary will update on new commits.