diff --git a/src/core.ts b/src/core.ts index a6028eacd..c0354f2c3 100644 --- a/src/core.ts +++ b/src/core.ts @@ -98,8 +98,10 @@ export class APIPromise extends Promise { }); } - _thenUnwrap(transform: (data: T) => U): APIPromise { - return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props))); + _thenUnwrap(transform: (data: T, props: APIResponseProps) => U): APIPromise { + return new APIPromise(this.responsePromise, async (props) => + transform(await this.parseResponse(props), props), + ); } /**