* Create a Blob config from StorageConfig * @throws Error if required properties are missing
(config: StorageConfig)
| 29 | * @throws Error if required properties are missing |
| 30 | */ |
| 31 | function createBlobConfig(config: StorageConfig): BlobConfig { |
| 32 | if (!config.containerName || !config.accountName) { |
| 33 | throw new Error('Blob configuration missing required properties: containerName and accountName') |
| 34 | } |
| 35 | |
| 36 | if (!config.connectionString && !config.accountKey) { |
| 37 | throw new Error( |
| 38 | 'Blob configuration missing authentication: either connectionString or accountKey must be provided' |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | return { |
| 43 | containerName: config.containerName, |
| 44 | accountName: config.accountName, |
| 45 | accountKey: config.accountKey, |
| 46 | connectionString: config.connectionString, |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Create an S3 config from StorageConfig |
no outgoing calls
no test coverage detected