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

#307 Assign type of any to asMap and asMappedResults #308

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bbahrman
Copy link

@bbahrman bbahrman commented Sep 18, 2024

Assigning type of any to asMap and asMappedResults allows for them to be assigned to meaningful interfaces/types

See: #307

@ShawnTalbert
Copy link
Contributor

I would suggest we make this a generic so the caller can directly provide a return type instead of introducing 'any'. Thoughts?

@darrenhillconsulting
Copy link
Contributor

I agree @ShawnTalbert , I've been meaning to do this. @bbahrman , let me know if you need a hand converting this to use Generics.

@bbahrman
Copy link
Author

@ShawnTalbert @darrenhillconsulting - Thanks for the suggestion to use a generic, new to me, sorry it took a bit for me to get myself understanding what you were trying to do with it. Thanks Darren for the example. I think I just copied and pasted your example in, but wanted to test it out to be sure I understood the why (I trust you, but like to learn).

Do either of you feel the need to have the generic type be a named type in some way? I don't think it does, but let me know if you want any further changes.

Copy link
Contributor

@darrenhillconsulting darrenhillconsulting left a comment

Choose a reason for hiding this comment

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

Maybe remove unrelated changes? Like the JSDoc changes?

N/query.d.ts Outdated Show resolved Hide resolved
@bbahrman
Copy link
Author

Maybe remove unrelated changes? Like the JSDoc changes?

@darrenhillconsulting fair point, sorry those were some errant whitespace changes. I've cleaned them up.

Copy link
Contributor

@darrenhillconsulting darrenhillconsulting left a comment

Choose a reason for hiding this comment

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

I like this change. @ShawnTalbert ?

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.

3 participants