stream-chat 5.1.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.ts CHANGED
@@ -54,6 +54,10 @@ function isFileWebAPI(uri: unknown): uri is File {
54
54
  return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
55
55
  }
56
56
 
57
+ function isBlobWebAPI(uri: unknown): uri is Blob {
58
+ return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
59
+ }
60
+
57
61
  export function isOwnUser<
58
62
  ChannelType extends UR = UR,
59
63
  CommandType extends string = LiteralStringForUnion,
@@ -88,7 +92,7 @@ export function addFileToFormData(
88
92
  ) {
89
93
  const data = new FormData();
90
94
 
91
- if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri)) {
95
+ if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
92
96
  if (name) data.append('file', uri, name);
93
97
  else data.append('file', uri);
94
98
  } else {