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

Proposal: FixedLengthArray #102

Closed
Richienb opened this issue Apr 29, 2020 · 1 comment · Fixed by #106
Closed

Proposal: FixedLengthArray #102

Richienb opened this issue Apr 29, 2020 · 1 comment · Fixed by #106
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Richienb
Copy link
Contributor

Richienb commented Apr 29, 2020

const myArray: FixedLengthArray<number, 3> = [1, 2, 3]

const [a, b, c] = myArray // Ok
const [a, b, c, d] = myArray // Invalid index error

See https://stackoverflow.com/a/59906630/8384910

cc @sindresorhus

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@sindresorhus
Copy link
Owner

Looks useful. PR welcome.

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants