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
[x] 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
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 theGlobSourceResult
in addition to theImportCandidate
type. This means that thepath
property will be astring
instead ofstring | undefined
.Notes & open questions
This PR makes it a bit easier to use
globSource
since it is a bit annoying to have to check ifpath
is defined when it always is.Is there any reason why we had the
GlobSourceResult
type butglobSource
does not return it?Change checklist