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-std types #116

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

TheEdward162
Copy link
Contributor

  • made MapError generic over the value it stores
  • made UsecaseContext and UsecaseFn generic over input, result and error
  • export MapError and AnyValue types into the global namespace of the map-std types (this is sort of like stabilising them, but they are just types and we don't currently distribute those)
  • correctly type Response.bodyJson and Response.bodyAuto (add Buffer into the possible return types)
  • improve Buffer.from to also accept Bytes
  • update example maps with more correct typings
  • fix provider parameters type to only string values
  • fix FetchOptions.body type to AnyValue

Some improvements I realized can be useful as I was experimenting with TypeScript profiles

* made MapError generic over the value it stores
* made UsecaseContext and UsecaseFn generic over input, result and error
* export MapError and AnyValue types into the global namespace of the map-std types (this is sort of like stabilising them, but they are just types and we don't currently distribute those)
* correctly type Response.bodyJson and Response.bodyAuto (add Buffer into the possible return types)
* improve Buffer.from to also accept Bytes
* update example maps with more correct typings
* fix provider parameters type to only string values
* fix FetchOptions.body type to AnyValue
Copy link
Member

@freaz freaz left a comment

Choose a reason for hiding this comment

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

👍 thanks.

@TheEdward162 TheEdward162 merged commit 2f3c829 into main Nov 2, 2023
5 checks passed
@TheEdward162 TheEdward162 deleted the feat/improve_map_std_types branch November 2, 2023 10:09
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.

2 participants