@bouko/react 2.0.8 → 2.0.9
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/dist/core/functions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getFileData: (files: File[]) => Promise<unknown[]>;
|
|
2
|
-
export declare const bufferToFile: (buffer: Buffer<ArrayBuffer>, name?: string) => Promise<
|
|
2
|
+
export declare const bufferToFile: (buffer: Buffer<ArrayBuffer>, name?: string) => Promise<File>;
|
|
3
3
|
export declare const getAudioDuration: (file: File) => Promise<number>;
|
|
4
4
|
export declare const getEnv: (key: string) => string;
|
|
5
5
|
export declare function getBase64(image: string): Promise<string>;
|
package/dist/core/functions.js
CHANGED
|
@@ -24,7 +24,7 @@ export const bufferToFile = async (buffer, name) => {
|
|
|
24
24
|
const type = await detectFileExtension(buffer);
|
|
25
25
|
if (!type)
|
|
26
26
|
throw new Error("Couldn't get type from buffer");
|
|
27
|
-
new File([buffer], `${name ?? "file"}.${type.ext}`, {
|
|
27
|
+
return new File([buffer], `${name ?? "file"}.${type.ext}`, {
|
|
28
28
|
type: type.mime,
|
|
29
29
|
lastModified: Date.now()
|
|
30
30
|
});
|