refactor: rename URL validators to looksLikeRepoUrl

This commit is contained in:
statxc 2026-04-01 23:21:22 +00:00
parent 6a7830b07e
commit 9d89d74d70
5 changed files with 16 additions and 16 deletions

View file

@ -118,7 +118,7 @@ export function NewProjectDialog() {
const isAbsolutePath = (value: string) => value.startsWith("/") || /^[A-Za-z]:[\\/]/.test(value);
const isGitHubRepoUrl = (value: string) => {
const looksLikeRepoUrl = (value: string) => {
try {
const parsed = new URL(value);
if (parsed.protocol !== "https:") return false;
@ -155,7 +155,7 @@ export function NewProjectDialog() {
setWorkspaceError("Local folder must be a full absolute path.");
return;
}
if (repoUrl && !isGitHubRepoUrl(repoUrl)) {
if (repoUrl && !looksLikeRepoUrl(repoUrl)) {
setWorkspaceError("Repo must use a valid GitHub or GitHub Enterprise repo URL.");
return;
}