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>`.

7 lines (6 loc) 260 B
import type { Option } from './option.js'; /** * Unwraps a result _input_, returns the content of an `Some(T)`. * If the value is an `None` then return _defaultValue_. */ export declare function unwrapOrForOption<T>(input: Option<T>, defaultValue: T): T;