UNPKG

option-t

Version:

A toolkit of Nullable/Option/Result type implementation in ECMAScript. Their APIs are inspired by Rust's `Option<T>` and `Result<T, E>`.

12 lines (11 loc) 648 B
import type { EffectFn } from '../../internal/function.js'; import { type NotUndefined, type Undefinable } from '../core/undefinable.js'; /** * * Return _input_ directly. * * This value is passed as the input. But it maybe mutated by calling _effector_. * * Call _effector_ with _input_ if _input_ is not `undefined`. * * * This was added to sort with others or future enhancement to accept chaining functions. * We recommend to use simple `if` statement or similar way and they would be more efficient. */ export declare function inspectUndefinable<T>(input: Undefinable<T>, effector: EffectFn<NotUndefined<T>>): Undefinable<T>;