UNPKG

lean4-code-actions

Version:

Refactorings and snippets for Lean 4

15 lines (13 loc) 292 B
import { fromStringToId } from '../Id' import { Url } from '../Url' /** * @deprecated */ export function getIdFromUrl(url: Url) { const $url = new URL(url) const parts = [ ...$url.hostname.split('.'), ...$url.pathname.split('/'), ] return fromStringToId(parts.join('_')) }