Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce the .readonly() method #117

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

aryaemami59
Copy link
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
Copy link

pkg-pr-new bot commented Sep 12, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mmkal/expect-type@117

commit: 7655293

@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 5 times, most recently from cad1343 to e8f3849 Compare October 9, 2024 15:27
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