From c4cde745896b4d845a11dc5aeb72405074c9a0c5 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 24 Sep 2024 16:52:24 -0700 Subject: [PATCH] Missed update --- tslib.es6.js | 4 ++-- tslib.es6.mjs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tslib.es6.js b/tslib.es6.js index 2c7eaad..ddd87f6 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -350,8 +350,8 @@ export function __disposeResources(env) { export function __rewriteRelativeImportExtension(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; diff --git a/tslib.es6.mjs b/tslib.es6.mjs index 9c2c3f3..a1d9ef5 100644 --- a/tslib.es6.mjs +++ b/tslib.es6.mjs @@ -349,8 +349,8 @@ export function __disposeResources(env) { export function __rewriteRelativeImportExtension(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;