mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-23 23:15:10 +00:00
Apply suggestions from code review
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
bb90ec3cb3
commit
434fd8ae52
2 changed files with 4 additions and 4 deletions
|
@ -191,8 +191,8 @@ define(Function.prototype, "m", {
|
||||||
|
|
||||||
define(this, "m", { value: proxiedModuleFactories });
|
define(this, "m", { value: proxiedModuleFactories });
|
||||||
|
|
||||||
// Overwrite webpack's defineExports function to define the export descriptors configurable.
|
// 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 is needed so we can later blacklist specific exports from Webpack search by making them non-enumerable
|
||||||
this.d = function (exports: object, getters: object) {
|
this.d = function (exports: object, getters: object) {
|
||||||
for (const key in getters) {
|
for (const key in getters) {
|
||||||
if (Object.hasOwn(getters, key) && !Object.hasOwn(exports, key)) {
|
if (Object.hasOwn(getters, key) && !Object.hasOwn(exports, key)) {
|
||||||
|
|
|
@ -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)) {
|
if (_shouldIgnoreValue(exports)) {
|
||||||
makePropertyNonEnumerable(requireCache, moduleId);
|
makePropertyNonEnumerable(requireCache, moduleId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof exports !== "object" || exports == null) {
|
if (typeof exports !== "object") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue