supabase/storage-js

`getPublicUrl` incorrect/unnecessary return type

probablykasper opened this issue ยท 3 comments

Bug report

Describe the bug

This is the return type of getPublicUrl:

{
    data: {
        publicURL: string;
    } | null;
    error: Error | null;
    publicURL: string | null;
}

Since it has a potential error and null response, I wondered why it would return an error. I assumed it would call the server to check if the url is valid, but it doesn't do that. When I looked into it, it doesn't seem like it can ever return an error.

Expected behavior

It would be a breaking change, but the most logical would be to just have

getPublicUrl: (path: string) => string

๐ŸŽ‰ This issue has been resolved in version 1.8.0-next.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 2.0.0-rc.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 2.0.0-rc.5 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€