You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
733 B
25 lines
733 B
1 month ago
|
'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'];
|