The base object type used as a key in the WeakMap
The type of the value being stored
The base object type used as a key in the WeakMap
The type of the value being stored
Checks if a value exists for the given base object.
The base object used as a key
True if the value exists, false otherwise
A WeakMap-based implementation of the Option pattern for handling optional values. This class provides safe access to values that may or may not exist, using WeakMap for automatic garbage collection when the base object is no longer referenced.
Example