-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add polyfills for Path.EndsInDirectorySeparator(...) and Path.TrimEndingDirectorySeparator(...)
#39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…EndingDirectorySeparator(...)`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds polyfills for Path.EndsInDirectorySeparator and Path.TrimEndingDirectorySeparator methods from .NET Core 3.0, making them available for earlier framework versions. Additionally, it includes refactoring improvements to existing code.
- Implements
Path.EndsInDirectorySeparatorto check if a path ends with a directory separator - Implements
Path.TrimEndingDirectorySeparatorto remove trailing directory separators from paths - Refactors
Stream.ReadAtLeastandStream.ReadAtLeastAsyncto use the range operator instead ofSlicemethod
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| PolyShim/NetCore30/Path.cs | Adds polyfill implementations for EndsInDirectorySeparator and TrimEndingDirectorySeparator with conditional compilation for different .NET Standard versions |
| PolyShim/NetCore10/RuntimeInformation.cs | Moves preprocessor directive to only wrap the IsOSPlatform method, allowing the class to be defined even when platform detection is unavailable |
| PolyShim/Net70/Stream.cs | Refactors buffer slicing to use idiomatic range operator syntax ([totalBytesRead..]) instead of .Slice() method |
| PolyShim.Tests/NetCore30/PathTests.cs | Adds comprehensive test coverage for the new Path polyfill methods including various path formats and edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.