Skip to content

Commit 660363b

Browse files
committed
create blob from component
1 parent 656d8c8 commit 660363b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,11 @@ export class Component implements Part {
7979
result.push(this.body);
8080
return Multipart.combineArrays(result);
8181
}
82+
83+
/**
84+
* A Blob representation of this component. Headers will be lost.
85+
*/
86+
public blob(): Blob {
87+
return new Blob([this.body], {type: this.headers.get("Content-Type") ?? undefined});
88+
}
8289
}

0 commit comments

Comments
 (0)