1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1× 1× 1× 16× 16× 16× 22× 15× | import Validators from './index' import { prepareMsg, prepare, memoize } from './helpers' import { isFileList } from "./file"; let absence = memoize(function ({ message, msg, 'if': ifCond, unless }={}) { msg = msg || message return prepare(ifCond, unless, false, function (value) { if ('string' === typeof value ? value.trim() : isFileList(value) && !isNaN(value.length) ? value.length : value) { return Validators.formatMessage(prepareMsg(msg, 'absence')) } }) }) export default absence |