import { normalizeOptionalLowercaseString } from "../../../shared/string-coerce.js" ;
import type { QueueDropPolicy, QueueMode } from "./types.js" ;
export function normalizeQueueMode(raw?: string): QueueMode | undefined {
const cleaned = normalizeOptionalLowercaseString(raw);
if (!cleaned) {
return undefined;
}
if (cleaned === "queue" || cleaned === "queued" ) {
return "steer" ;
}
if (cleaned === "interrupt" || cleaned === "interrupts" || cleaned === "abort" ) {
return "interrupt" ;
}
if (cleaned === "steer" || cleaned === "steering" ) {
return "steer" ;
}
if (cleaned === "followup" || cleaned === "follow-ups" || cleaned === "followups" ) {
return "followup" ;
}
if (cleaned === "collect" || cleaned === "coalesce" ) {
return "collect" ;
}
if (cleaned === "steer+backlog" || cleaned === "steer-backlog" || cleaned === "steer_backlog" ) {
return "steer-backlog" ;
}
return undefined;
}
export function normalizeQueueDropPolicy(raw?: string): QueueDropPolicy | undefined {
const cleaned = normalizeOptionalLowercaseString(raw);
if (!cleaned) {
return undefined;
}
if (cleaned === "old" || cleaned === "oldest" ) {
return "old" ;
}
if (cleaned === "new" || cleaned === "newest" ) {
return "new" ;
}
if (cleaned === "summarize" || cleaned === "summary" ) {
return "summarize" ;
}
return undefined;
}
Messung V0.5 in Prozent C=98 H=97 G=97
¤ Dauer der Verarbeitung: 0.4 Sekunden
¤
*© Formatika GbR, Deutschland