rhodonite
    Preparing search index...

    Class WeakSome<B, T>

    A WeakMap-based implementation representing a value that definitely exists. This class is used when you know a value exists and want to provide type-safe access to it through the WeakOption interface.

    const obj = new MyObject();
    const some = new WeakSome(obj, "definite value");
    const value = some.unwrapForce(obj); // Always returns "definite value"

    Type Parameters

    • B extends object

      The base object type used as a key in the WeakMap

    • T

      The type of the value being stored

    Implements

    Index

    Constructors

    • Creates a new WeakSome instance with a guaranteed value.

      Type Parameters

      • B extends object

        The base object type used as a key in the WeakMap

      • T

        The type of the value being stored

      Parameters

      • base: B

        The base object to use as a key

      • value: T

        The value to store (guaranteed to exist)

      Returns WeakSome<B, T>

    Methods