Skip to content

Refine isReadonlyOf and related #60

@lambdalisue

Description

@lambdalisue

TypeScript offers the Readonly<T> type function and the readonly keyword. However, the isReadonlyOf function seems a bit ambiguous. I propose the following improvements:

  • Enhance isReadonlyOf for Array, Tuple, and Object types.
  • Introduce isReadonlyFieldOf for checking/annotating the readonly status of object fields.
  • Rename isOptionalOf to isOptionalFieldOf to maintain consistency with isReadonlyFieldOf. This change aligns with the handling of ? for object fields.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions