Options
All
  • Public
  • Public/Protected
  • All
Menu

@vangware/cron logo

Build Status Coverage License NPM Version Open Issues Size

⏲️ Cron Quartz and Cron UNIX expression parser.

Usage

📦 Node

import { parseStringQuartz, parseCronQuartz } from "@vangware/cron";

const cron = parseStringQuartz("1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10");
/*
{
    seconds: { every: 3, start: { from: 1, to: 2 } },
    minutes: [{ from: 1, to: 2 }, 3, 4],
    hours: "*",
    dayOfMonth: { nearest: 2 },
    month: ["SEP", "OCT"],
    dayOfWeek: { last: 1 },
    year: { every: 10, start: "*" }
}
*/

parseCronQuartz(cron); // "1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10"

🦕 Deno

import { parseStringQuartz, parseCronQuartz } from "https://cdn.skypack.dev/@vangware/cron?dts";

const cron = parseStringQuartz("1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10");
/*
{
    seconds: { every: 3, start: { from: 1, to: 2 } },
    minutes: [{ from: 1, to: 2 }, 3, 4],
    hours: "*",
    dayOfMonth: { nearest: 2 },
    month: ["SEP", "OCT"],
    dayOfWeek: { last: 1 },
    year: { every: 10, start: "*" }
}
*/

parseCronQuartz(cron); // "1-2/3 1-2,3,4 * 2W SEP,OCT 1L */10"

Documentation

Documentation can be found HERE. It is auto-generated with typedoc based on the JSDocs and the types in the source. Shouldn't be necessary to read this, code editors like VSCode integrate the documentation in the UI.

Changelog

Changelog can be found HERE.

Test coverage

Test coverage can be found HERE.

Index

Type aliases

Variables

Functions

Type aliases

CronDayOfMonth

Cron day of month.

CronDayOfMonthValue

CronDayOfMonthValue: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31

Cron day of the month value (1-31).

CronDayOfWeek

Cron day of week.

CronDayOfWeekValue

Cron day of week value (0-7 | SUN-SAT).

CronDayOfWeekValueNumber

CronDayOfWeekValueNumber: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7

Cron day of week number value (0-7).

CronDayOfWeekValueString

CronDayOfWeekValueString: "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT"

Cron day of week string value (SUN-SAT).

CronEvery

CronEvery: typeof CRON_EVERY

Cron every (*).

CronHours

Cron hours.

CronHoursValue

CronHoursValue: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23

Cron hours value (0-23).

CronLast

CronLast: typeof CRON_LAST

Cron every (L).

CronLastValue

CronLastValue: { last: CronDayOfWeekValueNumber }

Cron every ({last}L).

Type declaration

CronList

CronList<Value>: readonly CronListItem<Value>[]

Cron list (value1,value2,valueN).

Type parameters

  • Value

CronListItem

CronListItem<Value>: Value | CronRange<Value> | CronSteps<Value>

Cron list item.

Type parameters

  • Value

CronMinutes

Cron minutes.

CronMinutesValue

CronMinutesValue: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59

Cron minutes value (0-59).

CronMonth

Cron month.

CronMonthValue

Cron month value (1-12 and JAN-DEC).

CronMonthValueNumber

CronMonthValueNumber: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12

Cron month number value (1-12).

CronMonthValueString

CronMonthValueString: "JAN" | "FEB" | "MAR" | "APR" | "MAY" | "JUN" | "JUL" | "AUG" | "SEP" | "OCT" | "NOV" | "DEC"

Cron month string value (JAN-DEC).

CronNearestDayOfMonth

CronNearestDayOfMonth: { nearest: CronDayOfMonthValue }

Nearest day of month ({nearest}W).

Type declaration

CronPart

CronPart<Value>: CronEvery | CronList<Value> | CronRange<Value> | CronSteps<Value> | Value

Cron part.

Type parameters

  • Value

CronPartExtended

CronPartExtended<Value>: CronPart<Value> | CronStartOrBlank | CronLast

Cron part extended (used by CronDayOfWeek and DayOfMonth).

Type parameters

  • Value

CronQuartz

Cron object (Quartz).

CronQuartzExtension

CronQuartzExtension: { seconds: CronSeconds; year: CronYear }

Cron expression parts coming with Quartz.

Type declaration

  • Readonly seconds: CronSeconds

    Cron CronSeconds object.

  • Readonly year: CronYear

    Cron CronYear object.

CronRange

CronRange<Value>: { from: Value; to: Value }

Cron range (from-to).

Type parameters

  • Value

Type declaration

  • Readonly from: Value
  • Readonly to: Value

CronSeconds

Cron seconds.

CronSecondsValue

CronSecondsValue: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59

Cron seconds value (0-59).

CronSpecificDayOfWeek

CronSpecificDayOfWeek: { day: CronDayOfWeekValueNumber; week: CronWeekValue }

Cron specific day of week ({day}#{week}).

Type declaration

CronStartOrBlank

CronStartOrBlank: typeof CRON_START_OR_BLANK

Cron start or blank value (?).

CronSteps

CronSteps<Value>: { every: number; start: Value | CronEvery | CronRange<Value> }

Cron steps (start/every).

Type parameters

  • Value

Type declaration

CronUnix

CronUnix: { dayOfMonth: CronDayOfMonth; dayOfWeek: CronDayOfWeek; hours: CronHours; minutes: CronMinutes; month: CronMonth }

Cron expression (UNIX).

Type declaration

CronValueParser

CronValueParser<Value>: (value: Value) => string | undefined

Parses a value into a string or undefined if invalid.

Type parameters

  • Value

Type declaration

    • (value: Value): string | undefined
    • Parameters

      • value: Value

      Returns string | undefined

CronWeekValue

CronWeekValue: 1 | 2 | 3 | 4 | 5

Cron week value (1-5).

CronYear

Cron year.

CronYearValue

CronYearValue: 1970 | 1971 | 1972 | 1973 | 1974 | 1975 | 1976 | 1977 | 1978 | 1979 | 1980 | 1981 | 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | 1988 | 1989 | 1990 | 1991 | 1992 | 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | 2027 | 2028 | 2029 | 2030 | 2031 | 2032 | 2033 | 2034 | 2035 | 2036 | 2037 | 2038 | 2039 | 2040 | 2041 | 2042 | 2043 | 2044 | 2045 | 2046 | 2047 | 2048 | 2049 | 2050 | 2051 | 2052 | 2053 | 2054 | 2055 | 2056 | 2057 | 2058 | 2059 | 2060 | 2061 | 2062 | 2063 | 2064 | 2065 | 2066 | 2067 | 2068 | 2069 | 2070 | 2071 | 2072 | 2073 | 2074 | 2075 | 2076 | 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | 2083 | 2084 | 2085 | 2086 | 2087 | 2088 | 2089 | 2090 | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099

Cron year value (1970-2099).

LimitTuple

LimitTuple: readonly [lowerLimit: number, upperLimit: number]

Lower and upper limit of a number value.

StringValueParser

StringValueParser<Value>: (value: string) => Value | undefined

Parses a string into a value of given type or undefined if invalid

Type parameters

  • Value

Type declaration

    • (value: string): Value | undefined
    • Parameters

      • value: string

      Returns Value | undefined

Variables

Const CRON_EVERY

CRON_EVERY: "*" = "*"

Const CRON_LAST

CRON_LAST: "L" = "L"

Const CRON_LIST_SEPARATOR

CRON_LIST_SEPARATOR: "," = ","

Const CRON_RANGE_SEPARATOR

CRON_RANGE_SEPARATOR: "-" = "-"

Const CRON_SPECIFIC_SEPARATOR

CRON_SPECIFIC_SEPARATOR: "#" = "#"

Const CRON_START_OR_BLANK

CRON_START_OR_BLANK: "?" = "?"

Const CRON_STEPS_SEPARATOR

CRON_STEPS_SEPARATOR: "/" = "/"

Const QUARTZ_DAY_OF_MONTH_POSITION

QUARTZ_DAY_OF_MONTH_POSITION: 3 = 3

Const QUARTZ_DAY_OF_WEEK_POSITION

QUARTZ_DAY_OF_WEEK_POSITION: 5 = 5

Const QUARTZ_HOURS_POSITION

QUARTZ_HOURS_POSITION: 2 = 2

Const QUARTZ_MINUTES_POSITION

QUARTZ_MINUTES_POSITION: 1 = 1

Const QUARTZ_MONTH_POSITION

QUARTZ_MONTH_POSITION: 4 = 4

Const QUARTZ_SECONDS_POSITION

QUARTZ_SECONDS_POSITION: 0 = 0

Const QUARTZ_YEAR_POSITION

QUARTZ_YEAR_POSITION: 6 = 6

Const UNIX_DAY_OF_MONTH_POSITION

UNIX_DAY_OF_MONTH_POSITION: 2 = 2

Const UNIX_DAY_OF_WEEK_POSITION

UNIX_DAY_OF_WEEK_POSITION: 4 = 4

Const UNIX_HOURS_POSITION

UNIX_HOURS_POSITION: 1 = 1

Const UNIX_MINUTES_POSITION

UNIX_MINUTES_POSITION: 0 = 0

Const UNIX_MONTH_POSITION

UNIX_MONTH_POSITION: 3 = 3

Const isStringDayOfWeekValue

isStringDayOfWeekValue: (Anonymous function) = validateOr([isCronDayOfWeekValueString,isStringDayOfWeekValueNumber])

Check if given is a string representing a CronDayOfWeekValue.

param

Value to check.

Const isStringMonthValue

isStringMonthValue: (Anonymous function) = validateOr([isCronMonthValueString,isStringMonthValueNumber])

Check if given is a string representing a CronMonthValue.

param

Value to check.

Const isStringRange

isStringRange: (Anonymous function) = stringIncludesOnlyOnce(CRON_RANGE_SEPARATOR)

Check if given is a string representing a CronRange.

param

Value to check.

Const isStringSteps

isStringSteps: (Anonymous function) = stringIncludesOnlyOnce(CRON_STEPS_SEPARATOR)

Check if given is a string representing a CronSteps.

param

Value to check.

Const parseCronHours

parseCronHours: (Anonymous function) = parseCronPart([0, 24])(parseCronHoursValue)

Parses CronHours into a string.

param

CronHours to be parsed.

returns

A string or undefined if invalid.

Const parseCronMinutes

parseCronMinutes: (Anonymous function) = parseCronPart([0, 59])(parseCronMinutesValue)

Parses CronMinutes into a string.

param

CronMinutes to be parsed.

returns

A string or undefined if invalid.

Const parseCronMonth

parseCronMonth: (Anonymous function) = parseCronPart([0, 12])(parseCronMonthValue)

Parses CronMonth into a string.

param

CronMonth to be parsed.

returns

A string or undefined if invalid.

Const parseCronSeconds

parseCronSeconds: (Anonymous function) = parseCronPart([0, 59])(parseCronSecondsValue)

Parses CronSeconds into a string.

param

CronSeconds to be parsed.

returns

A string or undefined if invalid.

Const parseCronYear

parseCronYear: (Anonymous function) = parseCronPart([0, 129])(parseCronYearValue)

Parses CronYear into a string.

param

CronYear to be parsed.

returns

A string or undefined if invalid.

Const parseStringHours

parseStringHours: (Anonymous function) = parseStringPart([0, 24])(parseStringHoursValue)

Parses a string into a CronHours.

param

string to be parsed.

returns

A CronHours or undefined if invalid.

Const parseStringMinutes

parseStringMinutes: (Anonymous function) = parseStringPart([0, 59])(parseStringMinutesValue)

Parses a string into a CronMinutes.

param

string to be parsed.

returns

A CronMinutes or undefined if invalid.

Const parseStringMonth

parseStringMonth: (Anonymous function) = parseStringPart([0, 12])(parseStringMonthValue)

Parses a string into a CronMonth.

param

string to be parsed.

returns

A CronMonth or undefined if invalid.

Const parseStringSeconds

parseStringSeconds: (Anonymous function) = parseStringPart([0, 59])(parseStringSecondsValue)

Parses a string into a CronSeconds.

param

string to be parsed.

returns

A CronSeconds or undefined if invalid.

Const parseStringYear

parseStringYear: (Anonymous function) = parseStringPart([0, 129])(parseStringYearValue)

Parses a string into a CronYear.

param

string to be parsed.

returns

A CronYear or undefined if invalid.

Functions

Const isCronDayOfMonthValue

  • isCronDayOfMonthValue(value: unknown): value is CronDayOfMonthValue

Const isCronDayOfWeekValue

  • isCronDayOfWeekValue(value: unknown): value is CronDayOfWeekValue

Const isCronDayOfWeekValueNumber

  • isCronDayOfWeekValueNumber(value: unknown): value is CronDayOfWeekValueNumber

Const isCronDayOfWeekValueString

  • isCronDayOfWeekValueString(value: unknown): value is CronDayOfWeekValueString

Const isCronEvery

  • isCronEvery(value: unknown): value is CronEvery

Const isCronHoursValue

  • isCronHoursValue(value: unknown): value is CronHoursValue

Const isCronLast

  • isCronLast(value: unknown): value is CronLast
  • Check if given is CronLast.

    Parameters

    • value: unknown

      Value to check.

    Returns value is CronLast

Const isCronLastValue

  • isCronLastValue(value: unknown): value is CronLastValue

Const isCronList

  • isCronList<Value>(value: unknown): value is CronList<Value>
  • Check if given is CronList.

    Type parameters

    • Value

    Parameters

    • value: unknown

      Value to check.

    Returns value is CronList<Value>

Const isCronMinutesValue

  • isCronMinutesValue(value: unknown): value is CronMinutesValue

Const isCronMonthValue

  • isCronMonthValue(value: unknown): value is CronMonthValue

Const isCronMonthValueNumber

  • isCronMonthValueNumber(value: unknown): value is CronMonthValueNumber

Const isCronMonthValueString

  • isCronMonthValueString(value: unknown): value is CronMonthValueString

Const isCronNearestDayOfMonth

  • isCronNearestDayOfMonth(value: unknown): value is CronNearestDayOfMonth

Const isCronRange

  • isCronRange<Value>(value: unknown): value is CronRange<Value>
  • Check if given is CronRange.

    Type parameters

    • Value

    Parameters

    • value: unknown

      Value to check.

    Returns value is CronRange<Value>

Const isCronSecondsValue

  • isCronSecondsValue(value: unknown): value is CronSecondsValue

Const isCronSpecificDayOfWeek

  • isCronSpecificDayOfWeek(value: unknown): value is CronSpecificDayOfWeek

Const isCronStartOrBlank

  • isCronStartOrBlank(value: unknown): value is CronStartOrBlank

Const isCronSteps

  • isCronSteps<Value>(value: unknown): value is CronSteps<Value>
  • Check if given is CronSteps.

    Type parameters

    • Value

    Parameters

    • value: unknown

      Value to check.

    Returns value is CronSteps<Value>

Const isCronWeekValue

  • isCronWeekValue(value: unknown): value is CronWeekValue

Const isCronYearValue

  • isCronYearValue(value: unknown): value is CronYearValue

Const isStringDayOfMonthValue

  • isStringDayOfMonthValue(value: unknown): value is string

Const isStringDayOfWeekValueNumber

  • isStringDayOfWeekValueNumber(value: unknown): value is string

Const isStringHoursValue

  • isStringHoursValue(value: unknown): value is string

Const isStringLastValue

  • isStringLastValue(value: unknown): value is string
  • Check if given is a string representing a CronLastValue.

    Parameters

    • value: unknown

      Value to check.

    Returns value is string

Const isStringList

  • isStringList(value: unknown): value is string
  • Check if given is a string representing a CronList.

    Parameters

    • value: unknown

      Value to check.

    Returns value is string

Const isStringMinutesValue

  • isStringMinutesValue(value: unknown): value is string

Const isStringMonthValueNumber

  • isStringMonthValueNumber(value: unknown): value is string

Const isStringNearestDayOfMonth

  • isStringNearestDayOfMonth(value: unknown): value is string

Const isStringSecondsValue

  • isStringSecondsValue(value: unknown): value is string

Const isStringSpecificDayOfWeek

  • isStringSpecificDayOfWeek(value: unknown): value is string

Const isStringWeekValue

  • isStringWeekValue(value: unknown): value is string
  • Check if given is a string representing a CronWeekValue.

    Parameters

    • value: unknown

      Value to check.

    Returns value is string

Const isStringYearValue

  • isStringYearValue(value: unknown): value is string
  • Check if given is a string representing a CronYearValue.

    Parameters

    • value: unknown

      Value to check.

    Returns value is string

Const parseCronDayOfMonth

Const parseCronDayOfMonthValue

Const parseCronDayOfWeek

Const parseCronDayOfWeekValue

Const parseCronEvery

  • parseCronEvery(source: CronEvery | string): undefined | "*"
  • Parses a CronEvery into a string.

    Parameters

    • source: CronEvery | string

      CronEvery to be parsed.

    Returns undefined | "*"

    A string or undefined if invalid.

Const parseCronHoursValue

Const parseCronLast

  • parseCronLast(source: CronLast | string): undefined | "L"
  • Parses CronLast into a string.

    Parameters

    • source: CronLast | string

      CronLast to be parsed.

    Returns undefined | "L"

    A string or undefined if invalid.

Const parseCronLastValue

Const parseCronList

  • parseCronList(limit: LimitTuple): (Anonymous function)
  • Parses CronList into a string.

    Parameters

    • limit: LimitTuple

      LimitTuple to be used when parsing CronSteps.

    Returns (Anonymous function)

    Curried function with limit on context.

Const parseCronMinutesValue

Const parseCronMonthValue

Const parseCronNearestDayOfMonth

Const parseCronPart

  • parseCronPart(limit: LimitTuple): (Anonymous function)
  • Parses CronPart into a string.

    Parameters

    • limit: LimitTuple

      LimitTuple to be used when parsing CronSteps.

    Returns (Anonymous function)

    Curried function with limit on context.

Const parseCronQuartz

Const parseCronRange

  • parseCronRange<Value>(parser: CronValueParser<Value>): (Anonymous function)
  • Parses CronRange into a string.

    Type parameters

    • Value

    Parameters

    Returns (Anonymous function)

    Curried function with parser in context.

Const parseCronSecondsValue

Const parseCronSpecificDayOfWeek

Const parseCronStartOrBlank

Const parseCronSteps

  • parseCronSteps(__namedParameters: [number, number]): (Anonymous function)
  • Parses CronSteps into a string.

    Parameters

    • __namedParameters: [number, number]

    Returns (Anonymous function)

    Curried function with limit on context.

Const parseCronUnix

Const parseCronYearValue

Const parseStringDayOfMonth

Const parseStringDayOfMonthValue

  • parseStringDayOfMonthValue(source: string): undefined | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31
  • Parses a string into a CronDayOfMonthValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31

    A CronDayOfMonthValue or undefined if invalid.

Const parseStringDayOfWeek

  • parseStringDayOfWeek(source: string): CronDayOfWeek | undefined

Const parseStringDayOfWeekValue

  • parseStringDayOfWeekValue(source: string): undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT"
  • Parses a string into a CronDayOfWeekValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT"

    A CronDayOfWeekValue or undefined if invalid.

Const parseStringHoursValue

  • parseStringHoursValue(source: string): undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23
  • Parses a string into a CronHoursValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23

    A CronHoursValue or undefined if invalid.

Const parseStringLastValue

  • parseStringLastValue(source: string): CronLastValue | undefined

Const parseStringList

  • parseStringList(limit: LimitTuple): (Anonymous function)
  • Parses a string into a CronList.

    Parameters

    • limit: LimitTuple

      LimitTuple to be used when parsing CronSteps.

    Returns (Anonymous function)

    Curried function with limit in context.

Const parseStringMinutesValue

  • parseStringMinutesValue(source: string): undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59
  • Parses a string into a CronMinutesValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59

    A CronMinutesValue or undefined if invalid.

Const parseStringMonthValue

  • parseStringMonthValue(source: string): undefined | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "JAN" | "FEB" | "MAR" | "APR" | "MAY" | "JUN" | "JUL" | "AUG" | "SEP" | "OCT" | "NOV" | "DEC"
  • Parses a string into a CronMonthValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "JAN" | "FEB" | "MAR" | "APR" | "MAY" | "JUN" | "JUL" | "AUG" | "SEP" | "OCT" | "NOV" | "DEC"

    A CronMonthValue or undefined if invalid.

Const parseStringNearestDayOfMonth

Const parseStringPart

  • parseStringPart(limit: LimitTuple): (Anonymous function)
  • Parses a string into a CronPart.

    Parameters

    • limit: LimitTuple

      LimitTuple to be used when parsing CronSteps.

    Returns (Anonymous function)

    Curried function with limit in context.

Const parseStringQuartz

  • parseStringQuartz(source: string): CronQuartz | undefined

Const parseStringQuartzExpression

  • parseStringQuartzExpression(source: string): undefined | [string, string, string, string, string, string, string]
  • Parses given string expression.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | [string, string, string, string, string, string, string]

    An array of 7 elements or undefined if invalid.

Const parseStringRange

  • Parses a string into a CronRange.

    Type parameters

    • Value

    Parameters

    Returns (Anonymous function)

    Curried function with parser in context.

Const parseStringSecondsValue

  • parseStringSecondsValue(source: string): undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59
  • Parses a string into a CronSecondsValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59

    A CronSecondsValue or undefined if invalid.

Const parseStringSpecificDayOfWeek

Const parseStringSteps

  • parseStringSteps(__namedParameters: [number, number]): (Anonymous function)
  • Parses a string into a CronSteps.

    Parameters

    • __namedParameters: [number, number]

    Returns (Anonymous function)

    Curried function with limit in context.

Const parseStringUnix

  • parseStringUnix(source: string): CronUnix | undefined
  • Parses a string into a CronUnix.

    Parameters

    • source: string

      string to be parsed.

    Returns CronUnix | undefined

    A CronUnix or undefined if invalid.

Const parseStringUnixExpression

  • parseStringUnixExpression(source: string): undefined | [string, string, string, string, string]
  • Parses given expression or undefined if invalid.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | [string, string, string, string, string]

    An array of 5 elements or undefined if invalid.

Const parseStringYearValue

  • parseStringYearValue(source: string): undefined | 1970 | 1971 | 1972 | 1973 | 1974 | 1975 | 1976 | 1977 | 1978 | 1979 | 1980 | 1981 | 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | 1988 | 1989 | 1990 | 1991 | 1992 | 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | 2027 | 2028 | 2029 | 2030 | 2031 | 2032 | 2033 | 2034 | 2035 | 2036 | 2037 | 2038 | 2039 | 2040 | 2041 | 2042 | 2043 | 2044 | 2045 | 2046 | 2047 | 2048 | 2049 | 2050 | 2051 | 2052 | 2053 | 2054 | 2055 | 2056 | 2057 | 2058 | 2059 | 2060 | 2061 | 2062 | 2063 | 2064 | 2065 | 2066 | 2067 | 2068 | 2069 | 2070 | 2071 | 2072 | 2073 | 2074 | 2075 | 2076 | 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | 2083 | 2084 | 2085 | 2086 | 2087 | 2088 | 2089 | 2090 | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099
  • Parses a string into a CronYearValue.

    Parameters

    • source: string

      string to be parsed.

    Returns undefined | 1970 | 1971 | 1972 | 1973 | 1974 | 1975 | 1976 | 1977 | 1978 | 1979 | 1980 | 1981 | 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | 1988 | 1989 | 1990 | 1991 | 1992 | 1993 | 1994 | 1995 | 1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | 2027 | 2028 | 2029 | 2030 | 2031 | 2032 | 2033 | 2034 | 2035 | 2036 | 2037 | 2038 | 2039 | 2040 | 2041 | 2042 | 2043 | 2044 | 2045 | 2046 | 2047 | 2048 | 2049 | 2050 | 2051 | 2052 | 2053 | 2054 | 2055 | 2056 | 2057 | 2058 | 2059 | 2060 | 2061 | 2062 | 2063 | 2064 | 2065 | 2066 | 2067 | 2068 | 2069 | 2070 | 2071 | 2072 | 2073 | 2074 | 2075 | 2076 | 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | 2083 | 2084 | 2085 | 2086 | 2087 | 2088 | 2089 | 2090 | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2098 | 2099

    A CronYearValue or undefined if invalid.

Const splitExpression

  • splitExpression(source: string): string[]
  • Splits given string by spaces (even if multiple).

    Parameters

    • source: string

      string to be parsed.

    Returns string[]

    An array with all elements of the given expression.

Const stringIncludesOnlyOnce

  • stringIncludesOnlyOnce(search: string): (Anonymous function)
  • Checks if given search value appears just onces in given value.

    Parameters

    • search: string

      Value to search.

    Returns (Anonymous function)

    Curried function with search in context.

Const validateOr

  • validateOr(validations: readonly ((value: unknown) => boolean)[]): (Anonymous function)
  • Run several validations in the same string, true if any is true.

    Parameters

    • validations: readonly ((value: unknown) => boolean)[]

      List of validations.

    Returns (Anonymous function)

    Curried function with validations in context.

Legend

Generated using TypeDoc