From b4658e71535b5713bc4e036c02eaf0d6353aeec1 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Mon, 14 Apr 2025 10:30:45 +0100 Subject: [PATCH] Replace final character in string, as opposted to first instance of * --- jest/node-exports-resolver.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jest/node-exports-resolver.js b/jest/node-exports-resolver.js index 9fbb3cd534..3bb1cadcc3 100644 --- a/jest/node-exports-resolver.js +++ b/jest/node-exports-resolver.js @@ -143,9 +143,7 @@ module.exports = (request, options) => { if (typeof exportValue === 'string') { targetFilePath = exportKey.endsWith('*') - ? exportValue.replace( - /\*/, submoduleName.slice(exportKey.length - 1) - ) + ? exportValue.replace(/.$/, submoduleName.slice(exportKey.length - 1)) : exportValue } else if ( conditions && exportValue != null && typeof exportValue === 'object'