source: imaps-frontend/node_modules/eslint-plugin-react/lib/util/isFirstLetterCapitalized.js

main
Last change on this file 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 */
8function isFirstLetterCapitalized(word) {
9 if (!word) {
10 return false;
11 }
12 const firstLetter = word.replace(/^_+/, '').charAt(0);
13 return firstLetter.toUpperCase() === firstLetter;
14}
15
16module.exports = isFirstLetterCapitalized;
Note: See TracBrowser for help on using the repository browser.