File tree 3 files changed +28
-16
lines changed
3 files changed +28
-16
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " spacha" ,
3
3
"version" : " 1.0.4" ,
4
4
"description" : " " ,
5
- "main" : " dist/spacha.node. js" ,
6
- "types" : " dist/src/index.node. d.ts" ,
5
+ "main" : " dist/spacha.js" ,
6
+ "types" : " dist/src/index.d.ts" ,
7
7
"scripts" : {
8
8
"prebuild" : " rimraf dist" ,
9
9
"build" : " npx webpack --config webpack.config.js" ,
Original file line number Diff line number Diff line change @@ -9,24 +9,27 @@ export class SpachaCore {
9
9
}
10
10
11
11
private init = ( ) => {
12
+ const options = { ...this . options } ;
12
13
const themeArray = Object . keys ( themes ) . map ( ( key ) => ( {
13
14
...themes [ key ] ,
14
15
name : key ,
15
16
} ) ) ;
16
17
const randomTheme =
17
18
themeArray [ Math . floor ( Math . random ( ) * themeArray . length ) ] ;
18
- this . options . price ??= randomTheme . price ;
19
- this . options . scale ??= 1.0 ;
20
- this . scale = this . options . scale ;
21
- //this. options.theme ??= randomTheme.name;
22
- this . options . themeOption ??= this . options . theme
23
- ? themes [ this . options . theme ?? randomTheme . name ]
24
- : this . themeFromPrice ( this . options . price ) ;
25
- this . options . user ??= {
19
+ options . price ??= randomTheme . price ;
20
+ options . scale ??= 1.0 ;
21
+ this . scale = options . scale ;
22
+ //options.theme ??= randomTheme.name;
23
+ options . themeOption ??= options . theme
24
+ ? themes [ options . theme ?? randomTheme . name ]
25
+ : this . themeFromPrice ( options . price ) ;
26
+ options . user ??= {
26
27
name : 'YouTube User' ,
27
28
} ;
28
- this . options . user . name ??= 'YouTube User' ;
29
- this . options . shaddow ??= true ;
29
+ options . user . name ??= 'YouTube User' ;
30
+ options . shaddow ??= true ;
31
+
32
+ this . options = options ;
30
33
} ;
31
34
32
35
protected themeFromPrice = ( price : number ) : Theme => {
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
- "target" : " ESNext " ,
3
+ "target" : " ES5 " ,
4
4
"module" : " CommonJS" ,
5
5
"moduleResolution" : " Node" ,
6
6
"esModuleInterop" : true ,
7
7
"strict" : true ,
8
- "lib" : [" es2018" , " DOM" ],
9
- "types" : [" node" , " jest" ],
8
+ "lib" : [
9
+ " es2018" ,
10
+ " DOM"
11
+ ],
12
+ "types" : [
13
+ " node" ,
14
+ " jest"
15
+ ],
10
16
"declaration" : true ,
11
17
"sourceMap" : true ,
12
18
"outDir" : " dist"
13
19
},
14
- "include" : [" src" , " tests" ]
20
+ "include" : [
21
+ " src" ,
22
+ " tests"
23
+ ]
15
24
}
You can’t perform that action at this time.
0 commit comments