Sha256: 385a7dab4b815134d93c646c1775ab55516f1d18016398fe060aa589741cf03b
Contents?: true
Size: 987 Bytes
Versions: 33
Compression:
Stored size: 987 Bytes
Contents
import type { FileLike } from "../FileLike.js"; /** * Check if given object is `File`. * * Note that this function will return `false` for Blob, because the FormDataEncoder expects FormData to return File when a value is binary data. * * @param value an object to test * * @api public * * This function will return `true` for FileAPI compatible `File` objects: * * ``` * import {createReadStream} from "node:fs" * * import {isFile} from "form-data-encoder" * * isFile(new File(["Content"], "file.txt")) // -> true * ``` * * However, if you pass a Node.js `Buffer` or `ReadStream`, it will return `false`: * * ```js * import {isFile} from "form-data-encoder" * * isFile(Buffer.from("Content")) // -> false * isFile(createReadStream("path/to/a/file.txt")) // -> false * ``` */ export declare const isFile: (value: unknown) => value is FileLike; /** * @deprecated use `isFile` instead */ export declare const isFileLike: (value: unknown) => value is FileLike;
Version data entries
33 entries across 33 versions & 1 rubygems