API reference@evolu/commonType › lowercased

function lowercased<ParentType>(
  parent: ValidateBrandParent<"Lowercased", ParentType>,
): Type<"Lowercased">;

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

Adds lowercased text validation to an existing string Type.

Narrows the output to TypeScript's Lowercase<string> while preserving the parent Type's constraints. Validation leaves the text unchanged. Use lowercase to change its casing.

Example

import {
  assertErr,
  assertOk,
  lowercased,
  maxLength,
  String,
} from "@evolu/common";

const Label = lowercased(maxLength(50)(String));
assertOk(Label.fromUnknown("hello world"), "hello world");
assertErr(Label.fromUnknown("Hello WORLD"));