Skip to content

Commit d46b8e1

Browse files
committed
fix formatting
1 parent a91a792 commit d46b8e1

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/core.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export abstract class APIClient {
230230
/**
231231
* Override this to add your own headers validation:
232232
*/
233-
protected validateHeaders(headers: Headers, customHeaders: Headers) { }
233+
protected validateHeaders(headers: Headers, customHeaders: Headers) {}
234234

235235
protected defaultIdempotencyKey(): string {
236236
return `stainless-node-retry-${uuid4()}`;
@@ -265,10 +265,10 @@ export abstract class APIClient {
265265
Promise.resolve(opts).then(async (opts) => {
266266
const body =
267267
opts && isBlobLike(opts?.body) ? new DataView(await opts.body.arrayBuffer())
268-
: opts?.body instanceof DataView ? opts.body
269-
: opts?.body instanceof ArrayBuffer ? new DataView(opts.body)
270-
: opts && ArrayBuffer.isView(opts?.body) ? new DataView(opts.body.buffer)
271-
: opts?.body;
268+
: opts?.body instanceof DataView ? opts.body
269+
: opts?.body instanceof ArrayBuffer ? new DataView(opts.body)
270+
: opts && ArrayBuffer.isView(opts?.body) ? new DataView(opts.body.buffer)
271+
: opts?.body;
272272
return { method, path, ...opts, body };
273273
}),
274274
);
@@ -310,9 +310,9 @@ export abstract class APIClient {
310310
const body =
311311
ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ?
312312
options.body
313-
: isMultipartBody(options.body) ? options.body.body
314-
: options.body ? JSON.stringify(options.body, null, 2)
315-
: null;
313+
: isMultipartBody(options.body) ? options.body.body
314+
: options.body ? JSON.stringify(options.body, null, 2)
315+
: null;
316316
const contentLength = this.calculateContentLength(body);
317317

318318
const url = this.buildURL(path!, query);
@@ -401,7 +401,7 @@ export abstract class APIClient {
401401
/**
402402
* Used as a callback for mutating the given `FinalRequestOptions` object.
403403
*/
404-
protected async prepareOptions(options: FinalRequestOptions): Promise<void> { }
404+
protected async prepareOptions(options: FinalRequestOptions): Promise<void> {}
405405

406406
/**
407407
* Used as a callback for mutating the given `RequestInit` object.
@@ -412,14 +412,14 @@ export abstract class APIClient {
412412
protected async prepareRequest(
413413
request: RequestInit,
414414
{ url, options }: { url: string; options: FinalRequestOptions },
415-
): Promise<void> { }
415+
): Promise<void> {}
416416

417417
protected parseHeaders(headers: HeadersInit | null | undefined): Record<string, string> {
418418
return (
419419
!headers ? {}
420-
: Symbol.iterator in headers ?
421-
Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
422-
: { ...(headers as any as Record<string, string>) }
420+
: Symbol.iterator in headers ?
421+
Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
422+
: { ...(headers as any as Record<string, string>) }
423423
);
424424
}
425425

@@ -512,7 +512,7 @@ export abstract class APIClient {
512512
const url =
513513
isAbsoluteURL(path) ?
514514
new URL(path)
515-
: new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
515+
: new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
516516

517517
const defaultQuery = this.defaultQuery();
518518
if (!isEmptyObj(defaultQuery)) {
@@ -737,9 +737,9 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
737737
* }
738738
*/
739739
export class PagePromise<
740-
PageClass extends AbstractPage<Item>,
741-
Item = ReturnType<PageClass['getPaginatedItems']>[number],
742-
>
740+
PageClass extends AbstractPage<Item>,
741+
Item = ReturnType<PageClass['getPaginatedItems']>[number],
742+
>
743743
extends APIPromise<PageClass>
744744
implements AsyncIterable<Item>
745745
{
@@ -1039,7 +1039,7 @@ export const castToError = (err: any): Error => {
10391039
if (typeof err === 'object' && err !== null) {
10401040
try {
10411041
return new Error(JSON.stringify(err));
1042-
} catch { }
1042+
} catch {}
10431043
}
10441044
return new Error(err);
10451045
};

0 commit comments

Comments
 (0)