Merge
提出詳細
type Merge< F extends Record<string, unknown>, S extends Record<string, unknown>, > = { [K in keyof F | keyof S]: K extends keyof S ? S[K] : K extends keyof F ? F[K] : never; };
提出日時 | 2023-06-01 03:38:14 |
---|---|
問題 | Merge |
ユーザー | mrsekut |
ステータス | 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 }>>, ]