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

@ -984,7 +984,7 @@ async function readUrlSkillImports(
): Promise<{ skills: ImportedSkill[]; warnings: string[] }> {
const url = sourceUrl.trim();
const warnings: string[] = [];
const isGitHubRepoUrl = (() => { try {
const looksLikeRepoUrl = (() => { try {
const parsed = new URL(url);
if (parsed.protocol !== "https:") return false;
const h = parsed.hostname.toLowerCase();
@ -992,7 +992,7 @@ async function readUrlSkillImports(
const segments = parsed.pathname.split("/").filter(Boolean);
return segments.length >= 2 && !parsed.pathname.endsWith(".md");
} catch { return false; } })();
if (isGitHubRepoUrl) {
if (looksLikeRepoUrl) {
const parsed = parseGitHubSourceUrl(url);
const apiBase = gitHubApiBase(parsed.hostname);
const { pinnedRef, trackingRef } = await resolveGitHubPinnedRef(parsed);