File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ declare module "replicate" {
46
46
size : number ;
47
47
etag : string ;
48
48
checksum : string ;
49
- metadata : Record < string , any > ;
49
+ metadata : Record < string , unknown > ;
50
50
created_at : string ;
51
51
expires_at : string | null ;
52
52
urls : {
Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ async function createFile(file, metadata = {}) {
11
11
let filename ;
12
12
let blob ;
13
13
if ( file instanceof Blob ) {
14
- fileName = file . name || `blob_${ Date . now ( ) } ` ;
14
+ filename = file . name || `blob_${ Date . now ( ) } ` ;
15
15
blob = file ;
16
16
} else if ( Buffer . isBuffer ( file ) ) {
17
- fileName = `buffer_${ Date . now ( ) } ` ;
17
+ filename = `buffer_${ Date . now ( ) } ` ;
18
18
blob = new Blob ( file , { type : "application/octet-stream" } ) ;
19
19
} else {
20
- throw new Error ( "Invalid file argument, must be a Blob or File " ) ;
20
+ throw new Error ( "Invalid file argument, must be a Blob, File or Buffer " ) ;
21
21
}
22
22
23
23
form . append ( "content" , blob , filename ) ;
You can’t perform that action at this time.
0 commit comments