Indicative compiler to compile validations schema into a highly optimized executable function.
Indicative is a highly performant validation library for Node.js. It achieves this by compiling the schema into a tree and then an a top level executable function.
Table of contents
Install the package from npm registry as follows:
You must use indicative directly. This is a low level module meant to be used by indicative itself.
npm i indicative-compiler# yarnyarn add indicative-compiler
and then use it as follows:
// Do it once for each schemaawait new ValidatorExecutorcompiledFunctions.execdata, VanillaFormatter, , false, false
ValidatorExecutor.exec function takes 5 parameters.
data: The runtime data to validate against the compiled schema.
formatter: Formatter constructor to collect and format error messages.
config: The config to be passed to all the validation functions.
true, it will stop after first error.
execwill return only validated properties.
Following are the autogenerated files via Typedoc