mirror of
https://github.com/earendil-works/pi.git
synced 2026-06-18 15:54:04 +08:00
7 lines
268 B
TypeScript
7 lines
268 B
TypeScript
const GIT_HOSTS = ["github.com", "gitlab.com", "bitbucket.org", "codeberg.org"];
|
|
|
|
export function looksLikeGitUrl(source: string): boolean {
|
|
const normalized = source.replace(/^https?:\/\//, "");
|
|
return GIT_HOSTS.some((host) => normalized.startsWith(`${host}/`));
|
|
}
|