Skip to content

Pass strong-typed StoragePath instead of string to methods#87

Merged
pdeffendol merged 5 commits intomainfrom
strong-typing-paths
Sep 26, 2024
Merged

Pass strong-typed StoragePath instead of string to methods#87
pdeffendol merged 5 commits intomainfrom
strong-typing-paths

Conversation

@pdeffendol
Copy link
Copy Markdown
Contributor

@pdeffendol pdeffendol commented Sep 25, 2024

Description

This replaces the string parameter with StoragePath which has better typing and encapsulation. It shouldn't break existing usages because there are implicit string conversions.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Tests
  • 🤖 Build/CI
  • 📦 Chore (Version bump, release, etc.)
  • ⏩ Revert

Quality Checklist

  • I have added or updated automated tests as needed.
  • I have reviewed the code changes myself.
  • I have used commit messages that adequately explain my changes.
  • I have removed any extra logging, debugging code, and commented out code.
  • I have updated any related documentation (if necessary).

Instead of using a string type for storage paths, switch to a non-primitive type StoragePath.  This lets us encapsulate several of the operations needed for paths.

All storage operations now take a StoragePath parameter.  This can be converted to and from a string implicitly, so it's likely that existing code will work without modification, but for safety this should be a major version bump.

+semver:breaking
Renamed some test methods to standardize terminology
@pdeffendol pdeffendol changed the title WIP: Strong typing paths Pass strong-typed StoragePath instead of string to methods Sep 25, 2024
@pdeffendol pdeffendol requested a review from Devcon4 September 25, 2024 21:57
Fixed a couple missed ".WithoutLeadingSlash" uses on the Rename methods
@pdeffendol pdeffendol merged commit e928f36 into main Sep 26, 2024
@pdeffendol pdeffendol deleted the strong-typing-paths branch September 26, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants