Skip to content

Commit

Permalink
Better default for ParentOptions plus bug fixes, phetsims/chipper#1360
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Nov 25, 2022
1 parent 5d5dd49 commit 08ef648
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/optionize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const merge4 = ( a: IntentionalAny, b?: IntentionalAny, c?: IntentionalAny, d?:
// KeysUsedInSubclassConstructor = list of keys from ParentOptions that are used in this constructor.
export default function optionize<ProvidedOptions,
SelfOptions = ProvidedOptions,
ParentOptions = object>():
ParentOptions = Record<never, never>>():
<KeysUsedInSubclassConstructor extends keyof ( ParentOptions )>(
defaults: HalfOptions<SelfOptions, ParentOptions>,
providedOptions?: ProvidedOptions
Expand All @@ -77,7 +77,7 @@ export default function optionize<ProvidedOptions,
// Use this function to gain the typing that optionize provides but in a case where the first argument is an empty object.
export function optionize3<ProvidedOptions,
SelfOptions = ProvidedOptions,
ParentOptions = object>():
ParentOptions = Record<never, never>>():
<KeysUsedInSubclassConstructor extends keyof ( ParentOptions )>(
emptyObject: ObjectWithNoKeys,
defaults: HalfOptions<SelfOptions, ParentOptions>,
Expand Down

0 comments on commit 08ef648

Please sign in to comment.