mirror of
https://github.com/type-challenges/type-challenges.git
synced 2025-12-08 19:06:13 +00:00
40 lines
578 B
TypeScript
40 lines
578 B
TypeScript
import { Equal, Expect } from '@type-challenges/utils'
|
|
|
|
type cases = [
|
|
Expect<Equal<DeepReadonly<X>, Expected>>,
|
|
]
|
|
|
|
type X = {
|
|
a: () => 22
|
|
b: string
|
|
c: {
|
|
d: boolean
|
|
e: {
|
|
g: {
|
|
h: {
|
|
i: true
|
|
j: 'string'
|
|
}
|
|
k: 'hello'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
type Expected = {
|
|
readonly a: () => 22
|
|
readonly b: string
|
|
readonly c: {
|
|
readonly d: boolean
|
|
readonly e: {
|
|
readonly g: {
|
|
readonly h: {
|
|
readonly i: true
|
|
readonly j: 'string'
|
|
}
|
|
readonly k: 'hello'
|
|
}
|
|
}
|
|
}
|
|
}
|