{"id":29413754,"url":"https://github.com/peterboyer/pb.types","last_synced_at":"2026-03-06T12:31:33.208Z","repository":{"id":261877927,"uuid":"883129815","full_name":"peterboyer/pb.types","owner":"peterboyer","description":"Utility types like Equal, Intersect, Identity and more.","archived":false,"fork":false,"pushed_at":"2025-09-17T22:45:35.000Z","size":89,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T05:56:11.717Z","etag":null,"topics":["typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/pb.types","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterboyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-04T12:34:03.000Z","updated_at":"2025-09-17T22:45:56.000Z","dependencies_parsed_at":"2024-11-09T00:28:49.911Z","dependency_job_id":"673a9c59-e76a-49a5-b271-87064dadcd13","html_url":"https://github.com/peterboyer/pb.types","commit_stats":null,"previous_names":["peterboyer/expectequal","peterboyer/pb.expectequal"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/peterboyer/pb.types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterboyer%2Fpb.types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterboyer%2Fpb.types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterboyer%2Fpb.types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterboyer%2Fpb.types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterboyer","download_url":"https://codeload.github.com/peterboyer/pb.types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterboyer%2Fpb.types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30176157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":"2025-07-11T11:37:35.283Z","updated_at":"2026-03-06T12:31:33.194Z","avatar_url":"https://github.com/peterboyer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pb.types\n\n\u003e [!NOTE]\n\u003e Renamed from `pb.expectequal`.\n\u003e\n\u003e Combines [`pb.expectequal`](https://github.com/peterboyer/pb.expectequal),\n[`pb.intersect`](https://github.com/peterboyer/pb.intersect), and\n[`pb.identity`](https://github.com/peterboyer/pb.identity) into a single\n[`pb.types`](https://github.com/peterboyer/pb.types) package.\n\n## Installation\n\n```shell\nnpm install pb.types\n```\n\n## Requirements\n\n- `typescript@\u003e=5.0.0`\n- `tsconfig.json \u003e \"compilerOptions\" \u003e { \"strict\": true }`\n\n## API\n\n- More information available as jsdoc strings in linked source files below.\n\n### `Expect,Equal,NotEqual`\n\n- [`Expect`](./src/expect.ts)\n- [`Equal`](./src/equal.ts)\n- [`NotEqual`](./src/not-equal.ts)\n\n\n```ts\nimport type { Expect, Equal, NotEqual } from \"pb.types\";\n\nconst result = JSON.stringify({});\n\n!0 as Expect\u003cEqual\u003ctypeof result, string\u003e\u003e;\n!0 as Expect\u003cNotEqual\u003ctypeof result, number\u003e\u003e;\n```\n\n\n### `Intersect`\n\n- [`Intersect`](./src/intersect.ts)\n\n\n```ts\nimport type { Intersect } from \"pb.types\";\n\ntype Example = { A: true } | { B: true } | { C: true };\ntype Result = Intersect\u003cExample\u003e;\n//   ^ { A: true } \u0026 { B: true } \u0026 { C: true }\n//   ^ { A: true; B: true; C: true }\n```\n\n\n### `Identity`\n\n- [`Identity`](./src/identity.ts)\n\n\n```ts\nimport type { Identity } from \"pb.types\";\n\nconst value = Object.assign({ A: true }, { B: true });\n//    ^ { A: boolean } \u0026 { B: boolean }\ntype _Result = Identity\u003ctypeof value\u003e;\n//   ^ { A: boolean; B: boolean }\n```\n\n\n### `branch`\n\n- [`branch`](./src/branch.ts)\n\n\n```ts\nimport { branch } from \"pb.types\";\n\nvoid function example(): string | number | undefined {\n  if (branch()) {\n    return \"abc\";\n  }\n\n  if (branch()) {\n    return 12345;\n  }\n\n  return undefined;\n};\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterboyer%2Fpb.types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterboyer%2Fpb.types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterboyer%2Fpb.types/lists"}