(config: unknown)
| 107 | }; |
| 108 | |
| 109 | function ensureS3Config(config: unknown): S3AdapterConfig { |
| 110 | if (!isS3Config(config)) { |
| 111 | throw new ConfigurationError('S3 destination requires a bucket name.', { |
| 112 | configKey: 'bucket', |
| 113 | details: { receivedConfig: typeof config }, |
| 114 | }); |
| 115 | } |
| 116 | return config; |
| 117 | } |
| 118 | |
| 119 | function isS3Config(config: unknown): config is S3AdapterConfig { |
| 120 | if (!config || typeof config !== 'object') { |