Skip to content

feat: update get signature #23

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

Merged
merged 3 commits into from
Jul 26, 2023
Merged

feat: update get signature #23

merged 3 commits into from
Jul 26, 2023

Conversation

eduardoboucas
Copy link
Member

Which problem is this pull request solving?

Updates the type property of the get method to use a union rather than an enum, to prevent this from happening:

image

Also adds the overload for {type: "json"} which is currently missing.

@eduardoboucas eduardoboucas requested a review from a team as a code owner July 26, 2023 14:17
@netlify
Copy link

netlify bot commented Jul 26, 2023

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit 55f9223
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/64c13f76ba3f4300081d13ba
😎 Deploy Preview https://deploy-preview-23--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jul 26, 2023
@eduardoboucas eduardoboucas requested a review from ascorbic July 26, 2023 14:18
src/main.ts Outdated
async get(key: string, { type }: { type: 'blob' }): Promise<Blob>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async get(key: string, { type }: { type: 'json' }): Promise<any>
async get(key: string, { type }: { type: 'stream' }): Promise<ReadableStream | null>

Choose a reason for hiding this comment

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

how come this is the only one that can resolve to null?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops! Good catch. That shouldn't be the case. Fixed in 55f9223.

Copy link

@charliegroll charliegroll left a comment

Choose a reason for hiding this comment

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

:shipit:

@eduardoboucas eduardoboucas merged commit e817d59 into main Jul 26, 2023
@eduardoboucas eduardoboucas deleted the feat/get-type-signature branch October 24, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants