ts-essentials / ts-essentials

All essential TypeScript types in one place 🤙

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

One Parameter Exact

xenoterracide opened this issue · comments

I find myself writing Exact like this a lot

Exact<StorefrontMenuProductOptions, StorefrontMenuProductOptions>

would it be possible to change the signature to be something like

type Exact<A, B=A>

So instead I could just write

Exact<StorefrontMenuProductOptions>

Hello @xenoterracide!

Can you please explain why you need it like that? Can you have one or two examples?

Otherwise I would just use:

- Exact<StorefrontMenuProductOptions, StorefrontMenuProductOptions>
+ StorefrontMenuProductOptions

yeah that might be fine, I seem to recall being able to have objects that have fields that I wasn't wanting and pass them to things like this, but then I tried it and couldn't reproduce.