Skip to content

Commit 4ffe3c4

Browse files
committed
Remove documentation for deprecated isFileLike helper
1 parent 8b111ee commit 4ffe3c4

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

src/util/isFile.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,6 @@ export const isFile = (value: unknown): value is FileLike => Boolean(
4242
)
4343

4444
/**
45-
* Check if given object is `File`.
46-
*
47-
* Note that this function will return `false` for Blob, because the FormDataEncoder expects FormData to return File when a value is binary data.
48-
*
49-
* @param value an object to test
50-
*
51-
* @api public
52-
*
5345
* @deprecated use `isFile` instead
54-
*
55-
* This function will return `true` for FileAPI compatible `File` objects:
56-
*
57-
* ```
58-
* import {isFileLike} from "form-data-encoder"
59-
*
60-
* isFileLike(new File(["Content"], "file.txt")) // -> true
61-
* ```
62-
*
63-
* However, if you pass a Node.js `Buffer` or `ReadStream`, it will return `false`:
64-
*
65-
* ```js
66-
* import {createReadStream} from "node:fs"
67-
*
68-
* import {isFileLike} from "form-data-encoder"
69-
*
70-
* isFileLike(Buffer.from("Content")) // -> false
71-
* isFileLike(createReadStream("path/to/a/file.txt")) // -> false
72-
* ```
73-
*/
46+
*/
7447
export const isFileLike = isFile

0 commit comments

Comments
 (0)