MCPcopy Create free account
hub / github.com/microsoft/tslib / __rewriteRelativeImportExtension

Function __rewriteRelativeImportExtension

tslib.es6.js:360–367  ·  view source on GitHub ↗
(path, preserveJsx)

Source from the content-addressed store, hash-verified

358}
359
360export function __rewriteRelativeImportExtension(path, preserveJsx) {
361 if (typeof path === "string" && /^\.\.?\//.test(path)) {
362 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
363 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
364 });
365 }
366 return path;
367}
368
369export default {
370 __extends: __extends,

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…