mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-23 15:05:11 +00:00
use string instead of symbol for safety
This commit is contained in:
parent
de2565a7ea
commit
610b09ccec
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue