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

Function validateIcebergConfigTableFolderSubpath

cli/util.ts:202–211  ·  view source on GitHub ↗
(tableFolderSubpath: string)

Source from the content-addressed store, hash-verified

200 * - Cannot contain "../".
201 */
202export function validateIcebergConfigTableFolderSubpath(tableFolderSubpath: string): void {
203 if (!/^[a-zA-Z0-9][a-zA-Z0-9-._/]{1,220}[a-zA-Z0-9]$/.test(tableFolderSubpath) || tableFolderSubpath.includes("..")) {
204 throw new Error(
205 "Invalid input. Must start and end with a letter or number, contain only letters (a-z, A-Z), numbers, hyphens (-), underscores (_), periods (.), and forward slashes (/). The sequence '..' is also disallowed."
206 );
207 }
208 if (tableFolderSubpath.includes("./") || tableFolderSubpath.includes("../")) {
209 throw new Error("Input cannot contain './' or '../'.");
210 }
211}
212
213export const ICEBERG_BUCKET_NAME_HINT = "The bucket name must comply with https://cloud.google.com/storage/docs/buckets#naming. If you do not want to provide a workflow-level default bucket name, leave this input empty.\n";
214export const ICEBERG_TABLE_FOLDER_ROOT_HINT = "Table folder root must start and end with a letter or a number. It can only contain letters, numbers, hyphens, underscores and periods. If you do not want to provide a workflow_level default table folder root, leave this input empty.\n"

Callers 2

util_test.tsFile · 0.90
promptForIcebergConfigFunction · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected