From 434fd8ae52330f87f594e81bda1fead9e8125c47 Mon Sep 17 00:00:00 2001 From: v Date: Mon, 17 Feb 2025 01:37:51 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> --- src/webpack/patchWebpack.ts | 4 ++-- src/webpack/webpack.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 3924fcc57..408d3b708 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -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)) { diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts index 71171070c..6784f1429 100644 --- a/src/webpack/webpack.ts +++ b/src/webpack/webpack.ts @@ -135,13 +135,13 @@ function makePropertyNonEnumerable(target: Object, key: PropertyKey) { }); } -export function _blacklistBadModules(requireCache: NonNullable, exports: any, moduleId: PropertyKey) { +export function _blacklistBadModules(requireCache: NonNullable, exports: ModuleExports, moduleId: PropertyKey) { if (_shouldIgnoreValue(exports)) { makePropertyNonEnumerable(requireCache, moduleId); return true; } - if (typeof exports !== "object" || exports == null) { + if (typeof exports !== "object") { return false; }