API reference / @evolu/common / Type / SimpleName

Variable: SimpleName

const SimpleName: BrandType<
  BrandType<
    Type<"String", string, string, StringError, string, StringError>,
    "UrlSafeString",
    RegexError<"UrlSafeString">,
    StringError
  >,
  "SimpleName",
  SimpleNameError,
  StringError | RegexError<"UrlSafeString">
>;

Defined in: packages/common/src/Type.ts:1503

Simple alphanumeric string for naming in file systems, URLs, and identifiers.

Uses the same safe alphabet as UrlSafeString (letters, digits, -, _). See UrlSafeString for details.

The string must be between 1 and 42 characters.

Example

const result = SimpleName.from("data-report-123");
if (result.ok) {
  console.log("Valid SimpleName string:", result.value);
} else {
  console.error("Invalid SimpleName string:", result.error);
}

Was this page helpful?