@investtal/types 1.0.1 → 1.1.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/CHANGELOG.md +6 -0
- package/package.json +9 -3
- package/src/common.d.ts +10 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@investtal/types",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"author": "harrytran998",
|
|
5
5
|
"description": "Investtal base types",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -10,12 +10,18 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
13
|
-
"type-fest": "^4.
|
|
13
|
+
"type-fest": "^5.4.1"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=22"
|
|
17
17
|
},
|
|
18
|
-
"files": [
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"package.json",
|
|
21
|
+
"README.md",
|
|
22
|
+
"CHANGELOG.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
19
25
|
"publishConfig": {
|
|
20
26
|
"access": "public",
|
|
21
27
|
"tag": "latest",
|
package/src/common.d.ts
CHANGED
|
@@ -67,3 +67,13 @@ export type CamelToSnakeNested<T> = T extends object
|
|
|
67
67
|
[K in keyof T as CamelToSnakeCase<K & string>]: CamelToSnakeNested<T[K]>
|
|
68
68
|
}
|
|
69
69
|
: T
|
|
70
|
+
|
|
71
|
+
export type SnakeToCamelCase<S extends string> = S extends `${infer Head}_${infer Tail}`
|
|
72
|
+
? `${Head}${Capitalize<SnakeToCamelCase<Tail>>}`
|
|
73
|
+
: S
|
|
74
|
+
|
|
75
|
+
export type SnakeToCamelNested<T> = T extends object
|
|
76
|
+
? {
|
|
77
|
+
[K in keyof T as SnakeToCamelCase<K & string>]: SnakeToCamelNested<T[K]>
|
|
78
|
+
}
|
|
79
|
+
: T
|