rewrite check onto fsm

This commit is contained in:
2024-11-03 13:30:20 +06:00
parent d82107b8b8
commit 5ac1bc26e1
2 changed files with 70 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ value class KrontabConfig(
var millisecondsParsed: Array<Short>? = null
val (secondsSource, minutesSource, hoursSource, dayOfMonthSource, monthSource) = template
.split(" ")
.filter { it.matches(KrontabConfigPartRegex) } // filter garbage from string
.filter { checkIncomingPart(it) } // filter garbage from string
.let {
if (it.size < 5) { // reconstruction in case of insufficient arguments; 5 is amount of required arguments out of latest also code
it + (it.size until 5).map { "*" }