Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Add support for readonly tuples #6

Open
cshaa opened this issue May 24, 2019 · 2 comments
Open

Add support for readonly tuples #6

cshaa opened this issue May 24, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cshaa
Copy link

cshaa commented May 24, 2019

With TS 3.4 it became common practice to create tuples with [a, b, c] as const. This is really convenient, however the resulting tuple is readonly. It would be awesome to add support for these readonly tuples, right now I get error readonly (something) is not assignable to any[].

@cshaa
Copy link
Author

cshaa commented May 24, 2019

What I use now is a Writealso<T> type that removes readonly from the tuple:

type Writealso<T> = { -readonly [key in keyof T]: T[key] };

@KSXGitHub KSXGitHub added enhancement New feature or request good first issue Good for newcomers labels May 24, 2019
@KSXGitHub
Copy link
Member

KSXGitHub commented May 28, 2019

Sadly, I'm stuck here (I actually have been stuck there for longer than the issue). So until it is resolved, no new feature from me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants