MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / valid

Method valid

mini_program/common/Validate.js:71–80  ·  view source on GitHub ↗
(value, param)

Source from the content-addressed store, hash-verified

69 */
70 required: {
71 valid(value, param) {
72 if (!that.depend(param)) {
73 return 'dependency-mismatch'
74 } else if (typeof value === 'number') {
75 value = value.toString()
76 } else if (typeof value === 'boolean') {
77 return !0
78 }
79 return value.length > 0
80 },
81 message(param) {
82 return param.message || '这是必填字段。';
83 }

Callers 3

checkFormMethod · 0.95
optionalMethod · 0.80
checkParamMethod · 0.80

Calls 3

sizeMethod · 0.95
dependMethod · 0.80
optionalMethod · 0.80

Tested by

no test coverage detected