From d3c6be32929d56b72b673b9e6a6b94aab28f1f6c Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Tue, 3 Mar 2020 12:45:44 +0100 Subject: [PATCH] fix: pass on generic in all method --- source/create.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/create.ts b/source/create.ts index 4f09c1c64..5e0a5b792 100644 --- a/source/create.ts +++ b/source/create.ts @@ -199,7 +199,7 @@ const create = (defaults: Defaults): Got => { // @ts-ignore The missing property is added below got.paginate = async function * (url: URLOrOptions, options?: Omit> & PaginationOptions) { - let normalizedOptions = normalizeArguments(url, options, defaults); + let normalizedOptions = normalizeArguments(url, options as Options, defaults); const pagination = normalizedOptions._pagination!; @@ -248,8 +248,8 @@ const create = (defaults: Defaults): Got => { got.paginate.all = async (url: URLOrOptions, options?: Omit> & PaginationOptions) => { const results: T[] = []; - for await (const item of got.paginate(url, options)) { - results.push(item as T); + for await (const item of got.paginate(url, options)) { + results.push(item); } return results;