INNER CODE UNIT · TypeScript

checkNumber

dromara/mayfly-go · frontend/src/components/crontab/index.ts:2

export function checkNumber(value: number, minLimit: number, maxLimit: number) {
    //检查必须为整数
    value = Math.floor(value);
    if (value < minLimit) {
        value = minLimit;
    } else if (value > maxLimit) {
        value = maxLimit;
    }
    return value;
}

export interface CrontabValueObj {
    second: string;
    min: string;
    hour: string;
    day: string;
    mouth: string;
    week: string;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…