summaryrefslogtreecommitdiff
path: root/cli/tsc_config.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-10-23 11:50:15 +1100
committerGitHub <noreply@github.com>2020-10-23 11:50:15 +1100
commit7e2c7fb6c5454e30158d74e1a5786183ea391f07 (patch)
tree42402aa26a0422b9c46d1d441598dbe803b8ed15 /cli/tsc_config.rs
parent9fa59f0ca8164f5e02ba2a2fa90b6fdbce5c1afb (diff)
refactor(cli): migrate run and cache to new infrastructure (#7996)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/tsc_config.rs')
-rw-r--r--cli/tsc_config.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/tsc_config.rs b/cli/tsc_config.rs
index 15a172a72..9d05c33f7 100644
--- a/cli/tsc_config.rs
+++ b/cli/tsc_config.rs
@@ -214,6 +214,21 @@ impl TsConfig {
self.0.to_string().as_bytes().to_owned()
}
+ /// Return the value of the `checkJs` compiler option, defaulting to `false`
+ /// if not present.
+ pub fn get_check_js(&self) -> bool {
+ if let Some(check_js) = self.0.get("checkJs") {
+ check_js.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);
+ }
+
/// Take an optional string representing a user provided TypeScript config file
/// which was passed in via the `--config` compiler option and merge it with
/// the configuration. Returning the result which optionally contains any