Skip to content

Conversation

@shaungrady
Copy link
Owner

Add three new methods for analyzing path relationships:

  • relativeTo(base): Extract relative path from a base path

    • Returns the segments needed to concat to base to get the full path
    • Returns null if path doesn't start with base
    • Inverse operation of concat()
  • commonStart(other): Find common prefix between two paths

    • Returns longest shared starting sequence
    • Returns empty path if no common prefix
  • commonEnd(other): Find common suffix between two paths

    • Returns longest shared ending sequence
    • Returns empty path if no common suffix

All methods:

  • Support wildcards and indices mode options
  • Propagate instance configuration
  • Include comprehensive test coverage (60 tests)
  • Include JSDoc documentation with examples
  • Added to README with usage examples

These methods enable powerful workflows like path decomposition,
finding shared parent paths, and extracting relative paths for display.

claude and others added 2 commits December 14, 2025 19:05
Add three new methods for analyzing path relationships:

- relativeTo(base): Extract relative path from a base path
  - Returns the segments needed to concat to base to get the full path
  - Returns null if path doesn't start with base
  - Inverse operation of concat()

- commonStart(other): Find common prefix between two paths
  - Returns longest shared starting sequence
  - Returns empty path if no common prefix

- commonEnd(other): Find common suffix between two paths
  - Returns longest shared ending sequence
  - Returns empty path if no common suffix

All methods:
- Support wildcards and indices mode options
- Propagate instance configuration
- Include comprehensive test coverage (60 tests)
- Include JSDoc documentation with examples
- Added to README with usage examples

These methods enable powerful workflows like path decomposition,
finding shared parent paths, and extracting relative paths for display.
@shaungrady shaungrady merged commit 0d998dd into main Dec 14, 2025
@shaungrady shaungrady deleted the claude/propose-new-features-59lU6 branch December 14, 2025 20:19
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.

3 participants