From 314c3d94b0ac780439ad26d66eae9250d6ded1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Ga=C5=86=C4=A3is?= Date: Fri, 4 Nov 2022 15:21:43 +0200 Subject: [PATCH] Update $ElementType to support keyofStringsOnly:true Fixes #179 --- src/utility-types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utility-types.ts b/src/utility-types.ts index 7755466..46aec1e 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -95,7 +95,7 @@ export type $PropertyType = T[K]; export type $ElementType< T extends { [P in K & any]: any }, K extends keyof T | number -> = T[K]; +> = T extends [] ? T[K] : T[Exclude>]; /** * $Call