Update 0BDFDB.plugin.js
This commit is contained in:
parent
80f7a39c3f
commit
7f679184fc
|
@ -1171,13 +1171,15 @@ module.exports = (_ => {
|
||||||
Internal.findModule = function (type, cacheString, filter, config = {}) {
|
Internal.findModule = function (type, cacheString, filter, config = {}) {
|
||||||
if (!BDFDB.ObjectUtils.is(Cache.modules[type])) Cache.modules[type] = {module: {}, export: {}};
|
if (!BDFDB.ObjectUtils.is(Cache.modules[type])) Cache.modules[type] = {module: {}, export: {}};
|
||||||
let defaultExport = typeof config.defaultExport != "boolean" ? true : config.defaultExport;
|
let defaultExport = typeof config.defaultExport != "boolean" ? true : config.defaultExport;
|
||||||
if (defaultExport && Cache.modules[type].export[cacheString]) return Cache.modules[type].export[cacheString];
|
if (!config.all && defaultExport && Cache.modules[type].export[cacheString]) return Cache.modules[type].export[cacheString];
|
||||||
else if (!defaultExport && Cache.modules[type].module[cacheString]) return Cache.modules[type].module[cacheString];
|
else if (!config.all && !defaultExport && Cache.modules[type].module[cacheString]) return Cache.modules[type].module[cacheString];
|
||||||
else {
|
else {
|
||||||
let m = BDFDB.ModuleUtils.find(filter, config);
|
let m = BDFDB.ModuleUtils.find(filter, config);
|
||||||
if (m) {
|
if (m) {
|
||||||
if (defaultExport) Cache.modules[type].export[cacheString] = m;
|
if (!config.all) {
|
||||||
else Cache.modules[type].module[cacheString] = m;
|
if (defaultExport) Cache.modules[type].export[cacheString] = m;
|
||||||
|
else Cache.modules[type].module[cacheString] = m;
|
||||||
|
}
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
else if (!config.noWarnings) BDFDB.LogUtils.warn(`${cacheString} [${type}] not found in WebModules`);
|
else if (!config.noWarnings) BDFDB.LogUtils.warn(`${cacheString} [${type}] not found in WebModules`);
|
||||||
|
|
Loading…
Reference in New Issue