File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,11 @@ impl TryFrom<&CompressOptions> for oxc_minifier::CompressOptions {
7373 unused : match & o. unused {
7474 Some ( Either :: A ( true ) ) => oxc_minifier:: CompressOptionsUnused :: Remove ,
7575 Some ( Either :: A ( false ) ) => oxc_minifier:: CompressOptionsUnused :: Keep ,
76- Some ( Either :: B ( s) ) if s == "keep_assign" => {
77- oxc_minifier:: CompressOptionsUnused :: KeepAssign
78- }
79- None | Some ( Either :: B ( _) ) => default. unused ,
76+ Some ( Either :: B ( s) ) => match s. as_str ( ) {
77+ "keep_assign" => oxc_minifier:: CompressOptionsUnused :: KeepAssign ,
78+ _ => return Err ( format ! ( "Invalid unused option: `{s}`." ) ) ,
79+ } ,
80+ None => default. unused ,
8081 } ,
8182 keep_names : o. keep_names . as_ref ( ) . map ( Into :: into) . unwrap_or_default ( ) ,
8283 treeshake : TreeShakeOptions :: default ( ) ,
You can’t perform that action at this time.
0 commit comments