diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2018-08-01 19:43:50 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-08-01 19:43:50 +0000 |
commit | fbfe04401deb7a08da03502282531364aa25d511 (patch) | |
tree | 1b8b25c8ca0f7e048aed07de9cdf24a44fc58c36 /app/assets/javascripts/lib | |
parent | c1fc33d590b3f853ec820fa33ebc114b86af692d (diff) | |
download | gitlab-ce-fbfe04401deb7a08da03502282531364aa25d511.tar.gz |
Add vanilla JS avatar_helper and update existing avatar helpers
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/text_utility.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js index 5f25c6ce1ae..2be3c97bd95 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js +++ b/app/assets/javascripts/lib/utils/text_utility.js @@ -76,6 +76,20 @@ export function capitalizeFirstCharacter(text) { } /** + * Returns the first character capitalized + * + * If falsey, returns empty string. + * + * @param {String} text + * @return {String} + */ +export function getFirstCharacterCapitalized(text) { + return text + ? text.charAt(0).toUpperCase() + : ''; +} + +/** * Replaces all html tags from a string with the given replacement. * * @param {String} string |