Parse currently ignores any tokens after the 7th, which means invalid
cron expressions might be allowed as long as invalid tokens are found
after the 7th character.
In some use cases (e.g. validating cron expressions provided by a user),
this might not be desirable. To allow for this use case, this adds a
ParseStrict function that returns an error if too many fields are
provided (it retains backwards compatibility by not touching Parse).
Parse currently ignores any tokens after the 7th, which means invalid cron expressions might be allowed as long as invalid tokens are found after the 7th character.
In some use cases (e.g. validating cron expressions provided by a user), this might not be desirable. To allow for this use case, this adds a ParseStrict function that returns an error if too many fields are provided (it retains backwards compatibility by not touching Parse).
For some context, here's where I ran into this and could use a
ParseStrict
:smile: : https://github.com/aptible/supercronic/pull/34Thanks!