From 610b09ccec38035cf2d508c26b13531cc07c0045 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 16 Feb 2025 22:16:39 +0100 Subject: [PATCH] use string instead of symbol for safety --- src/webpack/webpack.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts index 175ff9c21..c2b7f18fc 100644 --- a/src/webpack/webpack.ts +++ b/src/webpack/webpack.ts @@ -114,7 +114,7 @@ const TypedArray = Object.getPrototypeOf(Int8Array); // Discord might export a Proxy that returns non-null values for any property key (e.g. their i18n Proxy) // We can use a unique symbol to detect this and ignore it -const uniqueSymbol = Symbol("matchesLiterallyAnything"); +const uniqueName = "is this a proxy that returns values for any key?"; function _shouldIgnoreValue(value: any) { if (value == null) return true; @@ -135,14 +135,14 @@ export function _shouldIgnoreModule(exports: any) { return false; } - if (exports[uniqueSymbol]) { + if (exports[uniqueName]) { return true; } let allNonEnumerable = true; for (const exportKey in exports) { const exp = exports[exportKey]; - if (exp?.[uniqueSymbol]) { + if (exp?.[uniqueName]) { return true; }