js-util

Home > rc-js-util > stringNormalizeEmptyToUndefined

stringNormalizeEmptyToUndefined() function

Replaces length 0 strings with undefined.

Signature:

export declare function stringNormalizeEmptyToUndefined(input: string | null | undefined): string | undefined;

Parameters

Parameter Type Description
input string | null | undefined  

Returns:

string | undefined

input if it’s a string of length greater than 0, otherwise undefined.

Remarks

See stringNormalizeEmptyToUndefined().