Create a new ValuePresence.
OptionaldefaultMap: Record<string, unknown[]>Optional initial data. Keys are scope names; values are arrays of items to seed.
Empty-string keys are normalized to the default scope (undefined).
Add a value to a scope, creating the scope if it does not exist.
Scope to add the value to. Use undefined for the default scope.
The value to add.
void
Check whether a value is present within a given scope.
The scope to check. Use undefined for the default scope.
The value to test for presence.
true if the value is present in the specified scope; otherwise false.
Remove a value from a scope.
Scope to remove from. Use undefined for the default scope.
The value to remove.
void
Clear values from a single scope, or from all scopes.
Optionalscope: ValuePresenceScopeIf provided, clears only that scope. If omitted, clears all scopes.
void
Tracks whether a given value is present within one or more logical scopes.
Remarks
Set.hasreference equality for objects and value equality for primitives.Example
See
ValuePresenceScope