Skip to content

Commit 320477d

Browse files
fix types for typescript < 4.6
1 parent 59e78af commit 320477d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Recorder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export class Recorder<TRecord> {
6262
}
6363

6464
private getIdentity(record: TRecord): PropertyKey {
65-
return record[this._identity as keyof TRecord] as PropertyKey
65+
// for typescript < 4.6, we need to intersect PropertyKey with the default type
66+
return record[this._identity as keyof TRecord] as TRecord[keyof TRecord] & PropertyKey
6667
}
6768
}

0 commit comments

Comments
 (0)