VulnCheck.Workspace.GitUrl (VulnCheck v1.0.1)

Copy Markdown View Source

Normalizes Git dependency URLs into canonical owner/repo slugs without creating atoms.

Summary

Functions

Extracts a lowercased "owner/repo" slug from HTTPS, SSH, git:// or owner/repo strings. Returns :error for unrecognized or local URLs.

Returns the normalized owner/repo slug or nil.

Functions

normalize_repo(url)

@spec normalize_repo(String.t() | nil) :: {:ok, String.t()} | :error

Extracts a lowercased "owner/repo" slug from HTTPS, SSH, git:// or owner/repo strings. Returns :error for unrecognized or local URLs.

repo_slug(url)

@spec repo_slug(String.t() | nil) :: String.t() | nil

Returns the normalized owner/repo slug or nil.