( storageUri: string, )
| 312 | * @param storageUri String to be validated. |
| 313 | */ |
| 314 | export function validateStorageUriFormat( |
| 315 | storageUri: string, |
| 316 | ) { |
| 317 | // storageUri must have format gs://<bucket_name>/<path_to_data> |
| 318 | const gcsPathPattern = /^gs:\/\/([^/]+)\/(.+)$/; |
| 319 | |
| 320 | if (!gcsPathPattern.test(storageUri)) { |
| 321 | throw new Error( |
| 322 | 'The storage URI must be in the format `gs://{bucket_name}/{path_to_data}`.', |
| 323 | ); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | /** |
| 328 | * Returns a file format for an Iceberg table, as specified in the user's config file. |
no test coverage detected