diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-22 18:37:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 17:37:28 +0000 |
commit | d20c9e75d1540b1a27e721d0cf66d29ba6a2c3fb (patch) | |
tree | 83059b5759fad286d8131795d7d79d6fee5bb440 /cli/args/mod.rs | |
parent | bc92f872988fd8b9cdf2ae1479278789911237a5 (diff) |
refactor: add "UnstableConfig" struct to cli/args/flags.rs (#21993)
This commit adds "UnstableConfig" struct which centralizes
handling of all "--unstable-*" flags.
Closes https://github.com/denoland/deno/issues/21920
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 1fdd2f503..c6bc712f8 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1409,12 +1409,12 @@ impl CliOptions { &self.flags.unsafely_ignore_certificate_errors } - pub fn unstable(&self) -> bool { - self.flags.unstable + pub fn legacy_unstable_flag(&self) -> bool { + self.flags.unstable_config.legacy_flag_enabled } pub fn unstable_bare_node_builtins(&self) -> bool { - self.flags.unstable_bare_node_builtins + self.flags.unstable_config.bare_node_builtins || self .maybe_config_file() .as_ref() @@ -1423,7 +1423,7 @@ impl CliOptions { } pub fn unstable_byonm(&self) -> bool { - self.flags.unstable_byonm + self.flags.unstable_config.byonm || NPM_PROCESS_STATE .as_ref() .map(|s| matches!(s.kind, NpmProcessStateKind::Byonm)) @@ -1436,7 +1436,7 @@ impl CliOptions { } pub fn unstable_sloppy_imports(&self) -> bool { - self.flags.unstable_sloppy_imports + self.flags.unstable_config.sloppy_imports || self .maybe_config_file() .as_ref() @@ -1451,7 +1451,7 @@ impl CliOptions { .map(|c| c.json.unstable.clone()) .unwrap_or_default(); - from_config_file.extend_from_slice(&self.flags.unstable_features); + from_config_file.extend_from_slice(&self.flags.unstable_config.features); from_config_file } |