From 01adbb1efb116d72dc24843294f335bd63b24b0a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 28 Jun 2022 16:45:55 -0400 Subject: refactor: add `RootConfig` (#14985) --- cli/graph_util.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cli/graph_util.rs') diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 533c9a493..991115319 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -1,8 +1,9 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use crate::colors; -use crate::emit::TypeLib; +use crate::emit::TsTypeLib; use crate::errors::get_error_class_name; + use deno_core::error::custom_error; use deno_core::error::AnyError; use deno_core::ModuleSpecifier; @@ -43,7 +44,7 @@ pub enum ModuleEntry { ts_check: bool, /// A set of type libs that the module has passed a type check with this /// session. This would consist of window, worker or both. - checked_libs: HashSet, + checked_libs: HashSet, maybe_types: Option, }, Configuration { @@ -385,7 +386,7 @@ impl GraphData { pub fn set_type_checked( &mut self, roots: &[(ModuleSpecifier, ModuleKind)], - lib: &TypeLib, + lib: TsTypeLib, ) { let specifiers: Vec = match self.walk(roots, true, true, true) { @@ -396,7 +397,7 @@ impl GraphData { if let ModuleEntry::Module { checked_libs, .. } = self.modules.get_mut(&specifier).unwrap() { - checked_libs.insert(lib.clone()); + checked_libs.insert(lib); } } } @@ -405,7 +406,7 @@ impl GraphData { pub fn is_type_checked( &self, roots: &[(ModuleSpecifier, ModuleKind)], - lib: &TypeLib, + lib: &TsTypeLib, ) -> bool { roots.iter().all(|(r, _)| { let found = self.follow_redirect(r); -- cgit v1.2.3