Skip to content

Commit

Permalink
chore(internal): remove unused method (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Feb 13, 2025
1 parent cec805c commit 676a868
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,6 @@ export class Lightswitch {
return url.toString();
}

private calculateContentLength(body: unknown): string | null {
if (typeof body === 'string') {
if (typeof (globalThis as any).Buffer !== 'undefined') {
return (globalThis as any).Buffer.byteLength(body, 'utf8').toString();
}

if (typeof (globalThis as any).TextEncoder !== 'undefined') {
const encoder = new (globalThis as any).TextEncoder();
const encoded = encoder.encode(body);
return encoded.length.toString();
}
} else if (ArrayBuffer.isView(body)) {
return body.byteLength.toString();
}

return null;
}

/**
* Used as a callback for mutating the given `FinalRequestOptions` object.
*/
Expand Down

0 comments on commit 676a868

Please sign in to comment.