fix: use `PropertyKey`

This commit is contained in:
KazariEX 2024-10-31 18:15:19 +08:00
parent 61eab94700
commit b2c140424c
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ export type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] }
// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N
export type IsKeyValues<T, K = string> = IfAny<
export type IsKeyValues<T, K = PropertyKey> = IfAny<
T,
false,
T extends object ? (NonNullable<keyof T> extends K ? true : false) : false