File size: 427 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
export const OPENROUTER_PRESET_MAX_LENGTH = 200;

export function isOpenRouterPresetValue(value: unknown): value is string {
  return typeof value === "string" && value.trim().length <= OPENROUTER_PRESET_MAX_LENGTH;
}

export function normalizeOpenRouterPreset(value: unknown): string | undefined {
  if (!isOpenRouterPresetValue(value)) return undefined;
  const normalized = value.trim();
  return normalized || undefined;
}