@@ -19,13 +19,13 @@ const BaseWithEmptyDefaults = Base.defaults({
19
19
20
20
// 'version' is missing and should still be required
21
21
// @ts -expect-error
22
- new BaseWithEmptyDefaults ( )
22
+ new BaseWithEmptyDefaults ( ) ;
23
23
24
24
// 'version' is missing and should still be required
25
25
// @ts -expect-error
26
- new BaseWithEmptyDefaults ( { } )
26
+ new BaseWithEmptyDefaults ( { } ) ;
27
27
28
- const BaseLevelOne = Base . plugin ( fooPlugin ) . defaults ( {
28
+ const BaseLevelOne = Base . plugin ( [ fooPlugin ] ) . defaults ( {
29
29
defaultOne : "value" ,
30
30
version : "1.2.3" ,
31
31
} ) ;
@@ -35,8 +35,8 @@ new BaseLevelOne();
35
35
new BaseLevelOne ( { } ) ;
36
36
37
37
expectType < {
38
- defaultOne : string ,
39
- version : string ,
38
+ defaultOne : string ;
39
+ version : string ;
40
40
} > ( BaseLevelOne . defaultOptions ) ;
41
41
42
42
const baseLevelOne = new BaseLevelOne ( {
@@ -54,9 +54,9 @@ const BaseLevelTwo = BaseLevelOne.defaults({
54
54
} ) ;
55
55
56
56
expectType < {
57
- defaultOne : string ,
58
- defaultTwo : number ,
59
- version : string ,
57
+ defaultOne : string ;
58
+ defaultTwo : number ;
59
+ version : string ;
60
60
} > ( { ...BaseLevelTwo . defaultOptions } ) ;
61
61
62
62
// Because 'version' is already provided, this needs no argument
@@ -65,11 +65,11 @@ new BaseLevelTwo({});
65
65
66
66
// 'version' may be overriden, though it's not necessary
67
67
new BaseLevelTwo ( {
68
- version : ' new version' ,
68
+ version : " new version" ,
69
69
} ) ;
70
70
71
71
const baseLevelTwo = new BaseLevelTwo ( {
72
- optionTwo : true
72
+ optionTwo : true ,
73
73
} ) ;
74
74
75
75
expectType < number > ( baseLevelTwo . options . defaultTwo ) ;
@@ -80,14 +80,14 @@ expectType<string>(baseLevelTwo.options.version);
80
80
baseLevelTwo . unknown ;
81
81
82
82
const BaseLevelThree = BaseLevelTwo . defaults ( {
83
- defaultThree : [ 'a' , 'b' , 'c' ] ,
83
+ defaultThree : [ "a" , "b" , "c" ] ,
84
84
} ) ;
85
85
86
86
expectType < {
87
- defaultOne : string ,
88
- defaultTwo : number ,
89
- defaultThree : string [ ] ,
90
- version : string ,
87
+ defaultOne : string ;
88
+ defaultTwo : number ;
89
+ defaultThree : string [ ] ;
90
+ version : string ;
91
91
} > ( { ...BaseLevelThree . defaultOptions } ) ;
92
92
93
93
// Because 'version' is already provided, this needs no argument
@@ -96,13 +96,13 @@ new BaseLevelThree({});
96
96
97
97
// Previous settings may be overriden, though it's not necessary
98
98
new BaseLevelThree ( {
99
- optionOne : '' ,
99
+ optionOne : "" ,
100
100
optionTwo : false ,
101
- version : ' new version' ,
101
+ version : " new version" ,
102
102
} ) ;
103
103
104
104
const baseLevelThree = new BaseLevelThree ( {
105
- optionThree : [ 0 , 1 , 2 ]
105
+ optionThree : [ 0 , 1 , 2 ] ,
106
106
} ) ;
107
107
108
108
expectType < string > ( baseLevelThree . options . defaultOne ) ;
@@ -113,15 +113,15 @@ expectType<string>(baseLevelThree.options.version);
113
113
// @ts -expect-error unknown properties cannot be used, see #31
114
114
baseLevelThree . unknown ;
115
115
116
- const BaseWithVoidPlugin = Base . plugin ( voidPlugin ) ;
116
+ const BaseWithVoidPlugin = Base . plugin ( [ voidPlugin ] ) ;
117
117
const baseWithVoidPlugin = new BaseWithVoidPlugin ( {
118
118
version : "1.2.3" ,
119
119
} ) ;
120
120
121
121
// @ts -expect-error unknown properties cannot be used, see #31
122
122
baseWithVoidPlugin . unknown ;
123
123
124
- const BaseWithFooAndBarPlugins = Base . plugin ( barPlugin , fooPlugin ) ;
124
+ const BaseWithFooAndBarPlugins = Base . plugin ( [ barPlugin , fooPlugin ] ) ;
125
125
const baseWithFooAndBarPlugins = new BaseWithFooAndBarPlugins ( {
126
126
version : "1.2.3" ,
127
127
} ) ;
@@ -132,11 +132,11 @@ expectType<string>(baseWithFooAndBarPlugins.bar);
132
132
// @ts -expect-error unknown properties cannot be used, see #31
133
133
baseWithFooAndBarPlugins . unknown ;
134
134
135
- const BaseWithVoidAndNonVoidPlugins = Base . plugin (
135
+ const BaseWithVoidAndNonVoidPlugins = Base . plugin ( [
136
136
barPlugin ,
137
137
voidPlugin ,
138
- fooPlugin
139
- ) ;
138
+ fooPlugin ,
139
+ ] ) ;
140
140
const baseWithVoidAndNonVoidPlugins = new BaseWithVoidAndNonVoidPlugins ( {
141
141
version : "1.2.3" ,
142
142
} ) ;
@@ -147,7 +147,7 @@ expectType<string>(baseWithVoidAndNonVoidPlugins.bar);
147
147
// @ts -expect-error unknown properties cannot be used, see #31
148
148
baseWithVoidAndNonVoidPlugins . unknown ;
149
149
150
- const BaseWithOptionsPlugin = Base . plugin ( withOptionsPlugin ) ;
150
+ const BaseWithOptionsPlugin = Base . plugin ( [ withOptionsPlugin ] ) ;
151
151
const baseWithOptionsPlugin = new BaseWithOptionsPlugin ( {
152
152
version : "1.2.3" ,
153
153
} ) ;
@@ -185,30 +185,30 @@ expectType<{
185
185
// @ts -expect-error - .options from .defaults() is only supported until a depth of 4
186
186
} > ( { ...baseLevelFour . options } ) ;
187
187
188
- const BaseWithChainedDefaultsAndPlugins = Base
189
- . defaults ( {
190
- defaultOne : "value" ,
191
- } )
192
- . plugin ( fooPlugin )
188
+ const BaseWithChainedDefaultsAndPlugins = Base . defaults ( {
189
+ defaultOne : "value" ,
190
+ } )
191
+ . plugin ( [ fooPlugin ] )
193
192
. defaults ( {
194
193
defaultTwo : 0 ,
195
194
} ) ;
196
195
197
- const baseWithChainedDefaultsAndPlugins =
198
- new BaseWithChainedDefaultsAndPlugins ( {
196
+ const baseWithChainedDefaultsAndPlugins = new BaseWithChainedDefaultsAndPlugins (
197
+ {
199
198
version : "1.2.3" ,
200
- } ) ;
199
+ }
200
+ ) ;
201
201
202
202
expectType < string > ( baseWithChainedDefaultsAndPlugins . foo ) ;
203
203
204
204
const BaseWithManyChainedDefaultsAndPlugins = Base . defaults ( {
205
205
defaultOne : "value" ,
206
206
} )
207
- . plugin ( fooPlugin , barPlugin , voidPlugin )
207
+ . plugin ( [ fooPlugin , barPlugin , voidPlugin ] )
208
208
. defaults ( {
209
209
defaultTwo : 0 ,
210
210
} )
211
- . plugin ( withOptionsPlugin )
211
+ . plugin ( [ withOptionsPlugin ] )
212
212
. defaults ( {
213
213
defaultThree : [ "a" , "b" , "c" ] ,
214
214
} ) ;
0 commit comments