From 53d8d20c9565ecf20c78c503837be48661596c5d Mon Sep 17 00:00:00 2001 From: rory Date: Sat, 24 Feb 2024 09:44:10 -0800 Subject: [PATCH] Create Onyx.log debugging utility --- src/setup/addUtilsToWindow.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/setup/addUtilsToWindow.ts b/src/setup/addUtilsToWindow.ts index 2adb67926f9e..9991a3dc07cd 100644 --- a/src/setup/addUtilsToWindow.ts +++ b/src/setup/addUtilsToWindow.ts @@ -34,6 +34,15 @@ export default function addUtilsToWindow() { }); }; + // @ts-expect-error TS233 - injecting additional utility for use in runtime debugging, should not be used in any compiled code + window.Onyx.log = function (key) { + // @ts-expect-error TS2339 - using additional utility injected above + window.Onyx.get(key).then((value) => { + /* eslint-disable-next-line no-console */ + console.log(value); + }); + }; + window.setSupportToken = Session.setSupportAuthToken; }); }