oxc_transformer/env/
options.rsuse oxc_diagnostics::Error;
use serde::Deserialize;
use serde_json::Value;
use super::targets::{query::Targets, Versions};
fn default_as_true() -> bool {
true
}
#[derive(Default, Debug, Clone, Deserialize)]
#[serde(default, rename_all = "camelCase", deny_unknown_fields)]
pub struct EnvOptions {
#[serde(default)]
pub targets: Targets,
#[serde(default = "default_as_true")]
pub bugfixes: bool,
pub spec: bool,
pub loose: bool,
pub modules: Option<Value>,
pub debug: bool,
pub include: Option<Value>,
pub exclude: Option<Value>,
pub use_built_ins: Option<Value>,
pub corejs: Option<Value>,
pub force_all_transforms: bool,
pub config_path: Option<String>,
pub ignore_browserslist_config: bool,
pub shipped_proposals: bool,
}
impl EnvOptions {
pub fn get_targets(&self) -> Result<Versions, Error> {
self.targets.clone().get_targets()
}
}