Versions
- Open: Version+13-0export function extractValInfo(url: string | URL) {const { pathname, search } = new URL(url);const [author, filename] = pathname.split("/").slice(-2);const [name] = filename.split(".");const version = new URLSearchParams(search).get("v");const slug = `${author}/${name}`;const htmlUrl = `https://val.town/v/${author}/${name}`;const rawUrl = `https://esm.town/v/${author}/${name}`;const embedUrl = `https://val.town/embed/${author}/${name}`;const httpEndpoint = `https://${author}-${name}.web.val.run`;return { author, name, version, slug, htmlUrl, rawUrl, httpEndpoint, embedUrl };}
Updated: November 4, 2024