From 4d83d1c91e8a13ae639032e7cba3900d7729ffc5 Mon Sep 17 00:00:00 2001 From: Marcel Mraz Date: Thu, 25 Apr 2024 14:36:26 +0100 Subject: [PATCH] fix: use Reflect API instead of Object.hasOwn (#7958) --- packages/excalidraw/store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/store.ts b/packages/excalidraw/store.ts index 5d8bb2418..8200eab8c 100644 --- a/packages/excalidraw/store.ts +++ b/packages/excalidraw/store.ts @@ -22,7 +22,7 @@ export const getObservedAppState = (appState: AppState): ObservedAppState => { selectedLinearElementId: appState.selectedLinearElement?.elementId || null, }; - Object.defineProperty(observedAppState, hiddenObservedAppStateProp, { + Reflect.defineProperty(observedAppState, hiddenObservedAppStateProp, { value: true, enumerable: false, }); @@ -33,7 +33,7 @@ export const getObservedAppState = (appState: AppState): ObservedAppState => { const isObservedAppState = ( appState: AppState | ObservedAppState, ): appState is ObservedAppState => - Object.hasOwn(appState, hiddenObservedAppStateProp); + !!Reflect.get(appState, hiddenObservedAppStateProp); export type StoreActionType = "capture" | "update" | "none";