rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
16 lines (15 loc) • 313 B
text/typescript
/**
* @public
* Returns the newValue if defined, else the old value.
*
* @remarks
* See {@link fpMaybeNewValue}.
*/
export function fpMaybeNewValue<TValue>(newValue: TValue | null | undefined, oldValue: TValue): TValue
{
if (newValue != null)
{
return newValue;
}
return oldValue;
}