mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 18:18:06 +08:00
feat: add common-utils (#2374)
This commit is contained in:
11
lib/utils/common-utils.js
Normal file
11
lib/utils/common-utils.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// convert a string into title case
|
||||
const toTitleCase = (str) =>
|
||||
str
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
.map((word) => word.replace(word[0], word[0].toUpperCase()))
|
||||
.join(' ');
|
||||
|
||||
module.exports = {
|
||||
toTitleCase,
|
||||
};
|
||||
Reference in New Issue
Block a user