We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cec805c commit 676a868Copy full SHA for 676a868
src/client.ts
@@ -237,24 +237,6 @@ export class Lightswitch {
237
return url.toString();
238
}
239
240
- private calculateContentLength(body: unknown): string | null {
241
- if (typeof body === 'string') {
242
- if (typeof (globalThis as any).Buffer !== 'undefined') {
243
- return (globalThis as any).Buffer.byteLength(body, 'utf8').toString();
244
- }
245
-
246
- if (typeof (globalThis as any).TextEncoder !== 'undefined') {
247
- const encoder = new (globalThis as any).TextEncoder();
248
- const encoded = encoder.encode(body);
249
- return encoded.length.toString();
250
251
- } else if (ArrayBuffer.isView(body)) {
252
- return body.byteLength.toString();
253
254
255
- return null;
256
257
258
/**
259
* Used as a callback for mutating the given `FinalRequestOptions` object.
260
*/
0 commit comments