feat: music caching v1.1.0
This commit is contained in:
parent
af8ac970c5
commit
78140677cf
8 changed files with 1164 additions and 47 deletions
3
src/utils/arrays.js
Normal file
3
src/utils/arrays.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
getKeyByValue: (object, value) => Object.keys(object).find((key) => object[key].includes(value)),
|
||||
}
|
|
@ -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))
|
||||
})
|
||||
|
|
Reference in a new issue