babel-plugin-redux-state-compose
Version:
compose redux State type
17 lines (14 loc) • 469 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getImportPath = getImportPath;
var _path = require('path');
function getImportPath(from, to) {
var relativePath = (0, _path.relative)((0, _path.dirname)(from), to);
var fomattedPath = (0, _path.extname)(relativePath) === '.js' ? relativePath.replace('.js', '') : relativePath;
if (!/^\.\.?/.test(fomattedPath)) {
return './' + fomattedPath;
}
return fomattedPath;
}