1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

refactor: remove old cjs_esm_translations in graph_util (#17643)

This isn't used.
This commit is contained in:
David Sherret 2023-02-03 23:00:50 -05:00 committed by GitHub
parent a635c9700c
commit 1e75e5ecc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 17 deletions

View file

@ -66,7 +66,6 @@ pub struct GraphData {
/// error messages.
referrer_map: HashMap<ModuleSpecifier, Box<Range>>,
graph_imports: Vec<GraphImport>,
cjs_esm_translations: HashMap<ModuleSpecifier, String>,
}
impl GraphData {
@ -311,7 +310,6 @@ impl GraphData {
npm_packages: self.npm_packages.clone(),
referrer_map,
graph_imports: self.graph_imports.to_vec(),
cjs_esm_translations: Default::default(),
})
}
@ -465,13 +463,6 @@ impl GraphData {
}
None
}
pub fn get_cjs_esm_translation<'a>(
&'a self,
specifier: &ModuleSpecifier,
) -> Option<&'a String> {
self.cjs_esm_translations.get(specifier)
}
}
impl From<&ModuleGraph> for GraphData {

View file

@ -96,14 +96,7 @@ impl CliModuleLoader {
| MediaType::Unknown
| MediaType::Cjs
| MediaType::Mjs
| MediaType::Json => {
if let Some(source) = graph_data.get_cjs_esm_translation(specifier)
{
source.to_owned()
} else {
code.to_string()
}
}
| MediaType::Json => code.to_string(),
MediaType::Dts | MediaType::Dcts | MediaType::Dmts => "".to_string(),
MediaType::TypeScript
| MediaType::Mts