MCPcopy Create free account
hub / github.com/anomalyco/models.dev / compareSearchDates

Function compareSearchDates

packages/web/src/index.ts:203–208  ·  view source on GitHub ↗
(a?: string, b?: string)

Source from the content-addressed store, hash-verified

201}
202
203function 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
210function searchSortDate(item: SearchIndexItem) {
211 return item.releaseDate ?? item.updated;

Callers 1

rankSearchItemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected