This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / src / lib / components / repo / urls.ts
530 B 13 lines
1import { resolve } from "$app/paths"; 2 3// rest params arrive decoded, re-encode per segment or `#`/`?`/`%` corrupt 4// the url 5export const encodePathSegments = (path: string): string => 6 path.split("/").map(encodeURIComponent).join("/"); 7 8export const baseName = (path: string): string => path.split("/").pop() ?? path; 9 10export const rawBlobHref = (ownerHandle: string, repoName: string, ref: string, path: string) => 11 resolve( 12 `/${ownerHandle}/${repoName}/raw/${encodeURIComponent(ref)}/${encodePathSegments(path)}` as "/" 13 );