2024-06-16 11:49:13 +00:00
|
|
|
import {Rating} from "./rating.ts"
|
|
|
|
import {GlobalData} from "./site.ts"
|
|
|
|
|
|
|
|
|
2024-11-21 05:37:11 +00:00
|
|
|
export interface ReviewIdentifier {
|
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ReviewWikidataIdentifier extends ReviewIdentifier {
|
|
|
|
type: "wikidata",
|
|
|
|
q: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-06-16 11:49:13 +00:00
|
|
|
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)
|
|
|
|
}
|