1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use istanbul_oxide::SourceMap;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct InstrumentLogOptions {
    pub level: Option<String>,
    pub enable_trace: bool,
}

impl Default for InstrumentLogOptions {
    fn default() -> Self {
        InstrumentLogOptions {
            level: None,
            enable_trace: false,
        }
    }
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct InstrumentOptions {
    pub coverage_variable: String,
    pub compact: bool,
    pub report_logic: bool,
    pub ignore_class_methods: Vec<String>,
    pub input_source_map: Option<SourceMap>,
    pub instrument_log: InstrumentLogOptions,
    pub debug_initial_coverage_comment: bool,
}

impl Default for InstrumentOptions {
    fn default() -> Self {
        InstrumentOptions {
            coverage_variable: "__coverage__".to_string(),
            compact: false,
            report_logic: false,
            ignore_class_methods: Default::default(),
            input_source_map: Default::default(),
            instrument_log: Default::default(),
            debug_initial_coverage_comment: false,
        }
    }
}