]> git.proxmox.com Git - pve-eslint.git/blame - eslint/lib/shared/string-utils.js
build: add missing dh-nodejs to build-dependencies
[pve-eslint.git] / eslint / lib / shared / string-utils.js
CommitLineData
5422a9cc
TL
1/**
2 * @fileoverview Utilities to operate on strings.
3 * @author Stephen Wade
4 */
5
6"use strict";
7
8/**
9 * Converts the first letter of a string to uppercase.
10 * @param {string} string The string to operate on
11 * @returns {string} The converted string
12 */
13function upperCaseFirst(string) {
14 if (string.length <= 1) {
15 return string.toUpperCase();
16 }
17 return string[0].toUpperCase() + string.slice(1);
18}
19
20module.exports = {
21 upperCaseFirst
22};