Skip to content

Commit b825335

Browse files
author
James Hill
committed
Fixed window check for use server side
1 parent 7cd7062 commit b825335

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hypnode",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Tag = string | ((attrs?: IAttrs) => HTMLElement);
3333
* -------------------------------- */
3434

3535
function h(tag: Tag, attrs?: IAttrs, ...children: any[]): HTMLElement {
36-
const { document } = window || {};
36+
const { document = null } = typeof window !== 'undefined' ? window : {};
3737

3838
children = [].concat.apply([], children);
3939

0 commit comments

Comments
 (0)