This commit is contained in:
zekro committed 2026-07-17 10:28:20 +02:00
1 parent c367d3f3ca
commit 2bc148342d
3 files changed
+39 -18

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
type ParseUrlParams<Url> = Url extends `${infer Start}/${infer Rest}`
? ParseUrlParams<Start> & ParseUrlParams<Rest>
: Url extends `{${infer Param}}`
? { [P in Param]: string }
: {};
function navigate<P extends string>(path: P, params: ParseUrlParams<P>) {
// ...
}
function main() {
navigate("/foo/bar", { foo: "asd" });
}