From 2d6700aafbe02a16d1f22f8d68e257dc8a4c51ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Isager=20Dalsgar=C3=B0?= Date: Tue, 15 Oct 2024 13:16:42 +0200 Subject: [PATCH] Simplify internal preresolution --- index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 86b231a..bc5479d 100644 --- a/index.js +++ b/index.js @@ -184,12 +184,8 @@ exports.directory = function * (dirname, parentURL, opts = {}) { // Internal preresolution path, do not depend on this! It will be removed without // warning. if (resolutions) { - const imports = resolutions[directoryURL.href] - - if (typeof imports === 'object' && imports !== null) { - if (yield * resolve.packageImportsExports('bare:addon', imports, directoryURL, true, opts)) { - return true - } + if (yield * resolve.preresolved('bare:addon', resolutions, directoryURL, opts)) { + return true } }