Skip to content

Commit f176022

Browse files
authored
fix: Re-add previously removed non-standard functionality of passing blobs with name properties (#80)
1 parent dabb0c9 commit f176022

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

source/session.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,13 @@ export class Session {
939939
file: Blob,
940940
options: CreateComponentOptions = {}
941941
): Promise<Response<Data>[]> {
942-
const normalizedFileName = normalizeString(
943-
options.name ?? (file instanceof File ? file.name : "component")
944-
);
942+
const componentName = options.name ?? (file as File).name;
943+
944+
let normalizedFileName;
945+
if (componentName) {
946+
normalizedFileName = normalizeString(componentName);
947+
}
948+
945949
if (!normalizedFileName) {
946950
throw new CreateComponentError("Component name is missing.");
947951
}

0 commit comments

Comments
 (0)