( opt: Exclude<TOption, Function> | LogicFn<TValue, TOption, TPathKind> | undefined, ctx: FieldContext<TValue, TPathKind>, )
| 47 | * @returns The value for the option. |
| 48 | */ |
| 49 | export function getOption<TOption, TValue, TPathKind extends PathKind = PathKind.Root>( |
| 50 | opt: Exclude<TOption, Function> | LogicFn<TValue, TOption, TPathKind> | undefined, |
| 51 | ctx: FieldContext<TValue, TPathKind>, |
| 52 | ): TOption | undefined { |
| 53 | return opt instanceof Function ? opt(ctx) : opt; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Checks if the given value is considered empty. Empty values are: null, undefined, '', false, NaN. |
no outgoing calls
no test coverage detected
searching dependent graphs…