mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-24 08:31:20 +00:00
Fix processor
This commit is contained in:
parent
756f822f7f
commit
36d570f1a5
@ -12,7 +12,15 @@ export const capitalizeEachFirstChar = {
|
||||
|
||||
const leadingSpaces = value.match(/^\s*/)?.[0] || '';
|
||||
const trailingSpaces = value.match(/\s*$/)?.[0] || '';
|
||||
const core = value.trim().replace(/\b\w/g, (char) => char.toUpperCase());
|
||||
|
||||
const core = value
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.map(
|
||||
(word) =>
|
||||
word.charAt(0).toLocaleUpperCase() + word.slice(1).toLocaleLowerCase()
|
||||
)
|
||||
.join(' ');
|
||||
|
||||
return leadingSpaces + core + trailingSpaces;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user