* @param {string} expression The Cron-Job expression. * @returns {boolean}
(expression)
| 78 | * @returns {boolean} |
| 79 | */ |
| 80 | function isInvalidWeekDay(expression) { |
| 81 | // `<weekday>#<nth>` (e.g. `2#3`, "the 3rd Tuesday") and `<weekday>L` (e.g. |
| 82 | // `5L`, "the last Friday") are valid tokens in this field only. The weekday |
| 83 | // is 0-7 (0 or 7 = Sunday); the `#` occurrence is 1-5. Any remaining entries |
| 84 | // must still be valid weekday numbers. Malformed forms (bare `L`, `L5`, |
| 85 | // `8L`, `2#6`, ...) never become tokens, so they fall through and are |
| 86 | // rejected. |
| 87 | const days = expression.filter((value) => !isNthWeekdayToken(value) && !/^[0-7]L$/.test(value)); |
| 88 | return !isValidExpression(days, 0, 7); |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * @param {string[]} patterns The Cron-Job expression patterns. |
no test coverage detected