movie-web/src/utils/normalizeTitle.ts

8 lines
168 B
TypeScript
Raw Normal View History

2023-02-21 14:17:36 -06:00
export function normalizeTitle(title: string): string {
return title
.trim()
.toLowerCase()
.replace(/['":]/g, "")
.replace(/[^a-zA-Z0-9]+/g, "_");
}