Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTitle() needs an update #42

Open
spenpal opened this issue Jun 14, 2024 · 0 comments
Open

getTitle() needs an update #42

spenpal opened this issue Jun 14, 2024 · 0 comments

Comments

@spenpal
Copy link

spenpal commented Jun 14, 2024

const getTitle = (title, artist) => {
	return `${title} ${artist}`
		.toLowerCase()
		.replace(/ *\([^)]*\) */g, '')
		.replace(/ *\[[^\]]*]/, '')
		.replace(/feat.|ft./g, '')
		.replace(/\s+/g, ' ')
		.trim();
};

console.log(getTitle("All Night (BTS World Original Soundtrack) (Pt. 3)", "BTS"))
console.log(getTitle("(Nice Dream)", "Radiohead"))
console.log(getTitle("Nice to Meet You", "Imagine Dragons"))
console.log(getTitle("Nice Guy (with Jessie Reyez)", "Eminem"))
console.log(getTitle("Godzilla (feat. Juice WRLD)", "Eminem"))
all nightbts
radiohead
nice to meet you imagine dragons
nice guyeminem
godzillaeminem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant