validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

Add support for Cron format validation

Open Substancia opened this issue 2 years ago • 6 comments

Cron schedule formats (* * * * *) don't seem to have validation support in this tool. We could have a new support isCron().

If this sounds alright, I would like to be assigned to this and start with this immediately.

Substancia avatar Oct 01 '23 09:10 Substancia

Just FYI, Cron syntax may vary slightly and may have different variations/implementations in various platforms and tools. So this is a high chance that some syntax variations (pretty valid in some systems) will be invalid here. Just thoughts :)

zhibirc avatar Oct 20 '23 20:10 zhibirc

I made a library, cron-compose, that inherently validates the standard version of Cron strings (both seconds and non-seconds formats). You could potentially pull it as a dependency (https://bundlephobia.com/package/cron-compose@latest). It's entirely self-contained code so it would not be large to include as part of the library. Feel free to pull parts from it if needed to do your own implementation of the Cron format validation.

mahyarmirrashed avatar Nov 19 '23 23:11 mahyarmirrashed