File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class WebpackObfuscator {
27
27
*/
28
28
constructor ( options : TObject , excludes : string | string [ ] ) {
29
29
this . options = options || { } ;
30
- this . excludes = typeof excludes === 'string' ? [ excludes ] : excludes || [ ] ;
30
+ this . excludes = this . prepareExcludes ( excludes ) ;
31
31
}
32
32
33
33
/**
@@ -102,6 +102,18 @@ class WebpackObfuscator {
102
102
} ) ;
103
103
}
104
104
105
+ private prepareExcludes ( inputExcludes : string | string [ ] ) : string [ ] {
106
+ if ( Array . isArray ( inputExcludes ) ) {
107
+ return inputExcludes ;
108
+ }
109
+
110
+ if ( typeof inputExcludes === 'string' ) {
111
+ return [ inputExcludes ] ;
112
+ }
113
+
114
+ return [ ] ;
115
+ }
116
+
105
117
/**
106
118
* @param filePath
107
119
* @param excludes
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " webpack-obfuscator" ,
3
- "version" : " 0.17.2 " ,
3
+ "version" : " 0.17.3 " ,
4
4
"description" : " javascript-obfuscator plugin for Webpack" ,
5
5
"keywords" : [
6
6
" obfuscator" ,
14
14
],
15
15
"main" : " index.js" ,
16
16
"dependencies" : {
17
- "javascript-obfuscator" : " 0.17.2 " ,
17
+ "javascript-obfuscator" : " 0.17.3 " ,
18
18
"multi-stage-sourcemap" : " 0.2.1" ,
19
19
"multimatch" : " 2.1.0"
20
20
},
You can’t perform that action at this time.
0 commit comments