isFile es-toolkit
Checks if a value is a File object.
Usage
isFile(value)
Use isFile when you want to check if a value is a File instance. A File object represents a file uploaded by a user or obtained from the file system as part of the web API. Unlike Blob objects, it contains additional information such as the filename and last modified time.
Can be used to validate if a given argument is a valid file.
Safely handles environments where File is not supported in JavaScript.
Parameters
valueunknownrequired
The value to check if it's a File object.
Returns
Returns true if the value is a File object, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.