summaryrefslogtreecommitdiff
path: root/cli/tsc_config.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2021-01-01 08:43:54 +1100
committerGitHub <noreply@github.com>2021-01-01 08:43:54 +1100
commit012f99bd9a0463813653bf8438e09b3247395984 (patch)
treeda00dc71787f564bf1cd8308ebc3fad621fb7771 /cli/tsc_config.rs
parent5f4e1767fea326d507395eafee25ab4ecc4b67b9 (diff)
refactor(cli): runtime compiler APIs consolidated to Deno.emit() (#8799)
Closes: #4752
Diffstat (limited to 'cli/tsc_config.rs')
-rw-r--r--cli/tsc_config.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/cli/tsc_config.rs b/cli/tsc_config.rs
index 16661c768..1f420ed3a 100644
--- a/cli/tsc_config.rs
+++ b/cli/tsc_config.rs
@@ -49,6 +49,15 @@ impl fmt::Display for IgnoredCompilerOptions {
}
}
+impl Serialize for IgnoredCompilerOptions {
+ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+ where
+ S: Serializer,
+ {
+ Serialize::serialize(&self.items, serializer)
+ }
+}
+
/// A static slice of all the compiler options that should be ignored that
/// either have no effect on the compilation or would cause the emit to not work
/// in Deno.
@@ -64,7 +73,6 @@ pub const IGNORED_COMPILER_OPTIONS: &[&str] = &[
"importHelpers",
"inlineSourceMap",
"inlineSources",
- "isolatedModules",
"module",
"noEmitHelpers",
"noLib",
@@ -97,6 +105,7 @@ pub const IGNORED_RUNTIME_COMPILER_OPTIONS: &[&str] = &[
"help",
"incremental",
"init",
+ "isolatedModules",
"listEmittedFiles",
"listFiles",
"mapRoot",
@@ -246,6 +255,14 @@ impl TsConfig {
}
}
+ pub fn get_declaration(&self) -> bool {
+ if let Some(declaration) = self.0.get("declaration") {
+ declaration.as_bool().unwrap_or(false)
+ } else {
+ false
+ }
+ }
+
/// Merge a serde_json value into the configuration.
pub fn merge(&mut self, value: &Value) {
json_merge(&mut self.0, value);