DeepReadonlyX
Category
X Series
Alias
DeepReadonlyByKeys
Make specified properties in the object readonly, regardless of how deeply nested they are.
Usage
ts
import type { DeepReadonlyX } from '@utype/core'
type Props = {
x: {
a: 1
b: 'hi'
},
y: 'hey'
}
// Expect: {
// x: {
// a: 1,
// readonly b: 'hi'
// }
// readonly y: 'hey'
// }
type DeepReadonlyXProps = DeepReadonlyX<Props, 'b' | 'y'>