summaryrefslogtreecommitdiff
path: root/cli/proc_state.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-06-14 10:05:37 -0400
committerGitHub <noreply@github.com>2022-06-14 10:05:37 -0400
commit443041c23e2e02ea59d69e1f2093c67ddfd818fd (patch)
tree06f449773377ec655982d00cdaf4bbd60857973f /cli/proc_state.rs
parentfc3a966a2d0be8fc76c384603bf18b55e0bbcf14 (diff)
feat(vendor): support using an existing import map (#14836)
Diffstat (limited to 'cli/proc_state.rs')
-rw-r--r--cli/proc_state.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/proc_state.rs b/cli/proc_state.rs
index d90b3f952..2c454c0ee 100644
--- a/cli/proc_state.rs
+++ b/cli/proc_state.rs
@@ -51,7 +51,6 @@ use deno_runtime::deno_tls::rustls::RootCertStore;
use deno_runtime::deno_web::BlobStore;
use deno_runtime::inspector_server::InspectorServer;
use deno_runtime::permissions::Permissions;
-use import_map::parse_from_json;
use import_map::ImportMap;
use log::warn;
use std::collections::HashSet;
@@ -737,7 +736,12 @@ pub fn import_map_from_text(
specifier: &Url,
json_text: &str,
) -> Result<ImportMap, AnyError> {
- let result = parse_from_json(specifier, json_text)?;
+ debug_assert!(
+ !specifier.as_str().contains("../"),
+ "Import map specifier incorrectly contained ../: {}",
+ specifier.as_str()
+ );
+ let result = import_map::parse_from_json(specifier, json_text)?;
if !result.diagnostics.is_empty() {
warn!(
"Import map diagnostics:\n{}",
@@ -747,7 +751,7 @@ pub fn import_map_from_text(
.map(|d| format!(" - {}", d))
.collect::<Vec<_>>()
.join("\n")
- )
+ );
}
Ok(result.import_map)
}