Append Argument to Object

Medium
union types
conditional types
keyof
mapped types

Description:

Implement a type that adds a new field to the interface. The type takes the three arguments. The output should be an object with the new field.

For example

type Object1 = { id: '1' } type Result = AppendToObject<Object1, 'value', boolean> // expected to be { id: '1', value: boolean }

Code

Loading...