bifocal/node_modules/form-data-encoder/lib/util/isFile.js

9 lines
301 B
JavaScript

import { isFunction } from "./isFunction.js";
export const isFile = (value) => Boolean(value
&& typeof value === "object"
&& isFunction(value.constructor)
&& value[Symbol.toStringTag] === "File"
&& isFunction(value.stream)
&& value.name != null);
export const isFileLike = isFile;