Skip to content

Commit a853001

Browse files
authored
Removed lint suppression for Iterator.from (#433)
1 parent 0b63101 commit a853001

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

workspaces/adventure-pack/goodies/typescript/Iterator.from/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ declare global {
2626
return toIterable.call(iteratorFactory.call(object));
2727
}
2828

29-
// eslint-disable-next-line no-prototype-builtins
30-
if (iteratorPrototype.isPrototypeOf(object)) {
29+
if (Object.prototype.isPrototypeOf.call(iteratorPrototype, object)) {
3130
return toIterable.call(object as Iterator<T>);
3231
}
3332

workspaces/adventure-pack/src/app/__tests__/__snapshots__/equip-test.ts.snap

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,8 +1392,7 @@ globalThis.Iterator.from ??= function (object) {
13921392
return toIterable.call(iteratorFactory.call(object));
13931393
}
13941394

1395-
// eslint-disable-next-line no-prototype-builtins
1396-
if (iteratorPrototype.isPrototypeOf(object)) {
1395+
if (Object.prototype.isPrototypeOf.call(iteratorPrototype, object)) {
13971396
return toIterable.call(object);
13981397
}
13991398

@@ -3381,8 +3380,7 @@ iteratorPrototype.toIterable = function <T>(
33813380
return toIterable.call(iteratorFactory.call(object));
33823381
}
33833382

3384-
// eslint-disable-next-line no-prototype-builtins
3385-
if (iteratorPrototype.isPrototypeOf(object)) {
3383+
if (Object.prototype.isPrototypeOf.call(iteratorPrototype, object)) {
33863384
return toIterable.call(object as Iterator<T>);
33873385
}
33883386

workspaces/adventure-pack/src/app/__tests__/__snapshots__/render-test.ts.snap

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,7 @@ globalThis.Iterator.from ??= function (object) {
814814
return toIterable.call(iteratorFactory.call(object));
815815
}
816816
817-
// eslint-disable-next-line no-prototype-builtins
818-
if (iteratorPrototype.isPrototypeOf(object)) {
817+
if (Object.prototype.isPrototypeOf.call(iteratorPrototype, object)) {
819818
return toIterable.call(object);
820819
}
821820
@@ -1999,8 +1998,7 @@ declare global {
19991998
return toIterable.call(iteratorFactory.call(object));
20001999
}
20012000
2002-
// eslint-disable-next-line no-prototype-builtins
2003-
if (iteratorPrototype.isPrototypeOf(object)) {
2001+
if (Object.prototype.isPrototypeOf.call(iteratorPrototype, object)) {
20042002
return toIterable.call(object as Iterator<T>);
20052003
}
20062004

0 commit comments

Comments
 (0)