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>`.
14 lines (13 loc) • 488 B
TypeScript
import type { Option } from './option.js';
/**
* Return `true`:
* 1. if `lhs === rhs`.
* 2. if _lhs_ and _rhs_ is same kind, and they contain same value.
*
* Otherwise, return `false`.
*
* This function is designed for `Option<T>`.
* This function may return `true` if input values has same properties with `Option<T>`
* and their properties are same between _lhs_ and _rhs_.
*/
export declare function equalForOption<T>(lhs: Option<T>, rhs: Option<T>): boolean;