We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e115347 commit 6db2175Copy full SHA for 6db2175
1 file changed
src/client.ts
@@ -266,24 +266,6 @@ export class GRID {
266
return url.toString();
267
}
268
269
- private calculateContentLength(body: unknown): string | null {
270
- if (typeof body === 'string') {
271
- if (typeof (globalThis as any).Buffer !== 'undefined') {
272
- return (globalThis as any).Buffer.byteLength(body, 'utf8').toString();
273
- }
274
-
275
- if (typeof (globalThis as any).TextEncoder !== 'undefined') {
276
- const encoder = new (globalThis as any).TextEncoder();
277
- const encoded = encoder.encode(body);
278
- return encoded.length.toString();
279
280
- } else if (ArrayBuffer.isView(body)) {
281
- return body.byteLength.toString();
282
283
284
- return null;
285
286
287
/**
288
* Used as a callback for mutating the given `FinalRequestOptions` object.
289
*/
0 commit comments