From f8c9f4a9f40909037f15182ebcdc8231eac7516a Mon Sep 17 00:00:00 2001 From: niftylettuce Date: Mon, 17 Jun 2019 01:48:39 -0500 Subject: [PATCH] docs: fixed example for universal usage If we do not set `typeof window === 'undefined'`, then an uncaught exception occurs Node side. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0de31c2..0bdea49 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ You can use a really simple pattern to enable your browser modules to run in Nod ```js function createTitle(text, win) { - win = win || window; + win = win || (typeof window === 'undefined' ? undefined : window); const title = win.document.createElement('h1'); title.innerHTML = text;