Skip to content

nil ​

DDataParser.nil() only accepts null. Useful to explicitly describe fields that must be null or to combine with optional/nullable.

Interactive example ​

Parameters ​

  • errorMessage: custom message when the input is not null.
  • checkers: checkerRefine to add business logic.
  • coerce: true to convert undefined/"null" to null. Defaults to false.

Return value ​

A DataParserNil. schema.parse(data) returns DEither.success<null> or DEither.error<DataParserError>.

Other examples ​

Extended mode ​

See also ​

Released under the MIT license.