@node-in-layers/mcp-server
    Preparing search index...

    Interface Maybe<T>

    A lightweight optional-value container (similar to Option<T> in functional languages). Avoids returning null / undefined directly from functions that may not produce a value.

    const maybeUser: Maybe<User> = findUser(id)
    if (maybeUser.hasValue()) {
    const user = maybeUser.instance()
    }
    interface Maybe<T> {
        hasValue: () => boolean;
        instance: () => T | undefined;
    }

    Type Parameters

    • T

      The type of the wrapped value.

    Index

    Properties

    Properties

    hasValue: () => boolean

    Returns true if a value is present.

    instance: () => T | undefined

    Returns the wrapped value, or undefined if absent.