(a?: string, b?: string)
| 201 | } |
| 202 | |
| 203 | function compareSearchDates(a?: string, b?: string) { |
| 204 | if (a === undefined && b === undefined) return 0; |
| 205 | if (a === undefined) return 1; |
| 206 | if (b === undefined) return -1; |
| 207 | return b.localeCompare(a); |
| 208 | } |
| 209 | |
| 210 | function searchSortDate(item: SearchIndexItem) { |
| 211 | return item.releaseDate ?? item.updated; |