'use strict';

var _ = require('lodash');
var path = require('path');

function System() {
  var self = this;
  self.clearCache = clearCache;

  function clearCache(files) {
    if (files) {
      clearCacheForFiles(files);
    } else {
      clearAllCache();
    }
  }

  function clearCacheForFiles(files) {
    _.forEach(files, function (file) {
      delete require.cache[path.resolve(file)];
    });
  }

  function clearAllCache() {
    _.forOwn(require.cache, function (value, key) {
      delete require.cache[key];
    });
  }
}

module.exports = System;

@@ -480,24 +480,57 @@
 lue, key) %7B%0A
+      if (/%5C.js$/.test(key)) %7B%0A  
       delete
@@ -550,16 +550,24 @@
 e%5Bkey%5D;%0A
+      %7D%0A
     %7D);%0A

Clear cache only clear JS files