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

Jsonify: readonly messes with Jsonified tuple types #629

Closed
mfulton26 opened this issue May 31, 2023 · 2 comments · Fixed by #673
Closed

Jsonify: readonly messes with Jsonified tuple types #629

mfulton26 opened this issue May 31, 2023 · 2 comments · Fixed by #673
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mfulton26
Copy link
Contributor

Actual

type A = Jsonify<[1, 2, 3]>; // type A = [1, 2, 3]
type B = Jsonify<readonly [1, 2, 3]>; // type B = (1 | 2 | 3)[]

Expected

type A = Jsonify<[1, 2, 3]>; // type A = [1, 2, 3]
type B = Jsonify<readonly [1, 2, 3]>; // type B = readonly [1, 2, 3]
sindresorhus added a commit that referenced this issue Jun 4, 2023
@sindresorhus
Copy link
Owner

I added a failing test for this: 9c148ac

@sindresorhus sindresorhus added bug Something isn't working help wanted Extra attention is needed labels Jun 4, 2023
@Emiyaaaaa
Copy link
Collaborator

Emiyaaaaa commented Aug 15, 2023

if an array be Jsonify, i think this jsonify array not a readonly array.
but, result is (1 | 2 | 3)[] but not [1,2,3] is a bug, can i try fix it? @sindresorhus

Emiyaaaaa added a commit to Emiyaaaaa/type-fest that referenced this issue Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants