Cron Reference
⏲️ Cron Quartz and Cron UNIX expression parser.
Usage
📦 Node
Install @lou.codes/cron
as a dependency:
Import it and use it:
🦕 Deno
Import @lou.codes/cron
using the npm:
prefix, and use it directly:
🌎 Browser
Import @lou.codes/cron
using esm.sh, and use it directly:
Useful links
- 📝 Documentation: TypeDoc generated documentation.
- ⏳ Changelog: List of changes between versions.
- ✅ Tests Coverage: Coveralls page with tests coverage.
To do
A big change is coming with stricter types and a better DX. Stay tuned.
Common
splitExpression()
Splits given string by spaces (even if multiple).
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
string
[]
An array with all elements of the given expression.
Example
validateOr()
Run several validations in the same string, true if any is true.
Parameters
Parameter | Type | Description |
---|---|---|
…validations | readonly (value : unknown ) => boolean [] | List of validations. |
Returns
Function
Curried function with validations
in context.
Parameters
Parameter | Type |
---|---|
value | unknown |
Returns
boolean
Example
Other
CronDayOfMonth
Cron day of month.
CronDayOfMonthValue
Cron day of the month value (1-31).
CronDayOfWeek
Cron day of week.
CronDayOfWeekValue
Cron day of week value (0-7 | SUN-SAT).
CronDayOfWeekValueNumber
Cron day of week number value (0-7).
CronDayOfWeekValueString
Cron day of week string value (SUN-SAT).
CronEvery
Cron every (*).
CronHours
Cron hours.
CronHoursValue
Cron hours value (0-23).
CronLast
Cron every (L).
CronLastValue
Cron last object. It gets turned into the string ${last}L
.
Type declaration
Member | Type |
---|---|
last | CronDayOfWeekValueNumber |
CronList<Value>
Cron list (value1,value2,valueN).
Type parameters
Type parameter |
---|
Value |
CronListItem<Value>
Cron list item.
Type parameters
Type parameter |
---|
Value |
CronMinutes
Cron minutes.
CronMinutesValue
Cron minutes value (0-59).
CronMonth
Cron month.
CronMonthValue
Cron month value (1-12 and JAN-DEC).
CronMonthValueNumber
Cron month number value (1-12).
CronMonthValueString
Cron month string value (JAN-DEC).
CronNearest
Cron every (W).
CronNearestDayOfMonth
Nearest day of month object It gets turned into the string ${nearest}W
.
Type declaration
Member | Type |
---|---|
nearest | CronDayOfMonthValue |
CronPart<Value>
Cron part.
Type parameters
Type parameter |
---|
Value |
CronPartExtended<Value>
Cron part extended (used by CronDayOfWeek
and DayOfMonth
).
Type parameters
Type parameter |
---|
Value |
CronQuartz
Cron object (Quartz).
CronQuartzExtension
Cron expression parts coming with Quartz.
Type declaration
Member | Type | Description |
---|---|---|
seconds | CronSeconds | Cron CronSeconds object. |
year | CronYear | Cron CronYear object. |
CronRange<Value>
Cron range (from-to).
Type parameters
Type parameter |
---|
Value |
Type declaration
Member | Type |
---|---|
from | Value |
to | Value |
CronSeconds
Cron seconds.
CronSecondsValue
Cron seconds value (0-59).
CronSpecificDayOfWeek
Cron specific day of week object. It gets turned into the string
${day}#${week}
.
Type declaration
Member | Type |
---|---|
day | CronDayOfWeekValueNumber |
week | CronWeekValue |
CronStartOrBlank
Cron start or blank value (?).
CronSteps<Value>
Cron steps (start/every).
Type parameters
Type parameter |
---|
Value |
Type declaration
Member | Type |
---|---|
every | number |
start | CronEvery | CronRange <Value > | Value |
CronUnix
Cron expression (UNIX).
Type declaration
Member | Type | Description |
---|---|---|
dayOfMonth | CronDayOfMonth | Cron CronDayOfMonth object. |
dayOfWeek | CronDayOfWeek | Cron CronDayOfWeek object. |
hours | CronHours | Cron CronHours object. |
minutes | CronMinutes | Cron CronMinutes object. |
month | CronMonth | Cron CronMonth object. |
CronValueParser<Value>
Parses a value into a string or undefined
if invalid.
Type parameters
Type parameter |
---|
Value |
CronWeekValue
Cron week value (1-5).
CronYear
Cron year.
CronYearValue
Cron year value (1970-2099).
LimitTuple
Lower and upper limit of a number value.
StringValueParser<Value>
Parses a string into a value of given type or undefined
if invalid
Type parameters
Type parameter |
---|
Value |
CRON_EVERY
CRON_LAST
CRON_LIST_SEPARATOR
CRON_NEAREST
CRON_RANGE_SEPARATOR
CRON_SPECIFIC_SEPARATOR
CRON_START_OR_BLANK
CRON_STEPS_SEPARATOR
QUARTZ_DAY_OF_MONTH_POSITION
QUARTZ_DAY_OF_WEEK_POSITION
QUARTZ_HOURS_POSITION
QUARTZ_MINUTES_POSITION
QUARTZ_MONTH_POSITION
QUARTZ_SECONDS_POSITION
QUARTZ_YEAR_POSITION
UNIX_DAY_OF_MONTH_POSITION
UNIX_DAY_OF_WEEK_POSITION
UNIX_HOURS_POSITION
UNIX_MINUTES_POSITION
UNIX_MONTH_POSITION
isCronSecondsValue()
Check if given is CronSecondsValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronSecondsValue
Returns true
if is CronSecondsValue
, false
otherwise.
Example
Parsers
parseCronDayOfMonth()
Parses CronDayOfMonth
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | CronDayOfMonth | CronDayOfMonth to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronDayOfMonthValue()
Parses CronDayOfMonthValue
into a string.
Parameters
Parameter | Type |
---|---|
input | CronDayOfMonthValue |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronDayOfWeek()
Parses CronDayOfWeek
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | CronDayOfWeek | CronDayOfWeek to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronDayOfWeekValue()
Parses CronDayOfWeekValue
into a string.
Parameters
Parameter | Type |
---|---|
input | CronDayOfWeekValue |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronEvery()
Parses a CronEvery
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | CronEvery to be parsed. |
Returns
undefined
| "*"
A string or undefined
if invalid.
Example
parseCronHours()
Parses CronHours
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | | "*" | CronHoursValue | CronList <CronHoursValue > | CronRange <CronHoursValue > | CronSteps <CronHoursValue > | CronHours to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronHoursValue()
Parses CronHoursValue
into a string.
Parameters
Parameter | Type |
---|---|
input | CronHoursValue |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronLast()
Parses CronLast
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | CronLast to be parsed. |
Returns
undefined
| "L"
A string or undefined
if invalid.
Example
parseCronLastValue()
Parses CronLastValue
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | CronLastValue | CronLastValue to be parsed. |
Returns
undefined
| string
A string or undefined
if invalid.
Example
parseCronList()
Parses CronList
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
limit | LimitTuple | LimitTuple to be used when parsing CronSteps . |
Returns
Function
Curried function with limit
on context.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type |
---|---|
parser | CronValueParser <Value > |
Returns
Function
Parameters
Parameter | Type |
---|---|
source | CronList <Value > |
Returns
undefined
| string
Example
parseCronMinutes()
Parses CronMinutes
into a string.
Type parameters
Type parameter |
---|
Source extends number |
Parameters
Parameter | Type | Description |
---|---|---|
source | | "*" | Source | CronList <Source > | CronRange <Source > | CronSteps <Source > | CronMinutes to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronMinutesValue()
Parses CronMinutesValue
into a string.
Type parameters
Type parameter |
---|
Source extends number |
Parameters
Parameter | Type | Description |
---|---|---|
source | Source | CronMinutesValue to be parsed. |
Returns
Source
extends
CronMinutesValue
?
`${Source<Source>}` : Maybe
< | "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 string or undefined
if invalid.
Example
parseCronMonth()
Parses CronMonth
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | | "*" | CronMonthValue | CronList <CronMonthValue > | CronRange <CronMonthValue > | CronSteps <CronMonthValue > | CronMonth to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronMonthValue()
Parses CronMonthValue
into a string.
Parameters
Parameter | Type |
---|---|
input | CronMonthValue |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronNearestDayOfMonth()
Parses CronNearestDayOfMonth
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | CronNearestDayOfMonth | CronNearestDayOfMonth to be parsed. |
Returns
undefined
| string
A string or undefined
if invalid.
Example
parseCronPart()
Parses CronPart
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
limit | LimitTuple | LimitTuple to be used when parsing CronSteps . |
Returns
Function
Curried function with limit
on context.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type |
---|---|
parser | CronValueParser <Value > |
Returns
Function
Parameters
Parameter | Type |
---|---|
source | | "*" | Value | CronList <Value > | CronRange <Value > | CronSteps <Value > |
Returns
Maybe
<string
>
Example
parseCronQuartz()
Parses CronQuartz
into a string.
Parameters
Parameter | Type |
---|---|
cronQuartz | CronQuartz |
Returns
undefined
| string
A string or undefined
if invalid.
Example
parseCronRange()
Parses CronRange
into a string.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type | Description |
---|---|---|
parser | CronValueParser <Value > | CronValueParser for CronRange . |
Returns
Function
Curried function with parser
in context.
Parameters
Parameter | Type |
---|---|
source | CronRange <Value > |
Returns
undefined
| string
Example
parseCronSeconds()
Parses CronSeconds
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | | "*" | CronSecondsValue | CronList <CronSecondsValue > | CronRange <CronSecondsValue > | CronSteps <CronSecondsValue > | CronSeconds to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronSecondsValue()
Parses CronSecondsValue
into a string.
Parameters
Parameter | Type |
---|---|
input | CronSecondsValue |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronSpecificDayOfWeek()
Parses CronSpecificDayOfWeek
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | CronSpecificDayOfWeek | CronSpecificDayOfWeek to be parsed. |
Returns
undefined
| string
A string or undefined
if invalid.
Example
parseCronStartOrBlank()
Parses CronStartOrBlank
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | CronStartOrBlank to be parsed. |
Returns
undefined
| "?"
A string or undefined
if invalid.
Example
parseCronSteps()
Parses CronSteps
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
limit | LimitTuple | LimitTuple to be used when parsing CronSteps . |
Returns
Function
Curried function with limit
on context.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type |
---|---|
parser | CronValueParser <Value > |
Returns
Function
Parameters
Parameter | Type |
---|---|
source | CronSteps <Value > |
Returns
undefined
| string
Example
parseCronUnix()
Parses Cron
(UNIX) into a string.
Parameters
Parameter | Type |
---|---|
cronUnix | CronUnix |
Returns
undefined
| string
A string or undefined
if invalid.
Example
parseCronYear()
Parses CronYear
into a string.
Parameters
Parameter | Type | Description |
---|---|---|
source | | "*" | CronYearValue | CronList <CronYearValue > | CronRange <CronYearValue > | CronSteps <CronYearValue > | CronYear to be parsed. |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseCronYearValue()
Parses CronYearValue
into a string.
Parameters
Parameter | Type |
---|---|
input | CronYearValue |
Returns
Maybe
<string
>
A string or undefined
if invalid.
Example
parseStringDayOfMonth()
Parses a string into a CronDayOfMonth
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronDayOfMonth
>
A CronDayOfMonth
or undefined
if invalid.
Example
parseStringDayOfMonthValue()
Parses a string into a CronDayOfMonthValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronDayOfMonthValue
>
A CronDayOfMonthValue
or undefined
if invalid.
Example
parseStringDayOfWeek()
Parses a string into a CronDayOfWeek
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | String to be parsed. |
Returns
Maybe
<CronDayOfWeek
>
A CronDayOfWeek
or undefined
if invalid.
Example
parseStringDayOfWeekValue()
Parses a string into a CronDayOfWeekValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronDayOfWeekValue
>
A CronDayOfWeekValue
or undefined
if invalid.
Example
parseStringHours()
Parses a string into a CronHours
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronPart
<CronHoursValue
>>
A CronHours
or undefined
if invalid.
Example
parseStringHoursValue()
Parses a string into a CronHoursValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronHoursValue
>
A CronHoursValue
or undefined
if invalid.
Example
parseStringLastValue()
Parses a string into a CronLastValue
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronLastValue
>
A CronLastValue
or undefined
if invalid.
Example
parseStringList()
Parses a string into a CronList
.
Parameters
Parameter | Type | Description |
---|---|---|
limit | LimitTuple | LimitTuple to be used when parsing CronSteps . |
Returns
Function
Curried function with limit
in context.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type |
---|---|
parser | StringValueParser <Value > |
Returns
Function
Parameters
Parameter | Type |
---|---|
source | string |
Returns
undefined
| CronList
<Value
>
Example
parseStringMinutes()
Parses a string into a CronMinutes
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronPart
<CronMinutesValue
>>
A CronMinutes
or undefined
if invalid.
Example
parseStringMinutesValue()
Parses a string into a CronMinutesValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronMinutesValue
>
A CronMinutesValue
or undefined
if invalid.
Example
parseStringMonth()
Parses a string into a CronMonth
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronPart
<CronMonthValue
>>
A CronMonth
or undefined
if invalid.
Example
parseStringMonthValue()
Parses a string into a CronMonthValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronMonthValue
>
A CronMonthValue
or undefined
if invalid.
Example
parseStringNearestDayOfMonth()
Parses a string into a CronNearestDayOfMonth
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
undefined
|
CronNearestDayOfMonth
A CronNearestDayOfMonth
or undefined
if invalid.
Example
parseStringPart()
Parses a string into a CronPart
.
Parameters
Parameter | Type | Description |
---|---|---|
limit | LimitTuple | LimitTuple to be used when parsing CronSteps . |
Returns
Function
Curried function with limit
in context.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type |
---|---|
parser | StringValueParser <Value > |
Returns
Function
Parameters
Parameter | Type |
---|---|
source | string |
Returns
Maybe
<CronPart
<Value
>>
Example
parseStringQuartz()
Parses a string into a CronQuartz
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronQuartz
>
A Cron
or undefined
if invalid.
Example
parseStringQuartzExpression()
Parses given string expression.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
undefined
| readonly [string
, string
, string
, string
, string
,
string
, string
]
An array of 7 elements or undefined
if invalid.
Example
parseStringRange()
Parses a string into a CronRange
.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type | Description |
---|---|---|
parser | StringValueParser <Value > | StringValueParser for CronRange . |
Returns
Function
Curried function with parser
in context.
Parameters
Parameter | Type |
---|---|
source | string |
Returns
Maybe
<CronRange
<Value
>>
Example
parseStringSeconds()
Parses a string into a CronSeconds
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronPart
<CronSecondsValue
>>
A CronSeconds
or undefined
if invalid.
Example
parseStringSecondsValue()
Parses a string into a CronSecondsValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronSecondsValue
>
A CronSecondsValue
or undefined
if invalid.
Example
parseStringSpecificDayOfWeek()
Parses a string into a CronSpecificDayOfWeek
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronSpecificDayOfWeek
>
A CronSpecificDayOfWeek
or undefined
if invalid.
Example
parseStringSteps()
Parses a string into a CronSteps
.
Parameters
Parameter | Type | Description |
---|---|---|
limit | LimitTuple | LimitTuple for CronSteps . |
Returns
Function
Curried function with limit
in context.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type |
---|---|
parser | StringValueParser <Value > |
Returns
Function
Parameters
Parameter | Type |
---|---|
source | string |
Returns
Maybe
<CronSteps
<Value
>>
Example
parseStringUnix()
Parses a string into a CronUnix
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronUnix
>
A CronUnix
or undefined
if invalid.
Example
parseStringUnixExpression()
Parses given expression or undefined if invalid.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
undefined
| readonly [string
, string
, string
, string
, string
]
An array of 5 elements or undefined
if invalid.
Example
parseStringYear()
Parses a string into a CronYear
.
Parameters
Parameter | Type | Description |
---|---|---|
source | string | string to be parsed. |
Returns
Maybe
<CronPart
<CronYearValue
>>
A CronYear
or undefined
if invalid.
Example
parseStringYearValue()
Parses a string into a CronYearValue
.
Parameters
Parameter | Type |
---|---|
input | string |
Returns
Maybe
<CronYearValue
>
A CronYearValue
or undefined
if invalid.
Example
Predicates
isCronDayOfMonthValue()
Check if given is CronDayOfMonthValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronDayOfMonthValue
Returns true
if is CronDayOfMonthValue
, false
otherwise.
Example
isCronDayOfWeekValue()
Check if given is CronDayOfWeekValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronDayOfWeekValue
Returns true
if is CronDayOfWeekValue
, false
otherwise.
Example
isCronDayOfWeekValueNumber()
Check if given is CronDayOfWeekValueNumber
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronDayOfWeekValueNumber
Returns true
if is CronDayOfWeekValueNumber
, false
otherwise.
Example
isCronDayOfWeekValueString()
Check if given is CronDayOfWeekValueString
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronDayOfWeekValueString
Returns true
if is CronDayOfWeekValueString
, false
otherwise.
Example
isCronEvery()
Check if given is CronEvery
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is "*"
Returns true
if is CronEvery
, false
otherwise.
Example
isCronHoursValue()
Check if given is CronHoursValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronHoursValue
Returns true
if is CronHoursValue
, false
otherwise.
Example
isCronLast()
Check if given is CronLast
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is "L"
Returns true
if is CronLast
, false
otherwise.
Example
isCronLastValue()
Check if given is CronLastValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronLastValue
Returns true
if is CronLastValue
, false
otherwise.
Example
isCronList()
Check if given is CronList
.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronList<Value>
Returns true
if is CronList
, false
otherwise.
Example
isCronMinutesValue()
Check if given is CronMinutesValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronMinutesValue
Returns true
if is CronMinutesValue
, false
otherwise.
Example
isCronMonthValue()
Check if given is CronMonthValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronMonthValue
Returns true
if is CronMonthValue
, false
otherwise.
Example
isCronMonthValueNumber()
Check if given is CronMonthValueNumber
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronMonthValueNumber
Returns true
if is CronMonthValueNumber
, false
otherwise.
Example
isCronMonthValueString()
Check if given is CronMonthValueString
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronMonthValueString
Returns true
if is CronMonthValueString
, false
otherwise.
Example
isCronNearestDayOfMonth()
Check if given is CronNearestDayOfMonth
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronNearestDayOfMonth
Returns true
if is CronNearestDayOfMonth
, false
otherwise.
Example
isCronRange()
Check if given is CronRange
.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronRange<Value>
Returns true
if is CronRange
, false
otherwise.
Example
isCronSpecificDayOfWeek()
Check if given is CronSpecificDayOfWeek
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronSpecificDayOfWeek
Returns true
if is CronSpecificDayOfWeek
, false
otherwise.
Example
isCronStartOrBlank()
Check if given is CronStartOrBlank
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is "?"
Returns true
if is CronStartOrBlank
, false
otherwise.
Example
isCronSteps()
Check if given is CronSteps
.
Type parameters
Type parameter |
---|
Value |
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronSteps<Value>
Returns true
if is CronSteps
, false
otherwise.
Example
isCronWeekValue()
Check if given is CronWeekValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronWeekValue
Returns true
if is CronWeekValue
, false
otherwise.
Example
isCronYearValue()
Check if given is CronYearValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is CronYearValue
Returns true
if is CronYearValue
, false
otherwise.
Example
isStringDayOfMonthValue()
Check if given is a string representing a CronDayOfMonthValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronDayOfMonthValue
, false
otherwise.
Example
isStringDayOfWeekValue()
Check if given is a string representing a CronDayOfWeekValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
boolean
Returns true
if is a string representing a CronDayOfWeekValue
, false
otherwise.
Example
isStringDayOfWeekValueNumber()
Check if given is a string representing a CronDayOfWeekValueNumber
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronDayOfWeekValueNumber
, false
otherwise.
Example
isStringHoursValue()
Check if given is a string representing a CronHoursValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronHoursValue
, false
otherwise.
Example
isStringLastValue()
Check if given is a string representing a CronLastValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronLastValue
, false
otherwise.
Example
isStringList()
Check if given is a string representing a CronList
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronList
, false
otherwise.
Example
isStringMinutesValue()
Check if given is a string representing a CronMinutesValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronMinutesValue
, false
otherwise.
Example
isStringMonthValue()
Check if given is a string representing a CronMonthValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
boolean
Returns true
if is a string representing a CronMonthValue
, false
otherwise.
Example
isStringMonthValueNumber()
Check if given is a string representing a CronMonthValueNumber
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronMonthValueNumber
, false
otherwise.
Example
isStringNearestDayOfMonth()
Check if given is a string representing a CronNearestDayOfMonth
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronNearestDayOfMonth
, false
otherwise.
Example
isStringRange()
Check if given is a string representing a CronRange
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronRange
, false
otherwise.
Example
isStringSecondsValue()
Check if given is a string representing a CronSecondsValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronSecondsValue
, false
otherwise.
Example
isStringSpecificDayOfWeek()
Check if given is a string representing a CronSpecificDayOfWeek
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronSpecificDayOfWeek
, false
otherwise.
Example
isStringSteps()
Check if given is a string representing a CronSteps
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronSteps
, false
otherwise.
Example
isStringWeekValue()
Check if given is a string representing a CronWeekValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronWeekValue
, false
otherwise.
Example
isStringYearValue()
Check if given is a string representing a CronYearValue
.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown | Value to check. |
Returns
value is string
Returns true
if is a string representing a CronYearValue
, false
otherwise.
Example
stringIncludesOnlyOnce()
Checks if given search value appears just onces in given value.
Parameters
Parameter | Type | Description |
---|---|---|
search | string | Value to search. |
Returns
Function
Curried function with search
in context.
Parameters
Parameter | Type |
---|---|
value | unknown |
Returns
value is string