Skip to content

Commit

Permalink
Handle ObjectPat optional
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Apr 7, 2023
1 parent c872afc commit e8b2e1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/swc_ecma_transforms_typescript/src/strip_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ impl VisitMut for StripType {
n.optional = false;
}

fn visit_mut_object_pat(&mut self, pat: &mut ObjectPat) {
pat.visit_mut_children_with(self);
pat.optional = false;
}

fn visit_mut_expr(&mut self, n: &mut Expr) {
match n {
// https://github.com/tc39/proposal-type-annotations#type-assertions
Expand Down

0 comments on commit e8b2e1e

Please sign in to comment.