Add value to a dedup set only while it's under max entries — a bounded
"warn once" tracker. Past the cap, returns false (caller may still act, but
the value isn't tracked, so it could re-fire later — an acceptable trade vs.
unbounded memory). Pure + exported for unit testing.
Parameters
set: Set<string>
value: string
max: number
Returns boolean
true if the value was newly added; false if already present OR the
set is at max capacity.
Add
valueto a dedupsetonly while it's undermaxentries — a bounded "warn once" tracker. Past the cap, returns false (caller may still act, but the value isn't tracked, so it could re-fire later — an acceptable trade vs. unbounded memory). Pure + exported for unit testing.