All files / platform/core/src/utils formatValue.js

66.66% Statements 6/9
62.5% Branches 5/8
100% Functions 1/1
66.66% Lines 6/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23        9896x 10x     9886x 9884x     2x 2x                  
/**
 * Formats values for safe text display.
 */
export default function formatValue(value) {
  if (value == null) {
    return null;
  }
 
  if (typeof value === 'string') {
    return value;
  }
 
  if (typeof value === 'object' && typeof value.Alphabetic === 'string') {
    return value.Alphabetic;
  }
 
  Iif (typeof value === 'number' || typeof value === 'boolean') {
    return String(value);
  }
 
  return null;
}