Open lvqq opened 3 years ago
I've stumbled on this too. Similarly, expressions such as just 1
or 1 2
are considered valid while e.g. https://crontab.guru/ considers them invalid.
Currently, validation of the input expression is rather lax, and if there isn't value specified for the field, it fills it with wildcard.
Throwing an error probably would make more sense indeed. Not sure if somebody out there is relying on this "undocumented feature", but changing it to throw an error should be rather trivial.
Maybe it's a good idea to be part of parseExpression
function option? To determine wheither there should be filled with wildcard
as the title, when i use expression like
20 15 * *
, it pass the validation and becomes* 20 15 * *
by default, i think the expression without minute should not pass the validation because minute is not optional but required.also, the expression
20 15 * *
does not pass the validation in other package or site like https://crontab.guru/here is the sample, the function
parseExpression
should throw a error but not: