From bd68002f7b247d49a2af02342e927ef08328c998 Mon Sep 17 00:00:00 2001 From: Michell Ocana do Espirito Santo Date: Fri, 21 Feb 2020 18:31:39 -0300 Subject: [PATCH] fix: adjusting document check for SSR --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 9f82801..69a98a9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ export interface ScrollbarWidth { export const scrollbarWidth: ScrollbarWidth = (force?: boolean): number | undefined => { // safety check for SSR /* istanbul ignore next */ - if (!document) { + if (typeof document === 'undefined') { return 0; }