(ext, type0, type1)
| 95 | * @returns {string} preferred type |
| 96 | */ |
| 97 | const preferredType = (ext, type0, type1) => { |
| 98 | const score0 = type0 ? mimeScore(type0, db[type0].source) : 0; |
| 99 | const score1 = type1 ? mimeScore(type1, db[type1].source) : 0; |
| 100 | |
| 101 | return score0 > score1 ? type0 : type1; |
| 102 | }; |
| 103 | |
| 104 | /** |
| 105 | * @param {Record<string, readonly string[]>} extensions extensions |