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

Function __rewriteRelativeImportExtension

tslib.es6.mjs:359–366  ·  view source on GitHub ↗
(path, preserveJsx)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…