Hyperlinkv0.8.0-beta.28

Schema

Source effect/Schema.ts:848324 lines
export interface Char extends String {
  readonly "Rebuild": Char
}

/**
 * Schema for strings whose JavaScript `length` is exactly `1`.
 *
 * **When to use**
 *
 * Use to validate string values that must have `length === 1`.
 *
 * **Gotchas**
 *
 * This schema uses JavaScript `String.length`, so visible characters made from
 * multiple UTF-16 code units do not satisfy `length === 1`.
 *
 * @see {@link String} for unconstrained string values
 * @see {@link NonEmptyString} for strings with length greater than zero
 * @see {@link isLengthBetween} for the underlying length check
 *
 * @category string
 * @since 3.10.0
 */
export const Char: Char = String.check(isLengthBetween(1, 1))