'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = calculateFileInfo;

var _path;

function _load_path() {
  return _path = _interopRequireDefault(require('path'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * get the current working dir name of file and file name.
 * @name fileInfo
 * @param relativePath
 * @returns {object}
 * @example
 * ```js
 *  currentDirName() // => 'bit'
 * ```
 */
function calculateFileInfo(relativePath) {
  var fileInfo = (_path || _load_path()).default.parse(relativePath);
  var fullPath = (_path || _load_path()).default.dirname(relativePath);
  var rootDir = (_path || _load_path()).default.dirname(fullPath);
  var parentDir = (_path || _load_path()).default.relative(rootDir, fullPath);
  return { PARENT: parentDir, FILE_NAME: fileInfo.name };
}