Skip to content

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

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 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/unixfs/src/utils/glob-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import glob from 'it-glob'
import { InvalidParametersError } from '../errors.js'
import { toMtime } from './to-mtime.js'
import type { MtimeLike } from 'ipfs-unixfs'
import type { ImportCandidateStream } from 'ipfs-unixfs-importer'
import type { ImportCandidate } from 'ipfs-unixfs-importer'

export interface GlobSourceOptions {
/**
Expand Down Expand Up @@ -49,7 +49,7 @@ export interface GlobSourceResult {
/**
* Create an async iterator that yields paths that match requested glob pattern
*/
export async function * globSource (cwd: string, pattern: string, options: GlobSourceOptions = {}): ImportCandidateStream {
export async function * globSource (cwd: string, pattern: string, options: GlobSourceOptions = {}): AsyncGenerator<ImportCandidate & GlobSourceResult> {
if (typeof pattern !== 'string') {
throw new InvalidParametersError('Pattern must be a string')
}
Expand Down
Loading