summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/lib/shared/string-utils.js
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2021-05-22 07:15:17 +0200
committerLuigi Pinca <luigipinca@gmail.com>2021-05-26 18:22:04 +0200
commitb6471c9e7623bf211873ae4bc024ab0f5558e08f (patch)
treea9f923dafe5940f460276a1d0e17c20b12993db6 /tools/node_modules/eslint/lib/shared/string-utils.js
parentd39871215c2bf916982d636cc78c7bbde2489bfe (diff)
downloadnode-new-b6471c9e7623bf211873ae4bc024ab0f5558e08f.tar.gz
tools: update ESLint to 7.27.0
PR-URL: https://github.com/nodejs/node/pull/38764 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/lib/shared/string-utils.js')
-rw-r--r--tools/node_modules/eslint/lib/shared/string-utils.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/lib/shared/string-utils.js b/tools/node_modules/eslint/lib/shared/string-utils.js
new file mode 100644
index 0000000000..e4a55d7993
--- /dev/null
+++ b/tools/node_modules/eslint/lib/shared/string-utils.js
@@ -0,0 +1,22 @@
+/**
+ * @fileoverview Utilities to operate on strings.
+ * @author Stephen Wade
+ */
+
+"use strict";
+
+/**
+ * Converts the first letter of a string to uppercase.
+ * @param {string} string The string to operate on
+ * @returns {string} The converted string
+ */
+function upperCaseFirst(string) {
+ if (string.length <= 1) {
+ return string.toUpperCase();
+ }
+ return string[0].toUpperCase() + string.slice(1);
+}
+
+module.exports = {
+ upperCaseFirst
+};