@@ -75,16 +75,8 @@ pub enum TerserTopRetainOption {
75
75
#[ serde( deny_unknown_fields) ]
76
76
#[ non_exhaustive]
77
77
pub struct TerserExperimentalOptions {
78
- #[ serde( default = "true_by_default" ) ]
79
- pub reduce_escaped_newline : bool ,
80
- }
81
-
82
- impl Default for TerserExperimentalOptions {
83
- fn default ( ) -> Self {
84
- TerserExperimentalOptions {
85
- reduce_escaped_newline : true ,
86
- }
87
- }
78
+ #[ serde( default ) ]
79
+ pub reduce_escaped_newline : Option < bool > ,
88
80
}
89
81
90
82
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -421,11 +413,15 @@ impl TerserCompressorOptions {
421
413
} )
422
414
} )
423
415
. collect ( ) ,
424
- experimental : self . experimental . map ( From :: from) . unwrap_or (
425
- CompressExperimentalOptions {
426
- reduce_escaped_newline : self . defaults ,
427
- } ,
428
- ) ,
416
+ experimental : self
417
+ . experimental
418
+ . map ( |experimental| {
419
+ CompressExperimentalOptions :: from_terser_with_defaults (
420
+ experimental,
421
+ self . defaults ,
422
+ )
423
+ } )
424
+ . unwrap_or ( CompressExperimentalOptions :: from_defaults ( self . defaults ) ) ,
429
425
}
430
426
}
431
427
}
@@ -481,14 +477,6 @@ impl From<TerserTopRetainOption> for Vec<Atom> {
481
477
}
482
478
}
483
479
484
- impl From < TerserExperimentalOptions > for CompressExperimentalOptions {
485
- fn from ( value : TerserExperimentalOptions ) -> Self {
486
- CompressExperimentalOptions {
487
- reduce_escaped_newline : value. reduce_escaped_newline ,
488
- }
489
- }
490
- }
491
-
492
480
fn value_to_expr ( v : Value ) -> Box < Expr > {
493
481
match v {
494
482
Value :: Null => Lit :: Null ( Null { span : DUMMY_SP } ) . into ( ) ,
0 commit comments