mirror of
https://github.com/starshardstudio/peafowl.git
synced 2024-11-22 13:04:20 +00:00
17 lines
412 B
TypeScript
17 lines
412 B
TypeScript
|
import {Rating} from "./rating.ts"
|
||
|
import {GlobalData} from "./site.ts"
|
||
|
|
||
|
|
||
|
export interface ReviewData extends GlobalData {
|
||
|
name?: string,
|
||
|
name_sort?: string,
|
||
|
rating?: Rating,
|
||
|
content?: string,
|
||
|
}
|
||
|
|
||
|
export function compareName(a: ReviewData, b: ReviewData): number {
|
||
|
const aName = a.name_sort ?? a.name ?? ""
|
||
|
const bName = b.name_sort ?? b.name ?? ""
|
||
|
|
||
|
return aName.localeCompare(bName)
|
||
|
}
|