API Reference / @evolu/common / Type / createBaseTypeErrorFormatter

Function: createBaseTypeErrorFormatter()

function createBaseTypeErrorFormatter<Error>(): TypeErrorFormatter<Error>;

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

Creates a formatter function for a base TypeError.

This formatter is specifically for Base Types that only need a simple error message indicating that the value is not of the expected type.

Example

export const formatStringError =
  createBaseTypeErrorFormatter<StringError>();

Type Parameters

Type Parameter
Error extends TypeError<Capitalize<string>>

Returns

TypeErrorFormatter<Error>

Was this page helpful?