Skip to content

Commit

Permalink
Fix compatibility with TypeScript 4.8 (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
Masa-Shin authored Aug 29, 2022
1 parent 1082010 commit 5e7f7c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@ export type CamelCaseKeys<
> = T extends readonly any[]
// Handle arrays or tuples.
? {
[P in keyof T]: T[P] extends Record<string, any> | readonly any[]
// eslint-disable-next-line @typescript-eslint/ban-types
[P in keyof T]: {} extends CamelCaseKeys<T[P]>
? T[P]
: CamelCaseKeys<
T[P],
Deep,
IsPascalCase,
Exclude,
StopPaths
>;
? {} extends CamelCaseKeys<T[P]>
? T[P]
: CamelCaseKeys<
T[P],
Deep,
IsPascalCase,
Exclude,
StopPaths
>
: T[P];
}
: T extends Record<string, any>
// Handle objects.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"devDependencies": {
"ava": "^4.3.0",
"matcha": "^0.7.0",
"tsd": "^0.20.0",
"tsd": "^0.23.0",
"xo": "^0.49.0"
},
"xo": {
Expand Down

0 comments on commit 5e7f7c5

Please sign in to comment.