Skip to content

Commit 8ac92ea

Browse files
committed
lint: remove non-null assertions in sameParams generic comparison
1 parent 4f4ccda commit 8ac92ea

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/typeschema/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,9 @@ const populateGeneric = (
261261

262262
const sameParams = (a: GenericParam[], b: GenericParam[]): boolean => {
263263
if (a.length !== b.length) return false;
264-
for (let i = 0; i < a.length; i++) {
265-
const x = a[i]!;
266-
const y = b[i]!;
267-
if (x.typeVar !== y.typeVar || !samePath(x.path, y.path) || x.constraint.url !== y.constraint.url)
264+
for (const [i, x] of a.entries()) {
265+
const y = b[i];
266+
if (!y || x.typeVar !== y.typeVar || !samePath(x.path, y.path) || x.constraint.url !== y.constraint.url)
268267
return false;
269268
}
270269
return true;

0 commit comments

Comments
 (0)