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) 632 B
import type { EffectFn } from '../internal/function.js'; import { type Maybe, type NotNullOrUndefined } from './maybe.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` and `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 inspectMaybe<T>(input: Maybe<T>, effector: EffectFn<NotNullOrUndefined<T>>): Maybe<T>;