1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use rnode::Visit;
use stc_ts_types::{MethodSignature, PropertySignature, Union};

#[derive(Debug, Default)]
pub struct UnionFinder {
    pub found: bool,
}

impl Visit<PropertySignature> for UnionFinder {
    fn visit(&mut self, _: &PropertySignature) {}
}

impl Visit<MethodSignature> for UnionFinder {
    fn visit(&mut self, _: &MethodSignature) {}
}

impl Visit<Union> for UnionFinder {
    fn visit(&mut self, _: &Union) {
        self.found = true;
    }
}