Skip to content

Commit

Permalink
self options defaults to providedOptions instead of {}, and add {} as…
Browse files Browse the repository at this point in the history
… self options in usages, #105
  • Loading branch information
zepumph committed Feb 24, 2022
1 parent f68482c commit 87e9ca3
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 @@ -50,7 +50,7 @@ type Defaults<SelfOptions = {}, ParentOptions = {}, KeysUsedInSubclassConstructo
// ParentOptions = The public API for parent options, this will be exported by the parent class, like "NodeOptions"
// KeysUsedInSubclassConstructor = list of keys from ParentOptions that are used in this constructor
function optionize<ProvidedOptions,
SelfOptions = {},
SelfOptions = ProvidedOptions,
ParentOptions = {},
KeysUsedInSubclassConstructor extends keyof ParentOptions = never>
(
Expand All @@ -59,7 +59,7 @@ function optionize<ProvidedOptions,
): Defaults<SelfOptions, ParentOptions, KeysUsedInSubclassConstructor> & ProvidedOptions;

function optionize<ProvidedOptions, // eslint-disable-line no-redeclare
SelfOptions = {},
SelfOptions = ProvidedOptions,
ParentOptions = {},
KeysUsedInSubclassConstructor extends keyof ParentOptions = never>
(
Expand Down

0 comments on commit 87e9ca3

Please sign in to comment.