pangea-helpers 1.3.32 → 1.3.33
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/helpers/string.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
import type { CapitalizeFirstLetter, DecapitalizeFirstLetter } from '../types';
|
|
2
|
+
export declare function getFirstChartInLowercase<T extends string>(str: T): DecapitalizeFirstLetter<T>;
|
|
3
|
+
export declare function getFirstChartInUppercase<T extends string>(str: T): CapitalizeFirstLetter<T>;
|
|
3
4
|
export declare function camelToSnake(str: String): string;
|
|
4
5
|
export declare function camelToUpperSnake(str: String): string;
|
|
5
6
|
export declare function camelToKebab(str: String): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,3 +17,5 @@ export type ExtractSuffixes<T, P extends string, Sep extends string = '__'> = {
|
|
|
17
17
|
export type ExtractKeysWithoutSuffix<T, S extends string> = {
|
|
18
18
|
[K in keyof T]: K extends `${string}${S}` ? never : K;
|
|
19
19
|
}[keyof T];
|
|
20
|
+
export type CapitalizeFirstLetter<T extends string> = T extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : T;
|
|
21
|
+
export type DecapitalizeFirstLetter<T extends string> = T extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}` : T;
|