Skip to content

Refactor reddit-adapter to remove duplicated isRedditPageUrl helper #10

@gdiab

Description

@gdiab

Context

Claude re-review on PR #8 flagged a minor duplication in src/adapters/reddit-adapter.ts.

Reference: #8 (comment)

Problem

isRedditPageUrl duplicates existing host-check logic that already exists in src/lib/reddit.ts via isRedditHost.

Proposed change

  • Remove the local isRedditPageUrl helper from src/adapters/reddit-adapter.ts.
  • Inline URL parsing + isRedditHost call at the usage site, or provide a shared URL-safe wrapper in src/lib/reddit.ts and reuse it.

Acceptance criteria

  • No duplicate host-check helper remains in reddit-adapter.ts.
  • Behavior stays the same for valid and invalid URL inputs.
  • Existing Reddit adapter tests continue to pass.

Priority

Minor / non-blocking follow-up from PR #8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions