Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function validateValue(schema, value, properties, customValidationFn) {
const validationSchema = adaptAdditionalRules(schema);
const staticResult = validate(validationSchema, value);
if (staticResult.valid && schema.customValidation && customValidationFn) {
return customValidationFn(schema, value, properties);
}
return staticResult.valid ? null : staticResult.error.message;
}