Appearance
Function: isFileImage()
ts
function isFileImage(file: MwFile): boolean;Defined in: src/file/mwFile.ts:218
Check if a file is an image.
Parameters
| Parameter | Type | Description |
|---|---|---|
file | MwFile | The MwFile to check. |
Returns
boolean
true if the file MIME type starts with image/, false otherwise.
Example
ts
const photo = convertBase64ToMwFile(data, 'sunset.png', 'image/png');
if (isFileImage(photo)) {
console.log('This is an image file.');
}