(candidates: readonly StaticFace[])
| 10 | // which do not have weight 400, or are only italic. |
| 11 | const pickStaticIndexCSS = (faces: FontFace[]): string | undefined => { |
| 12 | const findClosestFace = (candidates: readonly StaticFace[]) => { |
| 13 | if (candidates.length === 0) { |
| 14 | return undefined; |
| 15 | } |
| 16 | |
| 17 | const weight = findClosestWeight(candidates.map((face) => face.weight)); |
| 18 | return candidates.find((face) => face.weight === weight); |
| 19 | }; |
| 20 | |
| 21 | const staticFaces = faces.filter(isStaticFace); |
| 22 | const normalFaces = staticFaces.filter((face) => face.style === 'normal'); |
no test coverage detected