Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 840 Bytes

File metadata and controls

9 lines (6 loc) · 840 Bytes

Use composable-functions with a custom parser

This simple example can be a reference to adapt composable-functions to any other parser library.

There are two approaches to use composable-functions with a custom parser:

  • Create an adapter function that will receive a schema and return a schema in the shape of a ParserSchena. Example: the adapt function. This is our preferred approach and we wrote a post about it.
  • Create your custom applySchema that will validate your input and context and return a Result. Example: the applyArkSchema function.

Check out the ./src directory to understand how we implemented both approaches with arktype.