mirror of
https://github.com/sussy-code/smov.git
synced 2026-04-04 16:59:52 +00:00
11 lines
276 B
TypeScript
11 lines
276 B
TypeScript
function normalizeTitle(title: string): string {
|
|
return title
|
|
.trim()
|
|
.toLowerCase()
|
|
.replace(/['":]/g, "")
|
|
.replace(/[^a-zA-Z0-9]+/g, "_");
|
|
}
|
|
|
|
export function compareTitle(a: string, b: string): boolean {
|
|
return normalizeTitle(a) === normalizeTitle(b);
|
|
}
|