Skip to content

refactor: move URL normalization to shared package #14

@rianjs

Description

@rianjs

Summary

Move URL normalization logic to the shared package to eliminate duplication across both tools.

Current State

URL normalization is implemented in 3 places:

  • tools/jtk/internal/config/config.go - NormalizeURL() (lines 137-147)
  • tools/jtk/api/client.go - hasScheme(), trimTrailingSlash() (lines 70-80)
  • tools/cfl/internal/config/config.go - NormalizeURL() (lines 44-50)

Proposed Changes

  1. Create shared/url/url.go with NormalizeURL() function
  2. Update both tools to import from shared
  3. Remove duplicate implementations

Impact

~30 lines removed, 3 files changed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions