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

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • 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.