API Reference / @evolu/common / Type / SimpleName

Variable: SimpleName

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

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

Simple alphanumeric string for naming.

A SimpleName string uses a limited, safe alphabet for naming purposes:

  • Uppercase letters (A-Z)
  • Lowercase letters (a-z)
  • Digits (0-9)
  • Dash (-)

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?