Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 479 Bytes

deep-readonly.md

File metadata and controls

32 lines (25 loc) · 479 Bytes
category
Object Operation

DeepReadonly

Make every parameter of an object - and its sub-objects recursively - readonly.

Usage

import type { DeepReadonly } from '@utype/core'

type Props = {
  x: {
    a: 1
    b: 'hi'
  },
  y: 'hey'
}

// Expect: {
//   readonly x: {
//     readonly a: 1,
//     readonly b: 'hi'
//   }
//   readonly y: 'hey'
// }
type DeepReadonlyProps = DeepReadonly<Props>