Skip to content

Support field-specific validation #23

@nathcouret

Description

@nathcouret

Each field within an expression has different constraints (day of the month is between 1-31, month between 1-12), thus the visitor should validate these constraints to properly reject invalid expressions.

Sample code

// Invalid month upper bound
const expression = "0 0 * 6-15 *";

const invalidResult = cronix(expression);
// Should be null
console.log(invalidResult.ast);
// Should contain an error at visitor step
console.log(invalidResult.errors[0]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions