Skip to content

Commit

Permalink
docs(readme): link to src for ts not having xor operator
Browse files Browse the repository at this point in the history
  • Loading branch information
maninak committed Feb 11, 2023
1 parent a4509cb commit b3138ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Typescript's union operator (`|`) allows combining two object types `A` and `B`,

But sometimes the requirements dictate that we combine two types with mutually exclusive members. So take the members `A.a` and `B.b`. Given `type C = A | B` then we want to impose the restriction that we can set _either_ `C.a` _or_ `C.b` _but never both_ AND _always at least one of the two_!

Typescript does not have this feature built-in.
[Typescript does not have this feature built-in.](https://github.com/Microsoft/TypeScript/issues/14094)

The package `ts-xor` introduces the new custom type `XOR`. You can use XOR to compose your own custom types with mutually exclusive members.

Expand Down

0 comments on commit b3138ad

Please sign in to comment.