rhodonite
    Preparing search index...

    Class WeakNone<B>

    A class representing the absence of a value in the WeakOption pattern. This class implements the "None" case of the Option pattern, providing safe handling when no value exists.

    const none = new WeakNone<MyObject>();
    const obj = new MyObject();
    const value = none.unwrapOrDefault(obj, "default"); // Always returns "default"

    Type Parameters

    • B extends object

      The base object type used as a key

    Implements

    Index
    • Type Parameters

      • B extends object

        The base object type used as a key

      Returns WeakNone<B>

    • Checks if a value exists (always returns false).

      Returns false

      Always false

    • Returns this instance (for chaining operations).

      Returns WeakNone<B>

      This WeakNone instance

    • Throws an error since no value exists.

      Parameters

      • _base: B

      Returns never

      Always throws since no value exists

    • Returns the default value since no value exists.

      Type Parameters

      • T

        The type of the default value

      Parameters

      • _base: B
      • value: T

        The default value to return

      Returns T

      The default value

    • Executes the function since no value exists.

      Parameters

      • _base: B
      • f: (...vals: any) => never

        Function to execute

      Returns never

      The result of the function

    • Returns undefined since no value exists.

      Parameters

      • _base: B

      Returns never

      Always undefined