From cd2ada88e51df663a5375c1aea37d5fd4f1ea943 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:21:18 +0000 Subject: [PATCH] feat(api): api update (#118) --- src/core.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index 485ff14..c47fcf7 100644 --- a/src/core.ts +++ b/src/core.ts @@ -84,8 +84,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), + ); } /**