MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatDows

Function formatDows

packages/agent-core/src/tools/cron/cron-expr.ts:436–447  ·  view source on GitHub ↗
(set: ReadonlySet<number>)

Source from the content-addressed store, hash-verified

434}
435
436function formatDows(set: ReadonlySet<number>): string | null {
437 const values = [...set].toSorted((a, b) => a - b);
438 if (values.length === 0) return null;
439 // Mon-Fri shortcut.
440 if (values.length === 5 && values.every((v, i) => v === i + 1)) {
441 return 'weekdays';
442 }
443 if (values.length === 2 && values[0] === 0 && values[1] === 6) {
444 return 'weekends';
445 }
446 return values.map((v) => DAY_NAMES[v]!).join(', ');
447}
448
449function pad(n: number): string {
450 return n < 10 ? `0${n}` : String(n);

Callers 1

cronToHumanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected