25 lines
733 B
JavaScript
25 lines
733 B
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _typeof2 = require('babel-runtime/helpers/typeof');
|
|
|
|
var _typeof3 = _interopRequireDefault(_typeof2);
|
|
|
|
var _rule = require('../rule/');
|
|
|
|
var _rule2 = _interopRequireDefault(_rule);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
function required(rule, value, callback, source, options) {
|
|
var errors = [];
|
|
var type = Array.isArray(value) ? 'array' : typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value);
|
|
_rule2['default'].required(rule, value, source, errors, options, type);
|
|
callback(errors);
|
|
}
|
|
|
|
exports['default'] = required;
|
|
module.exports = exports['default']; |