Skip to content

Commit 281f49d

Browse files
committed
work with exactOptionalPropertyTypes
Need to use the FC type that is passed in (which can extend *either* `void` *or* `undefined`, because those are OBVIOUSLY TWO COMPLETELY DIFFERENT THINGS, according to TSC in its infinite wisdom, and this is totally not something I'm needlessly and constantly salty about) rather than setting it to `undefined` optionally, because heaven forbid someone passes `void` in there, you might treat it as `undefined` instead of `void`, which would be so unsafe and bad. Anyway. Probably a completely normal amount of feelings to have about a programming language wart, right? fix: #406
1 parent 0adc7a5 commit 281f49d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ export namespace LRUCache {
503503
V,
504504
FC extends undefined | void = undefined,
505505
> extends FetchOptions<K, V, FC> {
506-
context?: undefined
506+
context?: FC
507507
}
508508

509509
export interface MemoOptions<K, V, FC = unknown> extends Pick<
@@ -556,7 +556,7 @@ export namespace LRUCache {
556556
V,
557557
FC extends undefined | void = undefined,
558558
> extends MemoOptions<K, V, FC> {
559-
context?: undefined
559+
context?: FC
560560
}
561561

562562
/**

0 commit comments

Comments
 (0)