required.js 378 B

1234567891011
  1. import _typeof from 'babel-runtime/helpers/typeof';
  2. import rules from '../rule/';
  3. function required(rule, value, callback, source, options) {
  4. var errors = [];
  5. var type = Array.isArray(value) ? 'array' : typeof value === 'undefined' ? 'undefined' : _typeof(value);
  6. rules.required(rule, value, source, errors, options, type);
  7. callback(errors);
  8. }
  9. export default required;