Initial commit: 云印享后台管理系统

This commit is contained in:
2026-03-29 18:23:02 +08:00
commit f685a8aeed
23346 changed files with 2302962 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import rules from "../rule";
import { isEmptyValue } from "../util";
var ENUM = 'enum';
var enumerable = function enumerable(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== undefined) {
rules[ENUM](rule, value, source, errors, options);
}
}
callback(errors);
};
export default enumerable;