reshow-runtime
Advanced tools
Comparing version 0.17.5 to 0.17.6
@@ -6,8 +6,8 @@ "use strict"; | ||
var _default = function _default(filepath, extMap) { | ||
if (0 !== filepath.indexOf(".")) { | ||
return filepath; // not local import | ||
var _default = function _default(filePath, extMap) { | ||
if (0 !== filePath.indexOf(".")) { | ||
return filePath; // not local import | ||
} | ||
var baseName = filepath.split("/").splice(-1)[0]; | ||
var baseName = filePath.split("/").splice(-1)[0]; | ||
var extDotPos = baseName.lastIndexOf("."); | ||
@@ -19,14 +19,16 @@ var extNone = extMap[""]; | ||
// No extension | ||
return extNone ? filepath + extNone : filepath; | ||
return extNone ? filePath + extNone : filePath; | ||
} | ||
var extPos = extDotPos + 1; | ||
var extKeys = Object.keys(extMap); | ||
var nextPath = filePath; | ||
var isFind; | ||
var i = extKeys.length; | ||
while (i--) { | ||
var origExt = extKeys[i]; | ||
var fromExt = extKeys[i]; | ||
if (extPos === baseName.lastIndexOf(origExt)) { | ||
filepath = filepath.slice(0, -origExt.length) + extMap[origExt]; | ||
if (extDotPos === baseName.lastIndexOf(fromExt)) { | ||
nextPath = filePath.slice(0, -fromExt.length) + extMap[fromExt]; | ||
isFind = true; | ||
break; | ||
@@ -36,3 +38,7 @@ } | ||
return filepath; | ||
if (extNone && nextPath === filePath && isFind) { | ||
nextPath = filePath + extNone; | ||
} | ||
return nextPath; | ||
}; | ||
@@ -39,0 +45,0 @@ |
{ | ||
"name": "reshow-runtime", | ||
"version": "0.17.5", | ||
"version": "0.17.6", | ||
"description": "Babel runtime alternative", | ||
@@ -5,0 +5,0 @@ "repository": "react-atomic/reshow", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66520
91
1667