export const ifDefined = any>( value: T | undefined | null, fn: TFn, ): ReturnType | undefined => { if (!value) return; return fn(value); };