core.ispopulated | Medplum

isPopulated() function

Returns true if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object

Signature:

export declare function isPopulated<T extends {
    length: number;
} | Record<string, any>>(arg: CanBePopulated | undefined | null): arg is T;

Parameters

Parameter Type Description
arg CanBePopulated | undefined | null Any value

Returns:

arg is T

True if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object