mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-05 07:42:53 +00:00
Adds broad inline comments and JSDoc for CLI, cron, outbound/channel, plugin SDK, ACP, shared helpers, net policy, and related utility contracts. Proof: git diff --check on latest exact head plus focused cron tests passed; CI had no failing checks observed before merge attempt.
14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
/** Formats a short human-readable disjunction such as "A, B, or C". */
|
|
export function formatHumanList(values: readonly string[]): string {
|
|
if (values.length === 0) {
|
|
return "";
|
|
}
|
|
if (values.length === 1) {
|
|
return values[0];
|
|
}
|
|
if (values.length === 2) {
|
|
return `${values[0]} or ${values[1]}`;
|
|
}
|
|
return `${values.slice(0, -1).join(", ")}, or ${values.at(-1)}`;
|
|
}
|