UNPKG

babel-plugin-redux-state-compose

Version:
17 lines (14 loc) 469 B
'use strict'; 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; }