mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
* adding package-lock.json * deleted unsured file * Removes and unused file * Fixes errant styling change * Fixes an error and uses a prop that PF recognizes * Updates PR to use API Modules * Fixes PR Issues * Addes tests to Templates * Addresses PR Issues * Revert package-lock.json
24 lines
469 B
JavaScript
24 lines
469 B
JavaScript
|
|
export function pluralize (str) {
|
|
return str[str.length - 1] === 's' ? `${str}es` : `${str}s`;
|
|
}
|
|
|
|
export function getArticle (str) {
|
|
const first = str[0];
|
|
if (('aeiou').includes(first)) {
|
|
return 'an';
|
|
}
|
|
return 'a';
|
|
}
|
|
|
|
export function ucFirst (str) {
|
|
return `${str[0].toUpperCase()}${str.substr(1)}`;
|
|
}
|
|
|
|
export const toTitleCase = (type) => type
|
|
.toLowerCase()
|
|
.split('_')
|
|
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
.join(' ');
|
|
|