@baseplate-dev/utils 0.3.7 → 0.4.0
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.
- package/dist/string/case.d.ts +29 -0
- package/dist/string/case.d.ts.map +1 -0
- package/dist/string/case.js +39 -0
- package/dist/string/case.js.map +1 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.d.ts.map +1 -1
- package/dist/string/index.js +1 -0
- package/dist/string/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lowercase the first character of a string, leaving the remainder unchanged.
|
|
3
|
+
*
|
|
4
|
+
* - Returns the input unchanged when it's an empty string
|
|
5
|
+
* - Non-alphabetic first characters are returned as-is
|
|
6
|
+
*
|
|
7
|
+
* @param str - The input string
|
|
8
|
+
* @returns The string with the first character lowercased
|
|
9
|
+
* @example
|
|
10
|
+
* lowercaseFirstChar('Hello') // 'hello'
|
|
11
|
+
* lowercaseFirstChar('hello') // 'hello'
|
|
12
|
+
* lowercaseFirstChar('1World') // '1World'
|
|
13
|
+
*/
|
|
14
|
+
export declare function lowercaseFirstChar(str: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Uppercase the first character of a string, leaving the remainder unchanged.
|
|
17
|
+
*
|
|
18
|
+
* - Returns the input unchanged when it's an empty string
|
|
19
|
+
* - Non-alphabetic first characters are returned as-is
|
|
20
|
+
*
|
|
21
|
+
* @param str - The input string
|
|
22
|
+
* @returns The string with the first character uppercased
|
|
23
|
+
* @example
|
|
24
|
+
* uppercaseFirstChar('hello') // 'Hello'
|
|
25
|
+
* uppercaseFirstChar('Hello') // 'Hello'
|
|
26
|
+
* uppercaseFirstChar('#tag') // '#tag'
|
|
27
|
+
*/
|
|
28
|
+
export declare function uppercaseFirstChar(str: string): string;
|
|
29
|
+
//# sourceMappingURL=case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../src/string/case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKtD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lowercase the first character of a string, leaving the remainder unchanged.
|
|
3
|
+
*
|
|
4
|
+
* - Returns the input unchanged when it's an empty string
|
|
5
|
+
* - Non-alphabetic first characters are returned as-is
|
|
6
|
+
*
|
|
7
|
+
* @param str - The input string
|
|
8
|
+
* @returns The string with the first character lowercased
|
|
9
|
+
* @example
|
|
10
|
+
* lowercaseFirstChar('Hello') // 'hello'
|
|
11
|
+
* lowercaseFirstChar('hello') // 'hello'
|
|
12
|
+
* lowercaseFirstChar('1World') // '1World'
|
|
13
|
+
*/
|
|
14
|
+
export function lowercaseFirstChar(str) {
|
|
15
|
+
if (str.length === 0) {
|
|
16
|
+
return str;
|
|
17
|
+
}
|
|
18
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Uppercase the first character of a string, leaving the remainder unchanged.
|
|
22
|
+
*
|
|
23
|
+
* - Returns the input unchanged when it's an empty string
|
|
24
|
+
* - Non-alphabetic first characters are returned as-is
|
|
25
|
+
*
|
|
26
|
+
* @param str - The input string
|
|
27
|
+
* @returns The string with the first character uppercased
|
|
28
|
+
* @example
|
|
29
|
+
* uppercaseFirstChar('hello') // 'Hello'
|
|
30
|
+
* uppercaseFirstChar('Hello') // 'Hello'
|
|
31
|
+
* uppercaseFirstChar('#tag') // '#tag'
|
|
32
|
+
*/
|
|
33
|
+
export function uppercaseFirstChar(str) {
|
|
34
|
+
if (str.length === 0) {
|
|
35
|
+
return str;
|
|
36
|
+
}
|
|
37
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.js","sourceRoot":"","sources":["../../src/string/case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/string/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
package/dist/string/index.js
CHANGED
package/dist/string/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseplate-dev/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Shared utility functions for Baseplate",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"utilities",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"prettier": "3.6.2",
|
|
53
53
|
"typescript": "5.8.3",
|
|
54
54
|
"vitest": "3.2.4",
|
|
55
|
-
"@baseplate-dev/tools": "0.
|
|
55
|
+
"@baseplate-dev/tools": "0.4.0"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": "^22.0.0"
|