Blame view

美国版/Food Labeling Management Platform/src/lib/emptyDisplay.ts 379 Bytes
91821909   杨鑫   最新
1
2
3
4
5
6
7
8
9
10
11
12
  /** Backend empty placeholder (US API may return this literal). */
  export const BACKEND_EMPTY_DISPLAY = "无";
  
  /** Map API empty sentinels to English UI text. */
  export function formatDisplayText(
    value: string | null | undefined,
    fallback = "None",
  ): string {
    const s = String(value ?? "").trim();
    if (!s || s === BACKEND_EMPTY_DISPLAY) return fallback;
    return s;
  }