BucketNametypeno test imports ittype BucketName = Brand<string, "s3 bucket name">;The name of a bucket. Made only by parseBucketName.
The name of a bucket, made only by parseBucketName: the rules of the general purpose buckets of S3 that every S3-compatible service also keeps (3 to 63 characters of lower case letters, digits, hyphens and dots, beginning and ending with a letter or a digit, no two dots together, no dot beside a hyphen, not an address of the internet, none of the prefixes and suffixes S3 reserves). A name that passes is safe to put in a URL as it is.
import { parseBucketName } from "./bucket.ts";
parseBucketName("fleet-backup").kind; // "ok"
parseBucketName("Fleet_Backup").kind; // "err"BucketNametypeno test imports ittype BucketName = Brand<string, "s3 bucket name">;The name of a bucket. Made only by parseBucketName.
parseBucketNamefunctionfunction parseBucketName(text: string): Result<BucketName, string>A bucket name from text, or the reason it is not one.