Function parseCronPart

  • Parses CronPart into a string.

    Example

    const parseCronPartSeconds = parseCronPart([0, 59])(parseCronSecondsValue);

    parseCronPartSeconds("*"); // "*"
    parseCronPartSeconds([13, 10]); // "13,10"
    parseCronPartSeconds([{ from: 13, to: 10 }, 10]); // "13-10,10"
    parseCronPartSeconds([{ every: 10, start: 13 }, 10]); // "13/10,10"
    parseCronPartSeconds([{ every: 99, start: 13 }, 10]); // undefined
    parseCronPartSeconds([{
    every: 10,
    start: { from: 13, to: 10 } }, 10
    ]); // "13-10/10,10"
    parseCronPartSeconds([{ every: 10, start: "?" }, 10]); // "?/10,10"
    parseCronPartSeconds({ every: 10, start: 13 }); // "13/10"
    parseCronPartSeconds({
    every: 10,
    start: { from: 13, to: 10 },
    }); // "13-10/10"
    parseCronPartSeconds({ every: 10, start: "?" }); // "?/10"
    parseCronPartSeconds({
    from: 13,
    to: 10,
    }); // "13-10"

    Returns

    Curried function with limit on context.

    Parameters

    • limit: LimitTuple

      LimitTuple to be used when parsing CronSteps.

    Returns (<Value>(parser: CronValueParser<Value>) => ((source: "*" | Value | CronList<Value> | CronRange<Value> | CronSteps<Value>) => Maybe<string>))