Skip to content

empty

DDataParser.empty() only validates undefined. It is the building block to express intentionally absent fields or to combine with optional/nullable.

Interactive example

Parameters

  • errorMessage: custom message when the input is not undefined.
  • checkers: checkerRefine to add constraints.
  • coerce: true to convert certain falsy values to undefined. Defaults to false.

Return value

A DataParserEmpty. parse returns DEither.success<undefined> or DEither.error<DataParserError>.

See also

  • date - Parser for dates
  • coerce.* - Coercion functions for various types

Released under the MIT license.