reluxscript 0.1.4

Write AST transformations once. Compile to Babel, SWC, and beyond.
Documentation
// Generated by ReluxScript compiler
// Do not edit manually

use swc_common::{Span, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_visit::{VisitMut, VisitMutWith};

pub struct MatchesTest {
    // Plugin state
}

impl MatchesTest {
    pub fn new() -> Self {
        Self {}
    }
}

impl VisitMut for MatchesTest {
    
    fn visit_mut_call_expr(&mut self, n: &mut CallExpr) {
        if {
            let __matched = matches!(n.callee, Expr::Member(_)) && { if let Expr::Member(mem) = &n.callee { matches!((*mem.obj), Expr::Ident(_)) && { if let Expr::Ident(id) = &(*mem.obj) { &*id.sym == "console" } else { false } } } else { false } } && { if let Expr::Member(mem) = &n.callee { matches!((*mem.prop), Expr::Ident(_)) && { if let Expr::Ident(id) = &(*mem.prop) { &*id.sym == "log" } else { false } } } else { false } };
            __matched
        } {
            let x = 1;
        }
    }
}