mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: title case following The Chicago Manual of Style (#14048)
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const title = require('title');
|
||||
|
||||
// convert a string into title case
|
||||
const toTitleCase = (str) =>
|
||||
str
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
.map((word) => word.replace(word[0], word[0].toUpperCase()))
|
||||
.join(' ');
|
||||
const toTitleCase = (str) => title(str);
|
||||
|
||||
const rWhiteSpace = /\s+/;
|
||||
const rAllWhiteSpace = /\s+/g;
|
||||
|
||||
Reference in New Issue
Block a user