diff --git a/lib/js-api/src/utils/is-browser.ts b/lib/js-api/src/utils/is-browser.ts index f16f87e949..a66f24e514 100644 --- a/lib/js-api/src/utils/is-browser.ts +++ b/lib/js-api/src/utils/is-browser.ts @@ -15,4 +15,5 @@ * limitations under the License. */ -export const isBrowser = (): boolean => typeof window?.document !== 'undefined'; +// eslint-disable-next-line @typescript-eslint/prefer-optional-chain +export const isBrowser = (): boolean => typeof window !== 'undefined' && typeof window.document !== 'undefined';