Skip to content

Commit

Permalink
refactor: change some types
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmlnc committed Jun 9, 2019
1 parent 09f0107 commit 9ab065b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function sync(source: Pattern | Pattern[], options?: Options): string[];
function sync(source: Pattern | Pattern[], options?: Options): EntryItem[] {
assertPatternsInput(source);

const works = getWorks<EntryItem[]>(source, ProviderSync, options);
const works = getWorks(source, ProviderSync, options);

return utils.array.flatten(works);
}
Expand All @@ -32,15 +32,15 @@ function async(source: Pattern | Pattern[], options?: Options): Promise<EntryIte
return Promise.reject(error);
}

const works = getWorks<Promise<EntryItem[]>>(source, ProviderAsync, options);
const works = getWorks(source, ProviderAsync, options);

return Promise.all(works).then(utils.array.flatten);
}

function stream(source: Pattern | Pattern[], options?: Options): NodeJS.ReadableStream {
assertPatternsInput(source);

const works = getWorks<NodeJS.ReadableStream>(source, ProviderStream, options);
const works = getWorks(source, ProviderStream, options);

return utils.stream.merge(works);
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ProviderSync extends Provider<EntryItem[]> {

const entries = this.api(root, task, options);

return entries.map<EntryItem>(options.transform);
return entries.map(options.transform);
}

public api(root: string, task: Task, options: ReaderOptions): Entry[] {
Expand Down
2 changes: 1 addition & 1 deletion src/readers/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default abstract class Reader<T> {
constructor(protected readonly _settings: Settings) { }

public abstract dynamic(root: string, options: ReaderOptions): T;
public abstract static(filepath: string[], options: ReaderOptions): T;
public abstract static(patterns: Pattern[], options: ReaderOptions): T;

protected _getFullEntryPath(filepath: string): string {
return path.resolve(this._settings.cwd, filepath);
Expand Down
2 changes: 1 addition & 1 deletion src/readers/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class ReaderStream extends Reader<NodeJS.ReadableStream> {
return walk;
}

public static(patterns: string[], options: ReaderOptions): NodeJS.ReadableStream {
public static(patterns: Pattern[], options: ReaderOptions): NodeJS.ReadableStream {
const filepaths = patterns.map(this._getFullEntryPath, this);

const stream = new PassThrough({ objectMode: true });
Expand Down

0 comments on commit 9ab065b

Please sign in to comment.