Skip to content

Commit

Permalink
chore(fix): 🎉 check is node process or browser
Browse files Browse the repository at this point in the history
  • Loading branch information
TouchSek committed Oct 22, 2020
1 parent 54a2374 commit 0328478
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/BaseProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ class BaseProxy {
if (!form.hasOwnProperty(property)) {
return false
}
if (typeof window === 'undefined') {
return false
}
if (this.__hasFilesDeep(form[property])) {
return true
}
Expand Down
3 changes: 3 additions & 0 deletions src/util/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export function isArray(object: any): boolean {
}

export function isFile(object: any): boolean {
if (typeof window === 'undefined') {
return false
}
if (typeof File !== 'function' || typeof FileList !== 'function') {
return false
}
Expand Down

0 comments on commit 0328478

Please sign in to comment.