File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -6,25 +6,21 @@ export class Base {
6
6
} ) ;
7
7
}
8
8
9
- static plugin ( plugin1 , ...additionalPlugins ) {
10
- var _a ;
9
+ static plugin ( ...newPlugins ) {
11
10
const currentPlugins = this . plugins ;
12
- let newPlugins = [ plugin1 , ...additionalPlugins ] ;
13
- const BaseWithPlugins =
14
- ( ( _a = class extends this { } ) ,
15
- ( _a . plugins = currentPlugins . concat (
11
+ return class extends this {
12
+ static plugins = currentPlugins . concat (
16
13
newPlugins . filter ( ( plugin ) => ! currentPlugins . includes ( plugin ) )
17
- ) ) ,
18
- _a ) ;
19
- return BaseWithPlugins ;
14
+ ) ;
15
+ } ;
20
16
}
21
17
static defaults ( defaults ) {
22
- const BaseWitDefaults = class extends this {
18
+ return class extends this {
23
19
constructor ( ...args ) {
24
20
super ( Object . assign ( { } , defaults , args [ 0 ] || { } ) ) ;
25
21
}
26
22
} ;
27
- return BaseWitDefaults ;
28
23
}
24
+
25
+ static plugins = [ ] ;
29
26
}
30
- Base . plugins = [ ] ;
You can’t perform that action at this time.
0 commit comments