Match one or more whitespace characters

This commit is contained in:
Jacob Wallraff
2023-01-10 12:03:56 -08:00
parent f877c22e9c
commit 78e2e32518
2 changed files with 2 additions and 1 deletions
@@ -19,6 +19,7 @@ describe("isValidCron", () => {
"0 0 * * SUN-TUE",
"0 0 * * SUN-2",
"0 2-4/5 * * *",
"0 0 * * *",
]
for (const cron of valid) {
@@ -27,7 +27,7 @@ const DAYS = {
export function isValidCron(cron: string): boolean {
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
const parts = cron.split(" ")
const parts = cron.split(/ +/)
if (parts.length != 5) {
return false
}