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

Small bug in the type of toObject when a key selector is specified #87

Closed
andrew-w-ross opened this issue Mar 5, 2020 · 3 comments
Closed

Comments

@andrew-w-ross
Copy link

andrew-w-ross commented Mar 5, 2020

I think there is a small mistake on the type for toObject function when a selector is introduced.

Currently it's this:

toObject(keySelectorFn: MapFn<TItem, string>): StringKeyedObject<TItem>;
toObject(keySelectorFn: MapFn<TItem, number>): NumberKeyedObject<TItem>;
toObject<TElement>(keySelectorFn: MapFn<TItem, string>, elementSelectorFn: MapFn<TItem, TElement>): StringKeyedObject<TItem>;
toObject<TElement>(keySelectorFn: MapFn<TItem, number>, elementSelectorFn: MapFn<TItem, TElement>): NumberKeyedObject<TItem>;

I think the ones with the element selector should have a keyed object of type TElement.

@tomi
Copy link
Owner

tomi commented Mar 21, 2020

Hi @andrew-w-ross and thank you for filing the issue. You are absolutely correct. It is a bug. I'll fix it ASAP.

@tomi tomi closed this as completed in e992757 Mar 21, 2020
@tomi tomi reopened this Mar 21, 2020
@tomi
Copy link
Owner

tomi commented Mar 21, 2020

@all-contributors please add @andrew-w-ross for bug

@allcontributors
Copy link
Contributor

@tomi

I've put up a pull request to add @andrew-w-ross! 🎉

tomi pushed a commit that referenced this issue Mar 21, 2020
## [1.4.3](v1.4.2...v1.4.3) (2020-03-21)

### Bug Fixes

* fix typing of toObject when elementSelectorFn is given ([e992757](e992757)), closes [#87](#87)
@tomi tomi closed this as completed Mar 21, 2020
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

No branches or pull requests

2 participants