Skip to content

Commit 5e7f7c5

Browse files
authored
Fix compatibility with TypeScript 4.8 (#98)
1 parent 1082010 commit 5e7f7c5

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

index.d.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ export type CamelCaseKeys<
4545
> = T extends readonly any[]
4646
// Handle arrays or tuples.
4747
? {
48+
[P in keyof T]: T[P] extends Record<string, any> | readonly any[]
4849
// eslint-disable-next-line @typescript-eslint/ban-types
49-
[P in keyof T]: {} extends CamelCaseKeys<T[P]>
50-
? T[P]
51-
: CamelCaseKeys<
52-
T[P],
53-
Deep,
54-
IsPascalCase,
55-
Exclude,
56-
StopPaths
57-
>;
50+
? {} extends CamelCaseKeys<T[P]>
51+
? T[P]
52+
: CamelCaseKeys<
53+
T[P],
54+
Deep,
55+
IsPascalCase,
56+
Exclude,
57+
StopPaths
58+
>
59+
: T[P];
5860
}
5961
: T extends Record<string, any>
6062
// Handle objects.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"devDependencies": {
6262
"ava": "^4.3.0",
6363
"matcha": "^0.7.0",
64-
"tsd": "^0.20.0",
64+
"tsd": "^0.23.0",
6565
"xo": "^0.49.0"
6666
},
6767
"xo": {

0 commit comments

Comments
 (0)