{"id":22618775,"url":"https://github.com/alloc/option-types","last_synced_at":"2026-03-17T18:36:07.845Z","repository":{"id":263476679,"uuid":"890521714","full_name":"alloc/option-types","owner":"alloc","description":"Utility types for options-related TypeScript definitions","archived":false,"fork":false,"pushed_at":"2024-11-26T17:51:00.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T03:55:00.137Z","etag":null,"topics":["typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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,"zenodo":null}},"created_at":"2024-11-18T18:00:10.000Z","updated_at":"2025-01-10T21:30:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"989b3684-3904-41c2-9938-29864441e3fa","html_url":"https://github.com/alloc/option-types","commit_stats":null,"previous_names":["alloc/option-types"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alloc/option-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Foption-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Foption-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Foption-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Foption-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/option-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Foption-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30628418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["typescript"],"created_at":"2024-12-08T21:09:33.487Z","updated_at":"2026-03-17T18:36:07.838Z","avatar_url":"https://github.com/alloc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# option-types\n\nUtility types for options-related TypeScript definitions.\n\nThis package doesn't have any runtime code. It only contains types.\n\n### Motivation\n\nUsing [`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes) in TypeScript is great, except when you have a big object type with many optional properties. Manually adding `undefined` to every optional property type is annoying and error-prone.\n\nUsing conditional types and mapped types, we can automatically add `undefined` to every optional property type.\n\n## Types\n\n### `Option\u003cT\u003e`\n\nAny type wrapped in `Option` can be assigned an `undefined` value. If the wrapped type is an object, its optional properties can also be assigned an `undefined` value. This type is recursive.\n\n### `Options\u003cT\u003e`\n\nWhen an object type is itself required, but it contains optional properties, this type can be used to ensure that the optional properties can be assigned an `undefined` value. This type is recursive, so nested object types are also affected.\n\n### `OptionalKeys\u003cT\u003e`\n\nExtract the keys of an object type that are optional. Note that a key is only considered “optional” if it was defined with a `?` in the type definition.\n\n### `ShallowOptions\u003cT\u003e`\n\nEnsure each optional property can be assigned an `undefined` value. Nested object types are not affected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Foption-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Foption-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Foption-types/lists"}