Function parseStringPart

  • Parses a string into a CronPart.

    Example

    const parseStringPartSeconds = parseStringPart([0, 59])(
    parseStringSecondsValue,
    );

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

    Returns

    Curried function with limit in context.

    Parameters

    • limit: LimitTuple

      LimitTuple to be used when parsing CronSteps.

    Returns (<Value>(parser: StringValueParser<Value>) => ((source: string) => Maybe<CronPart<Value>>))