docs: fixed sidebar in API reference (#5871)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { isElmWindow } from "./is-elm-window"
|
||||
|
||||
export function getScrolledTop(elm?: Element | Window): number {
|
||||
if (!elm) {
|
||||
return 0
|
||||
}
|
||||
return isElmWindow(elm) ? elm.scrollY : elm.scrollTop
|
||||
}
|
||||
@@ -3,4 +3,6 @@ export * from "./capitalize"
|
||||
export * from "./check-sidebar-item-visibility"
|
||||
export * from "./dom-utils"
|
||||
export * from "./format-report-link"
|
||||
export * from "./get-scrolled-top"
|
||||
export * from "./is-elm-window"
|
||||
export * from "./swr-fetcher"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export function isElmWindow(elm: unknown): elm is Window {
|
||||
return typeof window !== "undefined" && elm === window
|
||||
}
|
||||
Reference in New Issue
Block a user