in src/framework/Validator.ts [101:114]
export function validateNumberMinMax(a:Assembly, schema:MFieldSchemaAnonymity, value:any, path:string): MValidationResult {
const temp = Number(value)
if(!_.isNil(schema.max)){
if(!_.isFinite(temp) || temp > schema.max) {
return {message: `最多${schema.max}`, path};
}
}
if(!_.isNil(schema.min)){
if(!_.isFinite(temp) || temp < schema.min) {
return {message: `最少${schema.min}`, path};
}
}
return undefined;
}