From 64212512ca7e89d348978a519bec5dbe2f93205e Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 23 May 2024 23:20:46 -0300 Subject: [PATCH] cya dummyObj --- src/utils/lazy.ts | 8 +------- src/utils/proxyInner.ts | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/utils/lazy.ts b/src/utils/lazy.ts index c3cb0f794..57e68398f 100644 --- a/src/utils/lazy.ts +++ b/src/utils/lazy.ts @@ -78,11 +78,7 @@ export function proxyLazy(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(factory: () => T, attempts = 5, isChild [proxyLazyCache]: void 0 as T | undefined }); - delete dummyObj.ProxyDummy; - const proxy = new Proxy(proxyDummy, { ...handler, get(target, p) { diff --git a/src/utils/proxyInner.ts b/src/utils/proxyInner.ts index 4f6c67991..76eb06f1e 100644 --- a/src/utils/proxyInner.ts +++ b/src/utils/proxyInner.ts @@ -59,11 +59,7 @@ export function proxyInner( 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( [proxyInnerValue]: void 0 as T | undefined }); - delete dummyObj.ProxyDummy; - const proxy = new Proxy(proxyDummy, { ...handler, get(target, p) {