From 068b584a49edd41eb16df944ec2648e25fb91872 Mon Sep 17 00:00:00 2001 From: Josef Brandl Date: Sat, 18 Jun 2022 09:54:39 +0200 Subject: [PATCH] Support running on server environments (#199) --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 1fc286e..19bb10f 100644 --- a/index.js +++ b/index.js @@ -48,6 +48,8 @@ const methodMap = [ ]; const nativeAPI = (() => { + if (typeof document === 'undefined') { return false } + const unprefixedMethods = methodMap[0]; const returnValue = {};