From a6ca4d0d61c95b9f7fa79ecce81a31a6d1f6cc5d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 22 Feb 2023 14:15:25 -0500 Subject: refactor: use deno_graph for npm specifiers (#17858) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes npm specifiers to be handled by deno_graph and resolved to an npm package name and version when the specifier is encountered. It also slightly changes how npm specifier resolution occurs—previously it would collect all the npm specifiers and resolve them all at once, but now it resolves them on the fly as they are encountered in the module graph. https://github.com/denoland/deno_graph/pull/232 --------- Co-authored-by: Bartek Iwańczuk --- ext/node/polyfill.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/node') diff --git a/ext/node/polyfill.rs b/ext/node/polyfill.rs index cedf1dd78..18faa6ea5 100644 --- a/ext/node/polyfill.rs +++ b/ext/node/polyfill.rs @@ -1,15 +1,15 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. pub fn find_builtin_node_module( - specifier: &str, + module_name: &str, ) -> Option<&NodeModulePolyfill> { SUPPORTED_BUILTIN_NODE_MODULES .iter() - .find(|m| m.name == specifier) + .find(|m| m.name == module_name) } -pub fn is_builtin_node_module(specifier: &str) -> bool { - find_builtin_node_module(specifier).is_some() +pub fn is_builtin_node_module(module_name: &str) -> bool { + find_builtin_node_module(module_name).is_some() } pub struct NodeModulePolyfill { -- cgit v1.2.3