@@ -141,20 +141,20 @@ class S3Adapter {
141
141
// For a given config object, filename, and data, store a file in S3
142
142
// Returns a promise containing the S3 object creation response
143
143
async createFile ( filename , data , contentType , options = { } , config = { } ) {
144
- let key_without_prefix = filename ;
144
+ let keyWithoutPrefix = filename ;
145
145
if ( typeof this . _generateKey === 'function' ) {
146
146
const candidate = this . _generateKey ( filename , contentType , options ) ;
147
- key_without_prefix =
147
+ keyWithoutPrefix =
148
148
candidate && typeof candidate . then === 'function' ? await candidate : candidate ;
149
- if ( typeof key_without_prefix !== 'string' || key_without_prefix . trim ( ) . length === 0 ) {
149
+ if ( typeof keyWithoutPrefix !== 'string' || keyWithoutPrefix . trim ( ) . length === 0 ) {
150
150
throw new Error ( 'generateKey must return a non-empty string' ) ;
151
151
}
152
- key_without_prefix = key_without_prefix . trim ( ) ;
152
+ keyWithoutPrefix = keyWithoutPrefix . trim ( ) ;
153
153
}
154
154
155
155
const params = {
156
156
Bucket : this . _bucket ,
157
- Key : this . _bucketPrefix + key_without_prefix ,
157
+ Key : this . _bucketPrefix + keyWithoutPrefix ,
158
158
Body : data ,
159
159
} ;
160
160
@@ -210,12 +210,12 @@ class S3Adapter {
210
210
211
211
let url ;
212
212
if ( config ?. mount && config ?. applicationId ) { // if config has required properties for getFileLocation
213
- url = await this . getFileLocation ( config , key_without_prefix ) ;
213
+ url = await this . getFileLocation ( config , keyWithoutPrefix ) ;
214
214
}
215
215
216
216
return {
217
217
location : location , // actual upload location, used for tests
218
- name : key_without_prefix , // filename in storage, consistent with other adapters
218
+ name : keyWithoutPrefix , // filename in storage, consistent with other adapters
219
219
...url ? { url : url } : { } // url (optionally presigned) or non-direct access url
220
220
} ;
221
221
}
0 commit comments