{"id":19904358,"url":"https://github.com/alloc/path-types","last_synced_at":"2025-05-03T00:31:36.797Z","repository":{"id":257809611,"uuid":"867710920","full_name":"alloc/path-types","owner":"alloc","description":"TypeScript utility types for URL pathnames","archived":true,"fork":false,"pushed_at":"2024-10-09T18:05:55.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T03:37:21.462Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alloc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-04T15:14:22.000Z","updated_at":"2024-11-11T17:00:58.000Z","dependencies_parsed_at":"2024-11-12T20:40:58.815Z","dependency_job_id":null,"html_url":"https://github.com/alloc/path-types","commit_stats":null,"previous_names":["alloc/path-types"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fpath-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fpath-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fpath-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fpath-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/path-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252126559,"owners_count":21698964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T20:28:04.537Z","updated_at":"2025-05-03T00:31:36.099Z","avatar_url":"https://github.com/alloc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @alloc/path-types\n\nA simple package for type-level manipulation of route paths (i.e. `/foo/:bar`)\n\n## Usage\n\nThe two types included are `InferParams` and `PathTemplate`.\n\nThe `InferParams` type expects a route path string literal. It tells the type checker how to parse route paths in order to extract “route parameter names” (the `:bar` part in `/foo/:bar`) from them. It returns an object type whose keys are the route parameters. By default, the property values are a `string` type, but this can be customized with the 2nd type parameter.\n\n```ts\ntype Params = InferParams\u003c'/foo/:bar'\u003e\n// =\u003e { bar: string }\n```\n\nThe `PathTemplate` type also expects a route path string literal. It returns a template string type where the route parameters are replaced with `${string}`, so the type is useful for pathname construction.\n\n```ts\ntype Pathname = PathTemplate\u003c'/foo/:bar'\u003e\n// =\u003e `/foo/${string}`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fpath-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Fpath-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fpath-types/lists"}