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) 618 B
import type { EffectFn } from '../../internal/function.js'; import { type NotNull, type Nullable } from '../core/nullable.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 `null`. * * * 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 inspectNullable<T>(input: Nullable<T>, effector: EffectFn<NotNull<T>>): Nullable<T>;