Type Alias MapValuesToKeysIfAllowed<T>

MapValuesToKeysIfAllowed<T>: {
    [K in keyof T]: T[K] extends PropertyKey
        ? K
        : never
}

将对象的值映射到键(如果值允许作为属性键)

Type Parameters

  • T

    原始对象类型