feat: music caching v1.1.0

This commit is contained in:
Cory Dransfeldt 2023-07-26 12:10:18 -07:00
parent af8ac970c5
commit 78140677cf
No known key found for this signature in database
8 changed files with 1164 additions and 47 deletions

3
src/utils/arrays.js Normal file
View file

@ -0,0 +1,3 @@
module.exports = {
getKeyByValue: (object, value) => Object.keys(object).find((key) => object[key].includes(value)),
}

View file

@ -10,11 +10,12 @@ module.exports = {
*/
titleCase: (string) => {
if (!string) return ''
if (titleCaseExceptions.artists.includes(string)) return string
return string
.toLowerCase()
.split(' ')
.map((word, i) => {
return titleCaseExceptions.exceptions.includes(word) && i !== 0
return titleCaseExceptions.words.includes(word) && i !== 0
? word
: word.charAt(0).toUpperCase().concat(word.substring(1))
})