(file)
| 324 | ]); |
| 325 | |
| 326 | export function isBinaryFile(file) { |
| 327 | if (typeof file === "string") return isBinaryPath(file); |
| 328 | if (!file) return false; |
| 329 | |
| 330 | const mime = file.mime || file.type; |
| 331 | if (isTextMime(mime)) return false; |
| 332 | if (isTextPath(file.url || file.path || file.name)) return false; |
| 333 | if (isBinaryMime(mime)) return true; |
| 334 | |
| 335 | return isBinaryPath(file.url || file.path || file.name); |
| 336 | } |
| 337 | |
| 338 | export function isTextPath(file) { |
| 339 | const path = String(file ?? "").split(/[?#]/)[0]; |