validate.js 333 B

12345678910111213141516
  1. 'use strict';
  2. var Validator = require('../Validator');
  3. /**
  4. * Validate the given template descriptors and
  5. * return a list of errors.
  6. *
  7. * @param {Array<TemplateDescriptor>} descriptors
  8. *
  9. * @return {Array<Error>}
  10. */
  11. module.exports = function validate(descriptors) {
  12. return new Validator().addAll(descriptors).getErrors();
  13. };