es-toolkit 1.16.0-dev.471 → 1.16.0-dev.472

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,6 +94,7 @@ export { lowerCase } from '../string/lowerCase.mjs';
94
94
  export { startCase } from '../string/startCase.mjs';
95
95
  export { capitalize } from '../string/capitalize.mjs';
96
96
  export { pascalCase } from '../string/pascalCase.mjs';
97
+ export { upperFirst } from '../string/upperFirst.mjs';
97
98
  export { lowerFirst } from '../string/lowerFirst.mjs';
98
99
  export { chunk } from './array/chunk.mjs';
99
100
  export { concat } from './array/concat.mjs';
@@ -94,6 +94,7 @@ export { lowerCase } from '../string/lowerCase.js';
94
94
  export { startCase } from '../string/startCase.js';
95
95
  export { capitalize } from '../string/capitalize.js';
96
96
  export { pascalCase } from '../string/pascalCase.js';
97
+ export { upperFirst } from '../string/upperFirst.js';
97
98
  export { lowerFirst } from '../string/lowerFirst.js';
98
99
  export { chunk } from './array/chunk.js';
99
100
  export { concat } from './array/concat.js';
@@ -919,6 +919,7 @@ exports.lowerFirst = string_index.lowerFirst;
919
919
  exports.pascalCase = string_index.pascalCase;
920
920
  exports.snakeCase = string_index.snakeCase;
921
921
  exports.startCase = string_index.startCase;
922
+ exports.upperFirst = string_index.upperFirst;
922
923
  exports.ary = ary;
923
924
  exports.bind = bind;
924
925
  exports.chunk = chunk;
@@ -95,6 +95,7 @@ export { lowerCase } from '../string/lowerCase.mjs';
95
95
  export { startCase } from '../string/startCase.mjs';
96
96
  export { capitalize } from '../string/capitalize.mjs';
97
97
  export { pascalCase } from '../string/pascalCase.mjs';
98
+ export { upperFirst } from '../string/upperFirst.mjs';
98
99
  export { lowerFirst } from '../string/lowerFirst.mjs';
99
100
  export { chunk } from './array/chunk.mjs';
100
101
  export { concat } from './array/concat.mjs';
package/dist/index.d.mts CHANGED
@@ -112,4 +112,5 @@ export { lowerCase } from './string/lowerCase.mjs';
112
112
  export { startCase } from './string/startCase.mjs';
113
113
  export { capitalize } from './string/capitalize.mjs';
114
114
  export { pascalCase } from './string/pascalCase.mjs';
115
+ export { upperFirst } from './string/upperFirst.mjs';
115
116
  export { lowerFirst } from './string/lowerFirst.mjs';
package/dist/index.d.ts CHANGED
@@ -112,4 +112,5 @@ export { lowerCase } from './string/lowerCase.js';
112
112
  export { startCase } from './string/startCase.js';
113
113
  export { capitalize } from './string/capitalize.js';
114
114
  export { pascalCase } from './string/pascalCase.js';
115
+ export { upperFirst } from './string/upperFirst.js';
115
116
  export { lowerFirst } from './string/lowerFirst.js';
package/dist/index.js CHANGED
@@ -132,3 +132,4 @@ exports.lowerFirst = string_index.lowerFirst;
132
132
  exports.pascalCase = string_index.pascalCase;
133
133
  exports.snakeCase = string_index.snakeCase;
134
134
  exports.startCase = string_index.startCase;
135
+ exports.upperFirst = string_index.upperFirst;
package/dist/index.mjs CHANGED
@@ -112,4 +112,5 @@ export { lowerCase } from './string/lowerCase.mjs';
112
112
  export { startCase } from './string/startCase.mjs';
113
113
  export { capitalize } from './string/capitalize.mjs';
114
114
  export { pascalCase } from './string/pascalCase.mjs';
115
+ export { upperFirst } from './string/upperFirst.mjs';
115
116
  export { lowerFirst } from './string/lowerFirst.mjs';
@@ -5,4 +5,5 @@ export { lowerCase } from './lowerCase.mjs';
5
5
  export { startCase } from './startCase.mjs';
6
6
  export { capitalize } from './capitalize.mjs';
7
7
  export { pascalCase } from './pascalCase.mjs';
8
+ export { upperFirst } from './upperFirst.mjs';
8
9
  export { lowerFirst } from './lowerFirst.mjs';
@@ -5,4 +5,5 @@ export { lowerCase } from './lowerCase.js';
5
5
  export { startCase } from './startCase.js';
6
6
  export { capitalize } from './capitalize.js';
7
7
  export { pascalCase } from './pascalCase.js';
8
+ export { upperFirst } from './upperFirst.js';
8
9
  export { lowerFirst } from './lowerFirst.js';
@@ -57,6 +57,10 @@ const pascalCase = (str) => {
57
57
  return words.map(word => capitalize(word)).join('');
58
58
  };
59
59
 
60
+ const upperFirst = (str) => {
61
+ return str.substring(0, 1).toUpperCase() + str.substring(1);
62
+ };
63
+
60
64
  const lowerFirst = (str) => {
61
65
  return str.substring(0, 1).toLowerCase() + str.substring(1);
62
66
  };
@@ -69,3 +73,4 @@ exports.lowerFirst = lowerFirst;
69
73
  exports.pascalCase = pascalCase;
70
74
  exports.snakeCase = snakeCase;
71
75
  exports.startCase = startCase;
76
+ exports.upperFirst = upperFirst;
@@ -5,4 +5,5 @@ export { lowerCase } from './lowerCase.mjs';
5
5
  export { startCase } from './startCase.mjs';
6
6
  export { capitalize } from './capitalize.mjs';
7
7
  export { pascalCase } from './pascalCase.mjs';
8
+ export { upperFirst } from './upperFirst.mjs';
8
9
  export { lowerFirst } from './lowerFirst.mjs';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts the first character of string to upper case.
3
+ *
4
+ * @param {string} str - The string that is to be changed
5
+ * @returns {string} - The converted string.
6
+ *
7
+ * @example
8
+ * const convertedStr1 = upperCase('fred') // returns 'fred'
9
+ * const convertedStr2 = upperCase('Fred') // returns 'Fred'
10
+ * const convertedStr3 = upperCase('FRED') // returns 'FRED'
11
+ */
12
+ declare const upperFirst: (str: string) => string;
13
+
14
+ export { upperFirst };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts the first character of string to upper case.
3
+ *
4
+ * @param {string} str - The string that is to be changed
5
+ * @returns {string} - The converted string.
6
+ *
7
+ * @example
8
+ * const convertedStr1 = upperCase('fred') // returns 'fred'
9
+ * const convertedStr2 = upperCase('Fred') // returns 'Fred'
10
+ * const convertedStr3 = upperCase('FRED') // returns 'FRED'
11
+ */
12
+ declare const upperFirst: (str: string) => string;
13
+
14
+ export { upperFirst };
@@ -0,0 +1,5 @@
1
+ const upperFirst = (str) => {
2
+ return str.substring(0, 1).toUpperCase() + str.substring(1);
3
+ };
4
+
5
+ export { upperFirst };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
3
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
4
- "version": "1.16.0-dev.471+02643bcb",
4
+ "version": "1.16.0-dev.472+16fda3f2",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {