Apply suggestions from code review

Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
v 2025-02-17 01:37:51 +01:00 committed by GitHub
parent bb90ec3cb3
commit 434fd8ae52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -191,8 +191,8 @@ define(Function.prototype, "m", {
define(this, "m", { value: proxiedModuleFactories });
// Overwrite webpack's defineExports function to define the export descriptors configurable.
// This is needed so we can later blacklist specific exports from webpack search by making them non-enumerable
// Overwrite Webpack's defineExports function to define the export descriptors configurable.
// This is needed so we can later blacklist specific exports from Webpack search by making them non-enumerable
this.d = function (exports: object, getters: object) {
for (const key in getters) {
if (Object.hasOwn(getters, key) && !Object.hasOwn(exports, key)) {

View file

@ -135,13 +135,13 @@ function makePropertyNonEnumerable(target: Object, key: PropertyKey) {
});
}
export function _blacklistBadModules(requireCache: NonNullable<AnyWebpackRequire["c"]>, exports: any, moduleId: PropertyKey) {
export function _blacklistBadModules(requireCache: NonNullable<AnyWebpackRequire["c"]>, exports: ModuleExports, moduleId: PropertyKey) {
if (_shouldIgnoreValue(exports)) {
makePropertyNonEnumerable(requireCache, moduleId);
return true;
}
if (typeof exports !== "object" || exports == null) {
if (typeof exports !== "object") {
return false;
}