File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class WebpackObfuscator {
2727 */
2828 constructor ( options : TObject , excludes : string | string [ ] ) {
2929 this . options = options || { } ;
30- this . excludes = typeof excludes === 'string' ? [ excludes ] : excludes || [ ] ;
30+ this . excludes = this . prepareExcludes ( excludes ) ;
3131 }
3232
3333 /**
@@ -102,6 +102,18 @@ class WebpackObfuscator {
102102 } ) ;
103103 }
104104
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+
105117 /**
106118 * @param filePath
107119 * @param excludes
Original file line number Diff line number Diff line change 11{
22 "name" : " webpack-obfuscator" ,
3- "version" : " 0.17.2 " ,
3+ "version" : " 0.17.3 " ,
44 "description" : " javascript-obfuscator plugin for Webpack" ,
55 "keywords" : [
66 " obfuscator" ,
1414 ],
1515 "main" : " index.js" ,
1616 "dependencies" : {
17- "javascript-obfuscator" : " 0.17.2 " ,
17+ "javascript-obfuscator" : " 0.17.3 " ,
1818 "multi-stage-sourcemap" : " 0.2.1" ,
1919 "multimatch" : " 2.1.0"
2020 },
You can’t perform that action at this time.
0 commit comments