From 27b219209a4d35308e9dd6a533e5169a981d2614 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 24 Sep 2024 16:04:07 -0700 Subject: [PATCH] Little optimizations --- tslib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tslib.js b/tslib.js index 53455fd..95beb91 100644 --- a/tslib.js +++ b/tslib.js @@ -398,8 +398,8 @@ var __rewriteRelativeImportExtension; __rewriteRelativeImportExtension = function (path, preserveJsx) { if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|(\.d)?(\.[^./]+?)?\.([cm])?ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (ext && !cm || !ext) ? m : ((d || "") + (ext || "") + "." + (cm || "").toLowerCase() + "js"); + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); }); } return path;