diff --git a/src/relay/relay-hot-path-operation-counts.test.ts b/src/relay/relay-hot-path-operation-counts.test.ts index 1c927cc6592..77a3875bda1 100644 --- a/src/relay/relay-hot-path-operation-counts.test.ts +++ b/src/relay/relay-hot-path-operation-counts.test.ts @@ -12,7 +12,7 @@ class CountingMap extends Map { visits = 0 getCalls = 0 - private countingIterator(inner: IterableIterator): IterableIterator { + private countingIterator(inner: MapIterator): MapIterator { const bump = (): void => { this.visits++ } @@ -28,17 +28,15 @@ class CountingMap extends Map { [Symbol.iterator]() { return this } - } as IterableIterator + } as MapIterator } override [Symbol.iterator](): MapIterator<[K, V]> { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: countingIterator wraps the real Map iterator and forwards every next() to it, so the result is that iterator with a counter attached. - return this.countingIterator(super[Symbol.iterator]()) as MapIterator<[K, V]> + return this.countingIterator(super[Symbol.iterator]()) } override values(): MapIterator { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the same wrapper as [Symbol.iterator] above, over super.values(). - return this.countingIterator(super.values()) as MapIterator + return this.countingIterator(super.values()) } override get(key: K): V | undefined {