From bf1f13b723b7e51ab7c3d7d452a049c51b6da0b7 Mon Sep 17 00:00:00 2001 From: inokawa <48897392+inokawa@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:35:21 +0900 Subject: [PATCH] Refactor --- src/core/environment.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/environment.ts b/src/core/environment.ts index f173e7afe..ba31537e6 100644 --- a/src/core/environment.ts +++ b/src/core/environment.ts @@ -5,7 +5,7 @@ import { computeStyle, once } from "./utils"; */ export const isBrowser = typeof window !== "undefined"; -const getDocumentRoot = () => document.documentElement; +const getDocumentElement = () => document.documentElement; /** * The scroll position may be negative value in rtl direction. @@ -35,7 +35,7 @@ export const hasNegativeOffsetInRTL = /*#__PURE__*/ once( export const isRTLDocument = /*#__PURE__*/ once((): boolean => { // TODO support SSR in rtl return isBrowser - ? computeStyle(getDocumentRoot()).direction === "rtl" + ? computeStyle(getDocumentElement()).direction === "rtl" : false; }); @@ -51,5 +51,5 @@ export const isIOSWebKit = /*#__PURE__*/ once((): boolean => { * @internal */ export const isSmoothScrollSupported = /*#__PURE__*/ once((): boolean => { - return "scrollBehavior" in getDocumentRoot().style; + return "scrollBehavior" in getDocumentElement().style; });