fix: Issue regarding browser loading

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
Florian Bouillon 2023-01-11 20:32:51 +01:00
parent 2177e9c088
commit 8df969c1db
Signed by: Florian Bouillon
GPG Key ID: BEEAF3722D0EBF64

View File

@ -3,4 +3,9 @@ import unfetch from 'unfetch'
TCGdex.fetch = window.fetch ?? unfetch as any 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
}