Skip to content

Commit

Permalink
getParam helper
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 2, 2024
1 parent 70d7ca9 commit 6950e1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ export function path<Subpaths extends Record<string, Path>>(
}
return path
}

export function getParam(path: Path, key: string) {
return (path.__ as Parameters)[key]
}

0 comments on commit 6950e1e

Please sign in to comment.