Skip to content

Commit 81e78f6

Browse files
Zelys-DFKHclaude
andcommitted
fix(lib): add missing JSDoc to ReadonlySet and fix Set#size grammar
Closes #63480: Set#size JSDoc said "in Set" — added the missing article ("in the Set") to match the grammar used in Map#size and everywhere else in the file. Closes #63481: ReadonlySet.forEach, ReadonlySet.has, and ReadonlySet.size had no JSDoc at all. Added comments mirroring the corresponding Set<T> members (updating the callback type reference from Set<T> to ReadonlySet<T> where applicable). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f350b52 commit 81e78f6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/lib/es2015.collection.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ interface Set<T> {
9494
*/
9595
has(value: T): boolean;
9696
/**
97-
* @returns the number of (unique) elements in Set.
97+
* @returns the number of (unique) elements in the Set.
9898
*/
9999
readonly size: number;
100100
}
@@ -106,8 +106,17 @@ interface SetConstructor {
106106
declare var Set: SetConstructor;
107107

108108
interface ReadonlySet<T> {
109+
/**
110+
* Executes a provided function once per each value in the Set object, in insertion order.
111+
*/
109112
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
113+
/**
114+
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
115+
*/
110116
has(value: T): boolean;
117+
/**
118+
* @returns the number of (unique) elements in the Set.
119+
*/
111120
readonly size: number;
112121
}
113122

0 commit comments

Comments
 (0)