INNER CODE UNIT · JavaScript

executeValidationStep

Meteor-Community-Packages/meteor-collection2 · package/collection2/main.js:801

  function executeValidationStep(step, async) {
    const method = `${step.operation}${async ? 'Async' : 'Sync'}`;
    if (typeof step.validator[method] !== 'function') {
      throw new Error(
        `${step.validator.name} schemas require Mongo.Collection async mutation methods in Collection2 5`
      );
    }
    return step.validator[method](step.args);
  }

  function doValidateSync(options) {
    const steps = doValidateSteps({ ...options, async: false });
    let result = steps.next();
    while (!result.done) {
      result = steps.next(executeValidationStep(result.value, false));
    }
    return result.value;
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…