Unit_AI/node_modules/form-data-encoder/lib/cjs/util/isFileLike.js

17 lines
649 B
JavaScript
Raw Normal View History

2024-06-01 21:24:36 +01:00
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFileLike = void 0;
const isFunction_1 = __importDefault(require("./isFunction"));
const isFileLike = (value) => Boolean(value
&& typeof value === "object"
&& (0, isFunction_1.default)(value.constructor)
&& value[Symbol.toStringTag] === "File"
&& (0, isFunction_1.default)(value.stream)
&& value.name != null
&& value.size != null
&& value.lastModified != null);
exports.isFileLike = isFileLike;