The value to test.
true when the value is present and renderable, false otherwise.
isPresent("NaCl"); // => true
isPresent(""); // => false
isPresent(NaN); // => false
isPresent(undefined); // => false
export function isPresent(value: unknown): boolean {
if (value == null) return false;
if (typeof value === 'string') return value.trim() !== '';
if (typeof value === 'number') return !Number.isNaN(value);
return true;
}
Reports whether a value is meaningfully populated: not null/undefined, not an empty string, and not
NaN. Used to gate optional detail rows so blank fields are skipped in the panel.