File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,16 @@ export class Component implements Part {
4343 }
4444
4545 /**
46- * Create a Component from a {@link File}. If file media type is available,
46+ * Create a Component from a {@link ! File}. If file media type is available,
4747 * it will be set in the `Content-Type` header. The file's contents will be used as the part's body.
4848 *
4949 * This method might be slow if a large file is provided as the file contents need to be read.
5050 *
5151 * @param file File instance to create the component from
52+ * @deprecated Use {@link Component.blob}.
5253 */
5354 public static async file ( file : File ) {
54- return new Component ( file . type . length > 0 ? { "Content-Type" : file . type } : { } , await file . arrayBuffer ( ) ) ;
55+ return await Component . blob ( file ) ;
5556 }
5657
5758 /**
You can’t perform that action at this time.
0 commit comments