Type Challenges Judge

Mutable

提出詳細

type Mutable<T> = { -readonly [K in keyof T]: T[K]; };
提出日時2023-06-04 04:06:51
問題Mutable
ユーザーmrsekut
ステータスWrong Answer
テストケース
import type { Equal, Expect } from '@type-challenges/utils' interface Todo1 { title: string description: string completed: boolean meta: { author: string } } type List = [1, 2, 3] type cases = [ Expect<Equal<Mutable<Readonly<Todo1>>, Todo1>>, Expect<Equal<Mutable<Readonly<List>>, List>>, ] type errors = [ // @ts-expect-error Mutable<'string'>, // @ts-expect-error Mutable<0>, ]