File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -56,21 +56,21 @@ module.exports = class CleanCssPromise extends CleanCss {
56
56
super ( options ) ;
57
57
}
58
58
59
- minify ( ...args ) {
59
+ async minify ( ...args ) {
60
60
const argLen = args . length ;
61
61
62
62
if ( argLen === 0 ) {
63
63
const error = new RangeError ( 'Expected 1 or 2 arguments (<string|Object>[, <string>]), but got no arguments.' ) ;
64
64
error . code = 'ERR_MISSING_ARGS' ;
65
65
66
- return Promise . reject ( error ) ;
66
+ throw error ;
67
67
}
68
68
69
69
if ( argLen > 2 ) {
70
70
const error = new RangeError ( `Expected 1 or 2 arguments (<string|Object>[, <string>]), but got ${ argLen } arguments.` ) ;
71
71
error . code = 'ERR_TOO_MANY_ARGS' ;
72
72
73
- return Promise . reject ( error ) ;
73
+ throw error ;
74
74
}
75
75
76
76
const [ input , sourceMap ] = args ;
@@ -82,7 +82,7 @@ module.exports = class CleanCssPromise extends CleanCss {
82
82
} .`) ;
83
83
error . code = 'ERR_INVALID_ARG_TYPE' ;
84
84
85
- return Promise . reject ( error ) ;
85
+ throw error ;
86
86
}
87
87
88
88
if ( typeof sourceMap !== 'string' ) {
@@ -91,7 +91,7 @@ module.exports = class CleanCssPromise extends CleanCss {
91
91
} .`) ;
92
92
error . code = 'ERR_INVALID_ARG_TYPE' ;
93
93
94
- return Promise . reject ( error ) ;
94
+ throw error ;
95
95
}
96
96
}
97
97
You can’t perform that action at this time.
0 commit comments