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

feat: Improve map reading (fromJSON/fromPartial) #410

Merged
merged 2 commits into from
Nov 24, 2021

Conversation

webmaster128
Copy link
Collaborator

This follows the same idea as previous PRs for fromJSON/fromPartial: have exactly one assignment per field.

The explicit typing in reduce is necessary to avoid that TS infers {} as the output/accumulator type. ${fieldType} could be replaced with typeof message.outputField but then in #402 the output field might become optional but ${fieldType} should not change.

Copy link
Owner

@stephenh stephenh left a comment

Choose a reason for hiding this comment

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

Nice!

@webmaster128 webmaster128 changed the title Improve map reading (fromJSON/fromPartial) feat: Improve map reading (fromJSON/fromPartial) Nov 24, 2021
@webmaster128 webmaster128 merged commit 057d438 into stephenh:main Nov 24, 2021
@webmaster128 webmaster128 deleted the improve-map-reading branch November 24, 2021 07:52
stephenh pushed a commit that referenced this pull request Nov 24, 2021
# [1.89.0](v1.88.0...v1.89.0) (2021-11-24)

### Features

* Improve map reading (fromJSON/fromPartial) ([#410](#410)) ([057d438](057d438))
@stephenh
Copy link
Owner

🎉 This PR is included in version 1.89.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants