first commit
This commit is contained in:
9
frontend/node_modules/@rc-component/async-validator/es/rule/enum.js
generated
vendored
Normal file
9
frontend/node_modules/@rc-component/async-validator/es/rule/enum.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { format } from "../util";
|
||||
var ENUM = 'enum';
|
||||
var enumerable = function enumerable(rule, value, source, errors, options) {
|
||||
rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
|
||||
if (rule[ENUM].indexOf(value) === -1) {
|
||||
errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
|
||||
}
|
||||
};
|
||||
export default enumerable;
|
||||
Reference in New Issue
Block a user