From 8df969c1db02c859e5cac0accd320a256a43d313 Mon Sep 17 00:00:00 2001 From: Avior Date: Wed, 11 Jan 2023 20:32:51 +0100 Subject: [PATCH] fix: Issue regarding browser loading Signed-off-by: Avior --- src/tcgdex.browser.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tcgdex.browser.ts b/src/tcgdex.browser.ts index f3475cd..352e68f 100644 --- a/src/tcgdex.browser.ts +++ b/src/tcgdex.browser.ts @@ -3,4 +3,9 @@ import unfetch from 'unfetch' TCGdex.fetch = window.fetch ?? unfetch as any -(global ?? window).TCGdex = TCGdex +if (typeof global !== 'undefined') { + global.TCGdex = TCGdex +} +if (typeof window !== 'undefined') { + (window as any).TCGdex = TCGdex +}