You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
307 B
7 lines
307 B
4 weeks ago
|
export const checkBucketName = (name: string, createBucket = false): void => {
|
||
|
const bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;
|
||
|
if (!bucketRegex.test(name)) {
|
||
|
throw new Error('The bucket must be conform to the specifications');
|
||
|
}
|
||
|
};
|