issue_tree
    Preparing search index...

    Function normalizeRepoUrl

    • Normalize one of several GitHub URL forms to the canonical owner/name slug, or null when the input is empty, non-GitHub, or unparseable.

      Accepts:

      • https://github.com/owner/name
      • https://github.com/owner/name.git
      • git@github.com:owner/name.git
      • git+https://github.com/owner/name.git
      • github.com/owner/name

      Strips a trailing .git, a git+ prefix, and any query string or fragment. Returns null for non-github.com hosts (gitlab, bitbucket, codeberg, etc.).

      Parameters

      • url: string

        the raw URL string from a manifest (whitespace tolerated)

      Returns string | null

      the canonical owner/name, or null when the URL is not a GitHub repo

      normalizeRepoUrl('git+https://github.com/StoneCypher/issue_tree.git')
      // => 'StoneCypher/issue_tree'
      normalizeRepoUrl('https://gitlab.com/x/y') // => null