@naturalcycles/js-lib 14.271.2 → 14.272.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.
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts the first character of string to upper case and the remaining to lower case.
|
|
3
|
+
* Returns a type-safe capitalized string.
|
|
3
4
|
*/
|
|
4
|
-
export declare function _capitalize(s?: string): string
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export declare function _capitalize(s?: string): Capitalize<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Convert a string to a type-safe uppercase string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function _toUpperCase(s: string): Uppercase<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Convert a string to a type-safe lowercase string.
|
|
12
|
+
*/
|
|
13
|
+
export declare function _toLowercase(s: string): Lowercase<string>;
|
|
14
|
+
export declare function _upperFirst(s?: string): Capitalize<string>;
|
|
15
|
+
export declare function _lowerFirst(s: string): Uncapitalize<string>;
|
|
7
16
|
/**
|
|
8
17
|
* Like String.split(), but with limit, returning the tail together with last element.
|
|
9
18
|
*
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports._capitalize = _capitalize;
|
|
4
|
+
exports._toUpperCase = _toUpperCase;
|
|
5
|
+
exports._toLowercase = _toLowercase;
|
|
4
6
|
exports._upperFirst = _upperFirst;
|
|
5
7
|
exports._lowerFirst = _lowerFirst;
|
|
6
8
|
exports._split = _split;
|
|
@@ -15,15 +17,28 @@ exports._substringBetweenLast = _substringBetweenLast;
|
|
|
15
17
|
exports._nl2br = _nl2br;
|
|
16
18
|
/**
|
|
17
19
|
* Converts the first character of string to upper case and the remaining to lower case.
|
|
20
|
+
* Returns a type-safe capitalized string.
|
|
18
21
|
*/
|
|
19
22
|
function _capitalize(s = '') {
|
|
20
|
-
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
|
23
|
+
return (s.charAt(0).toUpperCase() + s.slice(1).toLowerCase());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Convert a string to a type-safe uppercase string.
|
|
27
|
+
*/
|
|
28
|
+
function _toUpperCase(s) {
|
|
29
|
+
return s.toUpperCase();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Convert a string to a type-safe lowercase string.
|
|
33
|
+
*/
|
|
34
|
+
function _toLowercase(s) {
|
|
35
|
+
return s.toLowerCase();
|
|
21
36
|
}
|
|
22
37
|
function _upperFirst(s = '') {
|
|
23
|
-
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
38
|
+
return (s.charAt(0).toUpperCase() + s.slice(1));
|
|
24
39
|
}
|
|
25
40
|
function _lowerFirst(s) {
|
|
26
|
-
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
41
|
+
return (s.charAt(0).toLowerCase() + s.slice(1));
|
|
27
42
|
}
|
|
28
43
|
/**
|
|
29
44
|
* Like String.split(), but with limit, returning the tail together with last element.
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts the first character of string to upper case and the remaining to lower case.
|
|
3
|
+
* Returns a type-safe capitalized string.
|
|
3
4
|
*/
|
|
4
5
|
export function _capitalize(s = '') {
|
|
5
|
-
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
|
6
|
+
return (s.charAt(0).toUpperCase() + s.slice(1).toLowerCase());
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Convert a string to a type-safe uppercase string.
|
|
10
|
+
*/
|
|
11
|
+
export function _toUpperCase(s) {
|
|
12
|
+
return s.toUpperCase();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Convert a string to a type-safe lowercase string.
|
|
16
|
+
*/
|
|
17
|
+
export function _toLowercase(s) {
|
|
18
|
+
return s.toLowerCase();
|
|
6
19
|
}
|
|
7
20
|
export function _upperFirst(s = '') {
|
|
8
|
-
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
21
|
+
return (s.charAt(0).toUpperCase() + s.slice(1));
|
|
9
22
|
}
|
|
10
23
|
export function _lowerFirst(s) {
|
|
11
|
-
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
24
|
+
return (s.charAt(0).toLowerCase() + s.slice(1));
|
|
12
25
|
}
|
|
13
26
|
/**
|
|
14
27
|
* Like String.split(), but with limit, returning the tail together with last element.
|
package/package.json
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts the first character of string to upper case and the remaining to lower case.
|
|
3
|
+
* Returns a type-safe capitalized string.
|
|
3
4
|
*/
|
|
4
|
-
export function _capitalize(s = ''): string {
|
|
5
|
-
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase()
|
|
5
|
+
export function _capitalize(s = ''): Capitalize<string> {
|
|
6
|
+
return (s.charAt(0).toUpperCase() + s.slice(1).toLowerCase()) as Capitalize<string>
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Convert a string to a type-safe uppercase string.
|
|
11
|
+
*/
|
|
12
|
+
export function _toUpperCase(s: string): Uppercase<string> {
|
|
13
|
+
return s.toUpperCase() as Uppercase<string>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Convert a string to a type-safe lowercase string.
|
|
18
|
+
*/
|
|
19
|
+
export function _toLowercase(s: string): Lowercase<string> {
|
|
20
|
+
return s.toLowerCase() as Lowercase<string>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function _upperFirst(s = ''): Capitalize<string> {
|
|
24
|
+
return (s.charAt(0).toUpperCase() + s.slice(1)) as Capitalize<string>
|
|
10
25
|
}
|
|
11
26
|
|
|
12
|
-
export function _lowerFirst(s: string): string {
|
|
13
|
-
return s.charAt(0).toLowerCase() + s.slice(1)
|
|
27
|
+
export function _lowerFirst(s: string): Uncapitalize<string> {
|
|
28
|
+
return (s.charAt(0).toLowerCase() + s.slice(1)) as Uncapitalize<string>
|
|
14
29
|
}
|
|
15
30
|
|
|
16
31
|
/**
|