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

Version Path
immosquare-cleaner-0.1.60 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.59 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.58 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.57 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.56 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.55 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.54 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.53 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.52 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.51 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.50 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.49 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.48 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.47 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.46 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.45 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.44 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.43 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.42 node_modules/form-data-encoder/@type/util/isFile.d.ts
immosquare-cleaner-0.1.41 node_modules/form-data-encoder/@type/util/isFile.d.ts