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 support for basic hash/object conversions #201

Closed
wants to merge 6 commits into from
Closed

Add support for basic hash/object conversions #201

wants to merge 6 commits into from

Conversation

superstator
Copy link

Addresses #169

@sehz sehz requested a review from simlay August 13, 2022 16:27
Copy link
Contributor

@simlay simlay left a comment

Choose a reason for hiding this comment

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

Hi there! Thanks for the contribution!

At first glance, I think this is pretty good. I've got a few nits.

  • Add to the CHANGELOG.md.
  • Remove or make add more of a description to the README.md in the hash example.

I don't wanna expand the scope of this task too much but I wonder if we care about impl<'a, T> JSValue<'a> for HashMap<U, T> where U: Eq + Hash + JSValue, T: JSValue (and TryIntoJS). Thoughts?

examples/hash/README.md Outdated Show resolved Hide resolved
@superstator
Copy link
Author

Ha, I used the array example as a template and obviously missed some cruft. I will update the readme and changelog, and give the additional impl some thought.

@superstator
Copy link
Author

I played around a little with the idea of a generic hash key type, but I think it would effectively mean needing to support Map() on the JS side, which is not a slam dunk via NAPI. Doable, but maybe best left until somebody has a strong need for it.

Copy link
Contributor

@simlay simlay left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@digikata digikata self-requested a review August 22, 2022 19:28
@digikata
Copy link
Collaborator

LGTM

@simlay
Copy link
Contributor

simlay commented Aug 22, 2022

bors r+

1 similar comment
@sehz
Copy link
Collaborator

sehz commented Aug 22, 2022

bors r+

@superstator superstator closed this by deleting the head repository Oct 20, 2022
@yannleretaille
Copy link

Was there a reason this wasn't merged? It'd be very useful to have native support for HashMap.

yannleretaille added a commit to yannleretaille/node-bindgen that referenced this pull request May 20, 2023
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.

5 participants