Skip to content

Introduce the .readonly() method#117

Draft
aryaemami59 wants to merge 2 commits into
mmkal:mainfrom
aryaemami59:add-readonly
Draft

Introduce the .readonly() method#117
aryaemami59 wants to merge 2 commits into
mmkal:mainfrom
aryaemami59:add-readonly

Conversation

@aryaemami59
Copy link
Copy Markdown
Collaborator

@aryaemami59 aryaemami59 commented Sep 12, 2024

This PR:

  • Introduces the .readonly() method for transforming object properties to readonly.

Details:

.readonly() works similarly to the native Readonly utility type:

import { expectTypeOf } from 'expect-type'

type Post = {
  title: string
  content: string
}

expectTypeOf<Post>().readonly().toEqualTypeOf<Readonly<Post>>()

@aryaemami59 aryaemami59 added the New feature New feature or request label Sep 12, 2024
@aryaemami59 aryaemami59 added this to the 1.0.0 milestone Sep 12, 2024
@aryaemami59 aryaemami59 self-assigned this Sep 12, 2024
@aryaemami59 aryaemami59 requested a review from mmkal September 12, 2024 04:48
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Sep 12, 2024

Open in StackBlitz

npm i https://pkg.pr.new/mmkal/expect-type@117

commit: 9a43943

@aryaemami59 aryaemami59 force-pushed the add-readonly branch 4 times, most recently from d8d8aa8 to 88f3563 Compare September 14, 2024 12:44
@aryaemami59 aryaemami59 force-pushed the add-readonly branch 2 times, most recently from 1765795 to 5190305 Compare October 2, 2024 03:46
@aryaemami59 aryaemami59 removed this from the 1.0.0 milestone Oct 8, 2024
@aryaemami59 aryaemami59 force-pushed the add-readonly branch 7 times, most recently from 5a8b2dc to 7655293 Compare October 9, 2024 19:14
@aryaemami59 aryaemami59 force-pushed the add-readonly branch 2 times, most recently from 975b2ee to 348cdd7 Compare February 2, 2025 16:43
@aryaemami59 aryaemami59 force-pushed the add-readonly branch 3 times, most recently from 77c739f to f7d34aa Compare February 14, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant