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

Add function overload for better buildList and createList types #96

Closed
wants to merge 2 commits into from
Closed

Add function overload for better buildList and createList types #96

wants to merge 2 commits into from

Conversation

aapzu
Copy link

@aapzu aapzu commented Mar 20, 2022

Issue: #95

Add function overloads for buildList and createList to return never[] if the number is 0, and otherwise [T, ...T[]].

@aapzu
Copy link
Author

aapzu commented Mar 21, 2022

I realized that this now returns wrong type in a case like

const getFooList = (amount: number) => {
  return fooFactory.buildList(amount)
}

I'll fix that and maybe add a type test as well

@aapzu aapzu closed this by deleting the head repository Apr 24, 2024
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.

1 participant