mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-22 08:03:45 +08:00
12 lines
265 B
TypeScript
12 lines
265 B
TypeScript
type ValidationRule = (value: any) => string | boolean
|
|
|
|
// 必输校验
|
|
export const requiredValidator: ValidationRule = (value: any) => {
|
|
return !!value
|
|
}
|
|
|
|
// 数字校验
|
|
export const numberValidator: ValidationRule = (value: any) => {
|
|
return !isNaN(value)
|
|
}
|