#is there a way to merge an object association "&" ?

9 messages · Page 1 of 1 (latest)

regal jay
#

For example: make { foo: string, bar: string } out of { foo: string } & { bar: string}

tired holly
#

it already is like that

#

they're equivalent

regal jay
#

I made a type with a generic for each property to merge them for now.

#

They are equivalent most of the time but in my case, the type gets transformed and mapped on and didn't work with &

#

but it did work when it was merged

#

so they are not 100% identical in how they function and interact with mapping etc

tired holly
#

how didn't it work?

#

because yeah those 2 are equivalent