Skip to content

Commit 0328478

Browse files
committed
chore(fix): 🎉 check is node process or browser
1 parent 54a2374 commit 0328478

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/core/BaseProxy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class BaseProxy {
115115
if (!form.hasOwnProperty(property)) {
116116
return false
117117
}
118+
if (typeof window === 'undefined') {
119+
return false
120+
}
118121
if (this.__hasFilesDeep(form[property])) {
119122
return true
120123
}

src/util/objects.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ export function isArray(object: any): boolean {
55
}
66

77
export function isFile(object: any): boolean {
8+
if (typeof window === 'undefined') {
9+
return false
10+
}
811
if (typeof File !== 'function' || typeof FileList !== 'function') {
912
return false
1013
}

0 commit comments

Comments
 (0)