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) 260 B
import { andThenForOption } from './and_then.js'; function flatten(input) { return input; } /** * Flatten the inner value of _input_. */ export function flattenForOption(input) { const result = andThenForOption(input, flatten); return result; }