/* * SPDX-FileCopyrightText: syuilo and misskey-project * SPDX-License-Identifier: AGPL-3.0-only */ export interface IMaybe { isJust(): this is IJust; } export interface IJust extends IMaybe { get(): T; } export function just(value: T): IJust { return { isJust: () => true, get: () => value, }; } export function nothing(): IMaybe { return { isJust: () => false, }; }