Class CronFieldAbstract

Represents a field within a cron expression. This is a base class and should not be instantiated directly. CronField

Hierarchy (View Summary)

Constructors

  • CronField constructor. Initializes the field with the provided values.

    Parameters

    • values: (string | number)[]

      Values for this field

    • Optionalwildcard: boolean = false

      Whether this field is a wildcard

    Returns CronField

    if the constructor is called directly

    if validation fails

Accessors

  • get chars(): readonly string[]
  • Returns an array of allowed special characters for this field.

    Returns readonly string[]

  • get isWildcard(): boolean
  • Indicates whether this field is a wildcard.

    Returns boolean

  • get max(): number
  • Returns the maximum value allowed for this field.

    Returns number

  • get min(): number
  • Returns the minimum value allowed for this field.

    Returns number

  • get validChars(): RegExp
  • Returns the regular expression used to validate this field.

    Returns RegExp

Methods

  • Validates the field values against the allowed range and special characters.

    Returns void

    if validation fails

  • Helper function to sort values in ascending order.

    Parameters

    • a: string | number

      First value to compare

    • b: string | number

      Second value to compare

    Returns number

    • A negative, zero, or positive value, depending on the sort order