Skip to content

Commit 20ffccd

Browse files
authored
feat(window): be safe on window
1 parent a641820 commit 20ffccd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ function resolveInput(input: string): string {
324324
if (canParseURL(input)) return input;
325325

326326
// Window context
327-
if (typeof window.document !== 'undefined') {
327+
if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {
328328
return new URL(input, window.document.baseURI).toString();
329329
}
330330

0 commit comments

Comments
 (0)