https://github.com/peterboyer/intersect
Intersect union types.
https://github.com/peterboyer/intersect
typescript
Last synced: about 1 year ago
JSON representation
Intersect union types.
- Host: GitHub
- URL: https://github.com/peterboyer/intersect
- Owner: peterboyer
- License: mit
- Created: 2024-11-08T23:41:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T00:13:40.000Z (over 1 year ago)
- Last Synced: 2024-12-10T20:49:42.016Z (over 1 year ago)
- Topics: typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/pb.intersect
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# intersect
## Installation
```shell
npm install pb.intersect
```
## Requirements
- `typescript@>=5.0.0`
- `tsconfig.json > "compilerOptions" > { "strict": true }`
# API
- [`Intersect`](#intersectt)
### `Intersect`
```ts
import type { Intersect } from "pb.intersect";
type Example = { A: true } | { B: true } | { C: true };
type Result = Intersect;
// ^ { A: true } & { B: true } & { C: true }
// ^ { A: true; B: true; C: true }
```