(file)
| 344 | } |
| 345 | |
| 346 | export function isBinaryPath(file) { |
| 347 | const path = String(file ?? "").split(/[?#]/)[0]; |
| 348 | const basename = path.split(/[\\/]/).pop()?.toLowerCase() || ""; |
| 349 | |
| 350 | const lastDot = basename.lastIndexOf("."); |
| 351 | if (lastDot === -1) return false; |
| 352 | |
| 353 | const singleExtension = basename.slice(lastDot + 1); |
| 354 | if (binaryExtensionSet.has(singleExtension)) return true; |
| 355 | |
| 356 | const previousDot = basename.lastIndexOf(".", lastDot - 1); |
| 357 | if (previousDot === -1) return false; |
| 358 | |
| 359 | const compoundExtension = basename.slice(previousDot + 1); |
| 360 | return binaryExtensionSet.has(compoundExtension); |
| 361 | } |
| 362 | |
| 363 | export function isBinaryMime(mime) { |
| 364 | const normalized = normalizeMime(mime); |
no test coverage detected