Skip to content

Commit 27b2192

Browse files
committed
Little optimizations
1 parent fece22a commit 27b2192

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tslib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ var __rewriteRelativeImportExtension;
398398

399399
__rewriteRelativeImportExtension = function (path, preserveJsx) {
400400
if (typeof path === "string" && /^\.\.?\//.test(path)) {
401-
return path.replace(/\.(tsx)$|(\.d)?(\.[^./]+?)?\.([cm])?ts$/i, function (m, tsx, d, ext, cm) {
402-
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (ext && !cm || !ext) ? m : ((d || "") + (ext || "") + "." + (cm || "").toLowerCase() + "js");
401+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
402+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
403403
});
404404
}
405405
return path;

0 commit comments

Comments
 (0)