mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 09:33:03 -04:00
Better error for primitives on proxyLazy + fix StartupTimings (#2339)
This commit is contained in:
parent
e0becc1ba0
commit
cba611c1cc
2 changed files with 8 additions and 4 deletions
|
@ -116,8 +116,11 @@ export function proxyLazy<T>(factory: () => T, attempts = 5, isChild = false): T
|
|||
attempts,
|
||||
true
|
||||
);
|
||||
|
||||
return Reflect.get(target[kGET](), p, receiver);
|
||||
const lazyTarget = target[kGET]();
|
||||
if (typeof lazyTarget === "object" || typeof lazyTarget === "function") {
|
||||
return Reflect.get(lazyTarget, p, receiver);
|
||||
}
|
||||
throw new Error("proxyLazy called on a primitive value");
|
||||
}
|
||||
}) as any;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue