UNPKG

@snups/rjsf-validator-ajv8

Version:
16 lines 1.08 kB
import AJV8PrecompiledValidator from './precompiledValidator.js'; /** Creates and returns a `ValidatorType` interface that is implemented with a precompiled validator. If a `localizer` * is provided, it is used to translate the messages generated by the underlying AJV validation. * * NOTE: The `validateFns` parameter is an object obtained by importing from a precompiled validation file created via * the `compileSchemaValidators()` function. * * @param validateFns - The map of the validation functions that are created by the `compileSchemaValidators()` function * @param rootSchema - The root schema that was used with the `compileSchemaValidators()` function * @param [localizer] - If provided, is used to localize a list of Ajv `ErrorObject`s * @returns - The precompiled validator implementation resulting from the set of parameters provided */ export default function createPrecompiledValidator(validateFns, rootSchema, localizer) { return new AJV8PrecompiledValidator(validateFns, rootSchema, localizer); } //# sourceMappingURL=createPrecompiledValidator.js.map