We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67f743e commit bbceca3Copy full SHA for bbceca3
src/Multipart.ts
@@ -439,6 +439,16 @@ export class Multipart implements Part {
439
return Multipart.combineArrays(result);
440
}
441
442
+ /**
443
+ * Create Blob from this multipart.
444
+ *
445
+ * @throws {@link !RangeError} If the multipart boundary is invalid. A valid boundary is 1 to 70 characters long,
446
+ * does not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space.
447
+ */
448
+ public blob(): Blob {
449
+ return new Blob([this.bytes()], {type: this.headers.get("content-type") ?? undefined});
450
+ }
451
+
452
private static boundaryShouldBeQuoted(boundary: Uint8Array): boolean {
453
for (const byte of boundary) {
454
if (
0 commit comments