Skip to content

Commit 9ab065b

Browse files
committed
refactor: change some types
1 parent 09f0107 commit 9ab065b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function sync(source: Pattern | Pattern[], options?: Options): string[];
1818
function sync(source: Pattern | Pattern[], options?: Options): EntryItem[] {
1919
assertPatternsInput(source);
2020

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

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

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

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

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

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

4545
return utils.stream.merge(works);
4646
}

src/providers/sync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class ProviderSync extends Provider<EntryItem[]> {
1212

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

15-
return entries.map<EntryItem>(options.transform);
15+
return entries.map(options.transform);
1616
}
1717

1818
public api(root: string, task: Task, options: ReaderOptions): Entry[] {

src/readers/reader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default abstract class Reader<T> {
1717
constructor(protected readonly _settings: Settings) { }
1818

1919
public abstract dynamic(root: string, options: ReaderOptions): T;
20-
public abstract static(filepath: string[], options: ReaderOptions): T;
20+
public abstract static(patterns: Pattern[], options: ReaderOptions): T;
2121

2222
protected _getFullEntryPath(filepath: string): string {
2323
return path.resolve(this._settings.cwd, filepath);

src/readers/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class ReaderStream extends Reader<NodeJS.ReadableStream> {
2323
return walk;
2424
}
2525

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

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

0 commit comments

Comments
 (0)