main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
413 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Check if the first letter of a string is capitalized.
|
---|
5 | * @param {String} word String to check
|
---|
6 | * @returns {Boolean} True if first letter is capitalized.
|
---|
7 | */
|
---|
8 | function isFirstLetterCapitalized(word) {
|
---|
9 | if (!word) {
|
---|
10 | return false;
|
---|
11 | }
|
---|
12 | const firstLetter = word.replace(/^_+/, '').charAt(0);
|
---|
13 | return firstLetter.toUpperCase() === firstLetter;
|
---|
14 | }
|
---|
15 |
|
---|
16 | module.exports = isFirstLetterCapitalized;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.