/** 文本与表单常用工具（Worker 侧） */

export function cleanText(value: unknown): string {
  return String(value ?? "").trim();
}

export function isTruthy(value: unknown): boolean {
  return (
    value === true ||
    value === "true" ||
    value === "1" ||
    value === 1 ||
    value === "on" ||
    value === "yes"
  );
}
