From 2fcf1f14cf29bb68995f652f93a4f6e3cb55c8d7 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 21 Mar 2023 11:46:40 -0400 Subject: feat: TypeScript 5.0.2 (except decorators) (#18294) This upgrades TypeScript to 5.0.2, but does not have ES decorator support because swc does not support that yet. --- cli/node/analyze.rs | 2 +- cli/node/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/node') diff --git a/cli/node/analyze.rs b/cli/node/analyze.rs index d1046e275..050cbf0c1 100644 --- a/cli/node/analyze.rs +++ b/cli/node/analyze.rs @@ -49,7 +49,7 @@ pub fn esm_code_with_node_globals( let parsed_source = deno_ast::parse_program(deno_ast::ParseParams { specifier: specifier.to_string(), text_info: text_info.clone(), - media_type: deno_ast::MediaType::from(specifier), + media_type: deno_ast::MediaType::from_specifier(specifier), capture_tokens: true, scope_analysis: true, maybe_syntax: None, diff --git a/cli/node/mod.rs b/cli/node/mod.rs index 4cbb1ef05..3df217722 100644 --- a/cli/node/mod.rs +++ b/cli/node/mod.rs @@ -73,7 +73,7 @@ impl NodeResolution { ) -> (ModuleSpecifier, MediaType) { match resolution { Some(NodeResolution::CommonJs(specifier)) => { - let media_type = MediaType::from(&specifier); + let media_type = MediaType::from_specifier(&specifier); ( specifier, match media_type { @@ -85,7 +85,7 @@ impl NodeResolution { ) } Some(NodeResolution::Esm(specifier)) => { - let media_type = MediaType::from(&specifier); + let media_type = MediaType::from_specifier(&specifier); ( specifier, match media_type { -- cgit v1.2.3