MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / parseCronFromArgs

Function parseCronFromArgs

acron/acron.ts:198–214  ·  view source on GitHub ↗
(
  args: string[],
)

Source from the content-addressed store, hash-verified

196}
197
198function parseCronFromArgs(
199 args: string[],
200): { cron: string; rest: string[] } | null {
201 // 优先按 6 段解析 (second minute hour dayOfMonth month dayOfWeek)
202 const n6 = 6;
203 if (args.length >= n6) {
204 const maybeCron = args.slice(0, n6).join(" ");
205 const validation = (cron as any).validateCronExpression
206 ? (cron as any).validateCronExpression(maybeCron)
207 : { valid: true };
208 if (validation.valid) {
209 return { cron: maybeCron, rest: args.slice(n6) };
210 }
211 }
212
213 return null;
214}
215
216function buildCopy(task: AcronTask): string {
217 if (task.type === "send") {

Callers 1

AcronPluginClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected