Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 530 Bytes

deep-readonly-x.md

File metadata and controls

32 lines (26 loc) · 530 Bytes
category alias
X Series
DeepReadonlyByKeys

DeepReadonlyX

Make specified properties in the object readonly, regardless of how deeply nested they are.

Usage

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'>