Files
awx/src/util/strings.js
Keith Grant 9d66b583b7 158 paginated data list (#180)
* working: rename OrganizationTeamsList to PaginatedDataList

* convert org notifications list fully to PaginatedDataList

* update NotificationList tests

* refactor org access to use PaginatedDataList

* update tests for org access refactor; fix pagination & sorting

* restore Add Role functionality to Org roles

* fix displayed text when list of items is empty

* preserve query params when navigating through pagination

* fix bugs after RBAC rebase

* fix lint errors, fix add org access button
2019-04-29 10:08:50 -04:00

17 lines
319 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)}`;
}