Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tom-sherman/e5701906133d64f9324e1f72db05e137 to your computer and use it in GitHub Desktop.
Save tom-sherman/e5701906133d64f9324e1f72db05e137 to your computer and use it in GitHub Desktop.
type RouteParams<string> = Record<string, string>;
type RouteParams<`${infer Start}:${infer Param}/${infer Rest}`> = {[k in Param | keyof RouteParams<Rest>]: string};
type RouteParams<`${infer Start}:${infer Param}`> = {[k in Param]: string};
type RouteParams<unknown> = {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment