Merge
提出詳細
type Merge<F extends object, S extends object> = { [P in keyof F | keyof S]: P extends keyof S ? S[P]: P extends keyof F ? F[P] :never; };
提出日時 | 2022-06-27 23:25:04 |
---|---|
問題 | Merge |
ユーザー | waki285 |
ステータス | 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 }>>, ]