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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return type on group function #145

Merged
merged 2 commits into from Dec 11, 2022
Merged

Fix return type on group function #145

merged 2 commits into from Dec 11, 2022

Conversation

sodiray
Copy link
Owner

@sodiray sodiray commented Nov 8, 2022

Description

The group function should return a partial of TKey because it's possible the object does not include all possible TKey keys.

To illustrate:

const groups = group(list, match)

// typeof groups['not-here'] is []
console.log(groups['not-here']) // is undefined

Wrapped return type in a Partial to fix 馃憤

Checklist

  • Changes are covered by tests if behavior has been changed or added
  • Tests have 100% coverage
  • If code changes were made, the version in package.json has been bumped (matching semver)
  • If code changes were made, the yarn build command has been run and to update the cdn directory

Resolves

n/a

@sodiray
Copy link
Owner Author

sodiray commented Nov 8, 2022

Unfortunately, even though this is just a small type change it is a breaking one for the typescript users. You can see how I had to update the tests. This will stay pending until we have enough to reason a v10 release.

@sodiray sodiray merged commit f8d7b84 into master Dec 11, 2022
@sodiray sodiray deleted the fix/group-types branch June 27, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant