From 5e7f7c5731b3301043681c3371b2d68deb90754b Mon Sep 17 00:00:00 2001 From: Masa-Shin <34234442+Masa-Shin@users.noreply.github.com> Date: Mon, 29 Aug 2022 16:23:57 +0900 Subject: [PATCH] Fix compatibility with TypeScript 4.8 (#98) --- index.d.ts | 20 +++++++++++--------- package.json | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index f4ee3c3..53a393c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -45,16 +45,18 @@ export type CamelCaseKeys< > = T extends readonly any[] // Handle arrays or tuples. ? { + [P in keyof T]: T[P] extends Record | readonly any[] // eslint-disable-next-line @typescript-eslint/ban-types - [P in keyof T]: {} extends CamelCaseKeys - ? T[P] - : CamelCaseKeys< - T[P], - Deep, - IsPascalCase, - Exclude, - StopPaths - >; + ? {} extends CamelCaseKeys + ? T[P] + : CamelCaseKeys< + T[P], + Deep, + IsPascalCase, + Exclude, + StopPaths + > + : T[P]; } : T extends Record // Handle objects. diff --git a/package.json b/package.json index a1f9f49..c6a703f 100644 --- a/package.json +++ b/package.json @@ -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": {