Unit_AI/node_modules/form-data-encoder/lib/esm/util/isFileLike.js
2024-06-01 16:24:36 -04:00

9 lines
327 B
JavaScript

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