From 7905ef6c106b40ca6e0be784024952198efab7ee Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Fri, 5 Jul 2024 15:53:32 +0100 Subject: [PATCH] feat: replacing underscore with whitespace --- src/shared/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/index.ts b/src/shared/index.ts index 8f45be6b..409bdbc9 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -51,9 +51,13 @@ export const removeSpecialEditionFromName = (name: string) => export const removeDuplicateSpaces = (name: string) => name.replace(/\s{2,}/g, " "); +export const replaceUnderscoreWithSpace = (name: string) => + name.replace(/_/g, " "); + export const formatName = pipe( removeReleaseYearFromName, removeSpecialEditionFromName, + replaceUnderscoreWithSpace, (str) => str.replace(/DIRECTOR'S CUT/g, ""), removeSymbolsFromName, removeDuplicateSpaces,