source: trip-planner-front/node_modules/license-webpack-plugin/dist/PluginModuleCache.js@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.8 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.PluginModuleCache = void 0;
4var PluginModuleCache = /** @class */ (function () {
5 function PluginModuleCache() {
6 this.totalCache = {};
7 this.chunkCache = {};
8 this.chunkSeenCache = {};
9 }
10 PluginModuleCache.prototype.registerModule = function (chunkName, module) {
11 this.totalCache[module.name] = module;
12 if (!this.chunkCache[chunkName]) {
13 this.chunkCache[chunkName] = {};
14 }
15 this.chunkCache[chunkName][module.name] = module;
16 };
17 PluginModuleCache.prototype.getModule = function (packageName) {
18 return this.totalCache[packageName] || null;
19 };
20 PluginModuleCache.prototype.markSeenForChunk = function (chunkName, packageName) {
21 if (!this.chunkSeenCache[chunkName]) {
22 this.chunkSeenCache[chunkName] = {};
23 }
24 this.chunkSeenCache[chunkName][packageName] = true;
25 };
26 PluginModuleCache.prototype.alreadySeenForChunk = function (chunkName, packageName) {
27 return !!(this.chunkSeenCache[chunkName] &&
28 this.chunkSeenCache[chunkName][packageName]);
29 };
30 PluginModuleCache.prototype.getAllModulesForChunk = function (chunkName) {
31 var modules = [];
32 var cache = this.chunkCache[chunkName];
33 if (cache) {
34 Object.keys(cache).forEach(function (key) {
35 modules.push(cache[key]);
36 });
37 }
38 return modules;
39 };
40 PluginModuleCache.prototype.getAllModules = function () {
41 var _this = this;
42 var modules = [];
43 Object.keys(this.totalCache).forEach(function (key) {
44 modules.push(_this.totalCache[key]);
45 });
46 return modules;
47 };
48 return PluginModuleCache;
49}());
50exports.PluginModuleCache = PluginModuleCache;
Note: See TracBrowser for help on using the repository browser.