Merge

Medium
conditional types
union types
mapped types
keyof

Description:

Merge two types into a new type. Keys of the second type overrides keys of the first type.

For example

type foo = { name: string; age: string; } type bar = { age: number; sex: string } type Result = Merge<foo, bar> // expected to be // { // name: string, // age: number, sex: string // }

Code

Loading...