Merge
提出詳細
type Merge<T extends Record<string, any>, U extends Record<string, any>> = { [K in keyof T | keyof U]: K extends keyof U ? U[K] : K extends keyof T ? T[K] : never }
提出日時 | 2023-05-08 09:35:17 |
---|---|
問題 | Merge |
ユーザー | Dowanna |
ステータス | Accepted |
import type { Equal, Expect } from '@type-challenges/utils' type Foo = { a: number b: string } type Bar = { b: number c: boolean } type cases = [ Expect<Equal<Merge<Foo, Bar>, { a: number b: number c: boolean }>>, ]