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: add arrayAt() #39

Open
tychenjiajun opened this issue Mar 1, 2022 · 4 comments
Open

Proposal: add arrayAt() #39

tychenjiajun opened this issue Mar 1, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tychenjiajun
Copy link
Contributor

TypeScript 4.6.2 supports Array.prototype.at, unfortunately its behavior is not consistent with array[number], see microsoft/TypeScript#47660
I propose a strongly-typed version of Array.prototype.at, at least support -1 on tuple.

@tychenjiajun
Copy link
Contributor Author

Maybe the method name should be changed to tupleAt?

@sindresorhus
Copy link
Owner

Would it only have stronger type for tuples?

@tychenjiajun
Copy link
Contributor Author

Would it only have stronger type for tuples?

Yes as far as I know.

@sindresorhus
Copy link
Owner

This is "pull request welcome", but must be implemented in sindresorhus/type-fest#369 first.

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Apr 1, 2022
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

No branches or pull requests

2 participants