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

type ArraySlice support spread array #828 #830

Closed
wants to merge 24 commits into from

Conversation

Max10240
Copy link
Contributor

@Max10240 Max10240 commented Mar 13, 2024

Fixes #828

@Max10240 Max10240 closed this Mar 13, 2024
@Max10240 Max10240 reopened this Mar 13, 2024
@Max10240
Copy link
Contributor Author

@Emiyaaaaa review this pls :)

@sindresorhus
Copy link
Owner

@Max10240 Tip for the future, make pull requests from a feature branch in your fork, not the main branch.

@Max10240
Copy link
Contributor Author

@Max10240 Tip for the future, make pull requests from a feature branch in your fork, not the main branch.

fine

expectType<ArraySlice<[1, 2, 3, ...string[], 4, 5], 0>>([1, 2, 3, ...(null! as string[]), 4, 5]);
expectType<ArraySlice<[1, 2, 3, ...string[], 4, 5], 1>>([2, 3, ...(null! as string[]), 4, 5]);
expectType<ArraySlice<[1, 2, 3, ...string[], 4, 5], 3>>([...(null! as string[]), 4, 5]);
expectType<ArraySlice<[1, 2, 3, ...string[], 4, 5], 10>>([...(null! as string[]), 4, 5]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a test for leading spread array?

like expectType<ArraySlice<[...string[], 1, 2, 3], 1, 3>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ArraySlice should support spread array
3 participants