From 85910d8d1506ca96b40859e1b244e84198f8ce4e Mon Sep 17 00:00:00 2001 From: Pasquale Boemio Date: Sat, 4 Dec 2021 10:48:37 +0100 Subject: [PATCH] Added window object check With this pull request we can use the library in a server-side environment like node.js --- src/iodine.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/iodine.js b/src/iodine.js index f8705b6..0f32be7 100644 --- a/src/iodine.js +++ b/src/iodine.js @@ -457,4 +457,6 @@ export class Iodine { * Create an instance of the library. * */ -window.Iodine = new Iodine(); +if(typeof window !== undefined) { + window.Iodine = new Iodine(); +}