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
RevLine 
[d565449]1'use strict';
2
3/**
4 * Check if the first letter of a string is capitalized.
[0c6b92a]5 * @param {string} word String to check
6 * @returns {boolean} True if first letter is capitalized.
[d565449]7 */
[0c6b92a]8module.exports = function isFirstLetterCapitalized(word) {
[d565449]9 if (!word) {
10 return false;
11 }
12 const firstLetter = word.replace(/^_+/, '').charAt(0);
13 return firstLetter.toUpperCase() === firstLetter;
[0c6b92a]14};
Note: See TracBrowser for help on using the repository browser.