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

fix: Add GlobSourceResult to globSource return type in unixfs. #475

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

saul-jb
Copy link
Contributor

@saul-jb saul-jb commented Mar 26, 2024

Title

fix: Add GlobSourceResult to globSource return type.

Description

This is a small PR that modifies the return type on the globSource utility in @helia/unixfs to return the GlobSourceResult in addition to the ImportCandidate type. This means that the path property will be a string instead of string | undefined.

Notes & open questions

This PR makes it a bit easier to use globSource since it is a bit annoying to have to check if path is defined when it always is.

Is there any reason why we had the GlobSourceResult type but globSource does not return it?

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@saul-jb saul-jb requested a review from a team as a code owner March 26, 2024 01:39
@achingbrain achingbrain merged commit 9ac5909 into ipfs:main Mar 27, 2024
18 checks passed
@achingbrain
Copy link
Member

Thanks!

Is there any reason why we had the GlobSourceResult type but globSource does not return it?

No, just an oversight, I think.

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