MCPcopy Create free account
hub / github.com/dataform-co/dataform / validateStorageUriFormat

Function validateStorageUriFormat

core/utils.ts:314–325  ·  view source on GitHub ↗
(
  storageUri: string,
)

Source from the content-addressed store, hash-verified

312 * @param storageUri String to be validated.
313 */
314export 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.

Callers 3

utils_test.tsFile · 0.90
compileMethod · 0.90
compileMethod · 0.90

Calls 1

testMethod · 0.80

Tested by

no test coverage detected