Added PornCZ.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
function capitalize(string, trim = true) {
|
||||
function capitalize(string, { trim = true, uncapitalize = false } = {}) {
|
||||
if (!string) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const capitalized = string
|
||||
.split(/\s+/)
|
||||
.map(component => `${component.charAt(0).toUpperCase()}${component.slice(1)}`)
|
||||
.map(component => `${component.charAt(0).toUpperCase()}${uncapitalize ? component.slice(1).toLowerCase() : component.slice(1)}`)
|
||||
.join(' ');
|
||||
|
||||
return trim ? capitalized.trim() : capitalized;
|
||||
|
||||
Reference in New Issue
Block a user