UNPKG

rtcmulticonnection

Version:

RTCMultiConnection is a WebRTC JavaScript wrapper library runs top over RTCPeerConnection API to support all possible peer-to-peer features.

29 lines (23 loc) 736 B
// removing JSON from cache function uncache(jsonFile) { searchCache(jsonFile, function(mod) { delete require.cache[mod.id]; }); Object.keys(module.constructor._pathCache).forEach(function(cacheKey) { if (cacheKey.indexOf(jsonFile) > 0) { delete module.constructor._pathCache[cacheKey]; } }); } function searchCache(jsonFile, callback) { var mod = require.resolve(jsonFile); if (mod && ((mod = require.cache[mod]) !== undefined)) { (function run(mod) { mod.children.forEach(function(child) { run(child); }); callback(mod); })(mod); } } module.exports = exports = uncache;