Blame view

.pnpm-store/v11/projects/0e47ef389c0c12bdfaeb86af6e6a20bb/src/utils/emptyDisplay.ts 376 Bytes
383e20a3   杨鑫   拉取
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
  }