Skip to content

Commit

Permalink
fix: pass on generic in all method
Browse files Browse the repository at this point in the history
  • Loading branch information
jaulz committed Mar 3, 2020
1 parent c81b977 commit d3c6be3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/create.ts
Expand Up @@ -199,7 +199,7 @@ const create = (defaults: Defaults): Got => {

// @ts-ignore The missing property is added below
got.paginate = async function * <T>(url: URLOrOptions, options?: Omit<Options, keyof PaginationOptions<unknown>> & PaginationOptions<T>) {
let normalizedOptions = normalizeArguments(url, options, defaults);
let normalizedOptions = normalizeArguments(url, options as Options, defaults);

const pagination = normalizedOptions._pagination!;

Expand Down Expand Up @@ -248,8 +248,8 @@ const create = (defaults: Defaults): Got => {
got.paginate.all = async <T>(url: URLOrOptions, options?: Omit<Options, keyof PaginationOptions<unknown>> & PaginationOptions<T>) => {
const results: T[] = [];

for await (const item of got.paginate<unknown>(url, options)) {
results.push(item as T);
for await (const item of got.paginate<T>(url, options)) {
results.push(item);
}

return results;
Expand Down

0 comments on commit d3c6be3

Please sign in to comment.