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

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 387 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 */
8module.exports = function isFirstLetterCapitalized(word) {
9 if (!word) {
10 return false;
11 }
12 const firstLetter = word.replace(/^_+/, '').charAt(0);
13 return firstLetter.toUpperCase() === firstLetter;
14};
Note: See TracBrowser for help on using the repository browser.