Repository navigation
Conversation
`resolve()` collapsed the leading `//` of a UNC path (e.g. `\\server\share`) down to a single `/` because `normalizeString` merges consecutive slashes. `normalize()` already re-applied the UNC prefix; mirror that in `resolve()` so both agree and match `path.win32.resolve`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesUNC path resolution fix
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pi0
approved these changes
Jul 8, 2026
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.
Fixes #245
Problem
resolve()collapsed the leading//of a Windows UNC path down to a single/, breaking network paths:normalizeString()merges consecutive slashes, so the UNC//prefix was lost.normalize()already re-applied the prefix via itsisUNCPathbranch, butresolve()had no equivalent — so the two disagreed.Fix
Track whether the terminating (base) segment is a UNC path and re-apply the
//prefix after normalization inresolve(), mirroringnormalize(). The flag is tested against the source segment rather than the concatenatedresolvedPath, which can spuriously start with//when joining a/root (e.g.resolve("/", "file.txt")).Per pathe's forward-slash convention, UNC paths are represented as
//server/share/...(matching the existingnormalize()output andpath.win32.resolve's slash count), not Node's back-slash form.Tests
Added UNC cases to the
resolvesuite:Full suite passes; lint / format / typecheck clean.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
..and nested subpaths.Tests