summaryrefslogtreecommitdiff
path: root/src/deno_dir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/deno_dir.rs')
-rw-r--r--src/deno_dir.rs24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/deno_dir.rs b/src/deno_dir.rs
index d3d67d195..3b35035d6 100644
--- a/src/deno_dir.rs
+++ b/src/deno_dir.rs
@@ -1,4 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+use compiler::CodeFetchOutput;
use dirs;
use errors;
use errors::DenoError;
@@ -19,25 +20,6 @@ use std::result::Result;
use url;
use url::Url;
-#[derive(Debug)]
-pub struct CodeFetchOutput {
- pub module_name: String,
- pub filename: String,
- pub media_type: msg::MediaType,
- pub source_code: String,
- pub maybe_output_code: Option<String>,
- pub maybe_source_map: Option<String>,
-}
-
-impl CodeFetchOutput {
- pub fn js_source<'a>(&'a self) -> &'a String {
- match self.maybe_output_code {
- None => &self.source_code,
- Some(ref output_code) => output_code,
- }
- }
-}
-
/// Gets corresponding MediaType given extension
fn extmap(ext: &str) -> msg::MediaType {
match ext {
@@ -319,6 +301,10 @@ impl DenoDir {
out.source_code = filter_shebang(out.source_code);
+ if out.media_type != msg::MediaType::TypeScript {
+ return Ok(out);
+ }
+
let result =
self.load_cache(out.filename.as_str(), out.source_code.as_str());
match result {