diff --git a/src/utils/util.js b/src/utils/util.js index 27ac48c..d457c00 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -20,8 +20,15 @@ export function isBuffer(content) { } export function isFile(content) { - const isNodeFile = content && typeof content === 'object' && - typeof content.isNodeJs === 'boolean' && - content.isNodeJs; - return (content instanceof File) || isNodeFile; + if (isNodejs()) { + return content && typeof content === 'object' && + typeof content.isNodeJs === 'boolean' && + content.isNodeJs; + } else { + return content instanceof File; + } +} + +export function isNodejs() { + return typeof process !== 'undefined' && !!process.versions && !!process.versions.node; }