Readonly
提出詳細
/* _____________ Your Code Here _____________ */ type MyReadonly<T> = { readonly[k in keyof T]: T[k] } /* _____________ Test Cases _____________ */ import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<MyReadonly<Todo1>, Readonly<Todo1>>>, ] interface Todo1 { title: string description: string completed: boolean meta: { author: string } }
提出日時 | 2025-03-06 11:56:37 |
---|---|
問題 | Readonly |
ユーザー | YI-Sxi |
ステータス | Judging |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<MyReadonly<Todo1>, Readonly<Todo1>>>, ] interface Todo1 { title: string description: string completed: boolean meta: { author: string } }