madeye/pi-jev on GitHub
- Stars
- 11
- Forks
- 4
- Language
- TypeScript
- License
- MIT
- Last push
- 21 Sep 2026
Read from GitHub on . Counts change daily.
How it uses Jev
const defaultOrigin = "https://api.typesafe.ai/";
/** Normalised origin of a Jev-compatible server; `undefined` unless the URL is http(s). */
export function jevOrigin(url?: string): string | undefined {
if (!url) return undefined;
try {
const parsed = new URL(url);
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return undefined;
return `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}/`;
} catch {
return undefined;
}
}
export type Question =
