diff --git a/index.js b/index.js index 292e4ee..426fe00 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -function e(e){return e&&e.default||e}module.exports=global.DOMPurify=global.DOMPurify||("undefined"==typeof process?e(require("dompurify")):function(){const r=e(require("dompurify")),{JSDOM:u}=e(require("jsdom")),{window:o}=new u("");return r(o)}()); \ No newline at end of file +function e(e){return e&&e.default||e}module.exports=global.DOMPurify=global.DOMPurify||("undefined"!=typeof window?e(require("dompurify")):function(){const r=e(require("dompurify")),{JSDOM:u}=e(require("jsdom")),{window:o}=new u("");return r(o)}()); \ No newline at end of file diff --git a/src/index.js b/src/index.js index 3cd35d4..4ea465d 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,7 @@ function initDOMPurifyWithJSDOM() { } function resolveDOMPurify() { - const isClientSide = typeof process === 'undefined'; + const isClientSide = typeof window !== 'undefined'; return isClientSide ? importModule(require('dompurify')) : initDOMPurifyWithJSDOM(); }