cya dummyObj

This commit is contained in:
Nuckyz 2024-05-23 23:20:46 -03:00
parent 74f36a093b
commit 64212512ca
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 2 additions and 14 deletions

View file

@ -78,11 +78,7 @@ export function proxyLazy<T = AnyObject>(factory: () => T, attempts = 5, isChild
if (!isChild) setTimeout(() => isSameTick = false, 0);
// Define the function in an object to preserve the name after minification
const dummyObj = {
ProxyDummy() { }
} as { ProxyDummy: any; };
const proxyDummy = dummyObj.ProxyDummy;
const proxyDummy = ({ ProxyDummy() { } }).ProxyDummy;
Object.assign(proxyDummy, {
[proxyLazyGet]() {
if (!proxyDummy[proxyLazyCache]) {
@ -105,8 +101,6 @@ export function proxyLazy<T = AnyObject>(factory: () => T, attempts = 5, isChild
[proxyLazyCache]: void 0 as T | undefined
});
delete dummyObj.ProxyDummy;
const proxy = new Proxy(proxyDummy, {
...handler,
get(target, p) {

View file

@ -59,11 +59,7 @@ export function proxyInner<T = AnyObject>(
if (!isChild) setTimeout(() => isSameTick = false, 0);
// Define the function in an object to preserve the name after minification
const dummyObj = {
ProxyDummy() { }
} as { ProxyDummy: any; };
const proxyDummy = dummyObj.ProxyDummy;
const proxyDummy = ({ ProxyDummy() { } }).ProxyDummy;
Object.assign(proxyDummy, {
[proxyInnerGet]: function () {
if (proxyDummy[proxyInnerValue] == null) {
@ -75,8 +71,6 @@ export function proxyInner<T = AnyObject>(
[proxyInnerValue]: void 0 as T | undefined
});
delete dummyObj.ProxyDummy;
const proxy = new Proxy(proxyDummy, {
...handler,
get(target, p) {