UNPKG

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.

15 lines (14 loc) 281 B
/** * @public * Returns the value if the predicate is true, else null. * @remarks * See {@link fpValueOrNull}. */ export function fpValueOrNull<TValue>(predicate: boolean, value: TValue): TValue | null { if (predicate) { return value; } return null; }