Function
buildObjectKey
(config: S3AdapterConfig, fileName: string)
Source from the content-addressed store, hash-verified
| 26 | } |
| 27 | |
| 28 | function buildObjectKey(config: S3AdapterConfig, fileName: string) { |
| 29 | if (config.objectKey) { |
| 30 | return config.objectKey.replace(/^\/+/, ''); |
| 31 | } |
| 32 | const prefix = config.pathPrefix?.replace(/^\/+/, '').replace(/\/+$/, ''); |
| 33 | return prefix ? `${prefix}/${fileName}` : fileName; |
| 34 | } |
| 35 | |
| 36 | export const s3DestinationAdapter: DestinationAdapterRegistration = { |
| 37 | id: 's3', |
Tested by
no test coverage detected