INNER CODE UNIT · JavaScript
doValidateAsync
Meteor-Community-Packages/meteor-collection2 · package/collection2/main.js:820
async function doValidateAsync(options) {
const steps = doValidateSteps({ ...options, async: true });
let result = steps.next();
while (!result.done) {
result = steps.next(await executeValidationStep(result.value, true));
}
return result.value;
}
function getErrorObject(context, appendToMessage = '', code, validator) {
validator = validator || C2._getValidatorForSchema(context?.schema);
// If the validator has a getErrorObject method, use it
if (validator && typeof validator.getErrorObject === 'function') {
return validator.getErrorObject(context, appendToMessage, code);
}
// If we get here, it means we couldn't find a validator or the validator doesn't have a getErrorObject method