'use strict';

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

var _module;

function _load_module() {
  return _module = _interopRequireDefault(require('module'));
}

var _filterObject;

function _load_filterObject() {
  return _filterObject = _interopRequireDefault(require('./filter-object'));
}

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

// remove any cached module path for a module name (Module._pathCache)

// $FlowFixMe
function removeFromRequireCache(currentRequestName) {
  (_module || _load_module()).default._pathCache = (0, (_filterObject || _load_filterObject()).default)((_module || _load_module()).default._pathCache, function (val, key) {
    var cachedRequestName = JSON.parse(key).request;
    return currentRequestName !== cachedRequestName;
  });
}